Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/sourcetools/com.ibm.uma/com/ibm/uma/IConfiguration.java
6004 views
1
/*******************************************************************************
2
* Copyright (c) 2001, 2017 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* 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-exception
21
*******************************************************************************/
22
package com.ibm.uma;
23
24
import java.util.List;
25
import java.util.Set;
26
27
import com.ibm.uma.om.Artifact;
28
29
import freemarker.template.TemplateModel;
30
import freemarker.template.TemplateModelIterator;
31
32
33
public interface IConfiguration {
34
35
/**
36
* Obtain the filename used to store the module meta data.
37
*
38
* @return String instance containing the meta data filename.
39
*/
40
public abstract String getMetadataFilename();
41
42
/**
43
* These methods allow for the grouping of targets
44
* into separate targets called 'phases'
45
*/
46
47
/**
48
* Query the number of phases defined for this configuration.
49
*
50
* @return the number of phases
51
*/
52
public abstract int numberOfPhases();
53
54
/**
55
* Converts the phase number into a text string. Phases a numbered from 0.
56
*
57
* @param phase
58
* @return a string representing the phase numbered phase.
59
*/
60
public abstract String phaseName(int phase);
61
62
/**
63
* Converts a text string into the phase number. Phases are numbered from 0.
64
*
65
* @param phase
66
* @return an integer representing the phase number.
67
* @throws UMABadPhaseNameException - when the string phase does not
68
* map to a valid phase name.
69
*/
70
public abstract int phaseFromString( String phase ) throws UMABadPhaseNameException;
71
72
/**
73
* Obtain a list of all the phase names. Phase 0 corresponds with
74
* the 0 entry in the list.
75
*
76
* @return A list of all the phase names in proper order.
77
*/
78
public abstract String[] phases();
79
80
/**
81
* Obtain the name of the configuration.
82
*
83
* @return String instance containing the configuration name
84
*/
85
public abstract String getConfigurationName();
86
87
/**
88
* Determine if a flag name is valid.
89
*
90
* @param flag
91
* @return true - when the flag name is valid, false otherwise.
92
*/
93
public abstract boolean isFlagValid(String flag);
94
95
/**
96
* Determine if a flag is enabled or disabled.
97
*
98
* @param flag
99
* @return true - when the flag is enabled or set, and false otherwise.
100
* @note will return false if the false is not valid.
101
*/
102
public abstract boolean isFlagSet(String flag);
103
104
/**
105
* Obtain a set of all known flags.
106
*
107
* @return a set of all known flag names.
108
*/
109
public abstract Set<String> getAllFlags();
110
111
/**
112
* Obtain a set of all excluded artifacts.
113
*
114
* @return a set of all excluded artifact names.
115
*/
116
public abstract List<String> getExcludedArtifacts();
117
118
/**
119
* Substitute one string for another.
120
*
121
* @param macro
122
* @return null if the macro is not known or a string that maps to the macro string.
123
*/
124
public abstract String replaceMacro(String macro);
125
126
/**
127
* Define the string that would be returned when replaceMacro() is called.
128
* @param macro
129
* @param substitution
130
*/
131
public void defineMacro(String macro, String substitution);
132
133
/**
134
* Obtain the platform.
135
*
136
* @return a reference to the platform used for this configuration.
137
* @throws UMAException
138
*/
139
public abstract IPlatform getPlatform() throws UMAException;
140
141
/**
142
* Obtain a string containing a copyright notice to be included in
143
* all makefiles.
144
* @return a string containing a copyright notice format for use in makefiles.
145
* @throws UMAException
146
*/
147
public String getMakefileCopyrightNotice() throws UMAException;
148
149
/**
150
* Allows the configuration implementation to extend the UMA data model
151
* supplied to the Freemarker engine.
152
*
153
* @param prefixTag a string representing the tree segments parsed so far
154
* @param extensionTag a string representing the next tag in the tree
155
* @return a TemplateModel that implements the extensionTag
156
* @throws UMAException
157
*/
158
public abstract TemplateModel getDataModelExtension(String prefixTag, String extensionTag) throws UMAException;
159
160
/**
161
* Allows the configuration to list all properties available under the
162
* uma.spec.properties tag.
163
*
164
* @return a Freemarker iterator of all the properties available.
165
* @throws UMAException
166
*/
167
public abstract TemplateModelIterator getPropertiesIterator() throws UMAException;
168
169
/**
170
* Obtain additional includes for an artifact.
171
*
172
* @return a string to append to the UMA_INCLUDES line
173
* @throws UMAException
174
*/
175
public abstract String getAdditionalIncludesForArtifact(Artifact artifact) throws UMAException;
176
177
}
178
179