Path: blob/master/sourcetools/com.ibm.uma/com/ibm/uma/IConfiguration.java
6004 views
/*******************************************************************************1* Copyright (c) 2001, 2017 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/21package com.ibm.uma;2223import java.util.List;24import java.util.Set;2526import com.ibm.uma.om.Artifact;2728import freemarker.template.TemplateModel;29import freemarker.template.TemplateModelIterator;303132public interface IConfiguration {3334/**35* Obtain the filename used to store the module meta data.36*37* @return String instance containing the meta data filename.38*/39public abstract String getMetadataFilename();4041/**42* These methods allow for the grouping of targets43* into separate targets called 'phases'44*/4546/**47* Query the number of phases defined for this configuration.48*49* @return the number of phases50*/51public abstract int numberOfPhases();5253/**54* Converts the phase number into a text string. Phases a numbered from 0.55*56* @param phase57* @return a string representing the phase numbered phase.58*/59public abstract String phaseName(int phase);6061/**62* Converts a text string into the phase number. Phases are numbered from 0.63*64* @param phase65* @return an integer representing the phase number.66* @throws UMABadPhaseNameException - when the string phase does not67* map to a valid phase name.68*/69public abstract int phaseFromString( String phase ) throws UMABadPhaseNameException;7071/**72* Obtain a list of all the phase names. Phase 0 corresponds with73* the 0 entry in the list.74*75* @return A list of all the phase names in proper order.76*/77public abstract String[] phases();7879/**80* Obtain the name of the configuration.81*82* @return String instance containing the configuration name83*/84public abstract String getConfigurationName();8586/**87* Determine if a flag name is valid.88*89* @param flag90* @return true - when the flag name is valid, false otherwise.91*/92public abstract boolean isFlagValid(String flag);9394/**95* Determine if a flag is enabled or disabled.96*97* @param flag98* @return true - when the flag is enabled or set, and false otherwise.99* @note will return false if the false is not valid.100*/101public abstract boolean isFlagSet(String flag);102103/**104* Obtain a set of all known flags.105*106* @return a set of all known flag names.107*/108public abstract Set<String> getAllFlags();109110/**111* Obtain a set of all excluded artifacts.112*113* @return a set of all excluded artifact names.114*/115public abstract List<String> getExcludedArtifacts();116117/**118* Substitute one string for another.119*120* @param macro121* @return null if the macro is not known or a string that maps to the macro string.122*/123public abstract String replaceMacro(String macro);124125/**126* Define the string that would be returned when replaceMacro() is called.127* @param macro128* @param substitution129*/130public void defineMacro(String macro, String substitution);131132/**133* Obtain the platform.134*135* @return a reference to the platform used for this configuration.136* @throws UMAException137*/138public abstract IPlatform getPlatform() throws UMAException;139140/**141* Obtain a string containing a copyright notice to be included in142* all makefiles.143* @return a string containing a copyright notice format for use in makefiles.144* @throws UMAException145*/146public String getMakefileCopyrightNotice() throws UMAException;147148/**149* Allows the configuration implementation to extend the UMA data model150* supplied to the Freemarker engine.151*152* @param prefixTag a string representing the tree segments parsed so far153* @param extensionTag a string representing the next tag in the tree154* @return a TemplateModel that implements the extensionTag155* @throws UMAException156*/157public abstract TemplateModel getDataModelExtension(String prefixTag, String extensionTag) throws UMAException;158159/**160* Allows the configuration to list all properties available under the161* uma.spec.properties tag.162*163* @return a Freemarker iterator of all the properties available.164* @throws UMAException165*/166public abstract TemplateModelIterator getPropertiesIterator() throws UMAException;167168/**169* Obtain additional includes for an artifact.170*171* @return a string to append to the UMA_INCLUDES line172* @throws UMAException173*/174public abstract String getAdditionalIncludesForArtifact(Artifact artifact) throws UMAException;175176}177178179