| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
configuration |
protected Collection<org.apache.royale.compiler.problems.ICompilerProblem> |
configurationProblems |
| Constructor and Description |
|---|
Configurator()
Constructor
|
Configurator(Class<? extends Configuration> configurationClass)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Configurator |
clone() |
protected Configuration |
createConfiguration()
Create a new configuration instance.
|
protected ConfigurationBuffer |
createConfigurationBuffer(Class<? extends Configuration> configurationClass)
Create a configuration buffer.
|
Configuration |
getConfiguration() |
ConfigurationBuffer |
getConfigurationBuffer() |
Collection<org.apache.royale.compiler.problems.ICompilerProblem> |
getConfigurationProblems() |
List<String> |
getLoadedConfigurationFiles() |
List<String> |
getMissingConfigurationFiles() |
protected String[] |
getOptions(Map<String,Object> args,
Map<String,Object> more,
String[] extras) |
protected void |
initializeConfiguration()
Initialize the configuration and the configuration buffer.
|
protected boolean |
loadConfig()
Load configuration XML file specified in
-load-config option on
command-line. |
protected boolean |
loadConfigFromFile(ConfigurationBuffer buffer,
File fileSpec,
String context,
String rootElement,
boolean ignoreUnknownItems)
Load a configuration from file.
|
protected boolean |
loadLocalConfig()
Load project specific configuration.
|
protected void |
overrideDefaults()
Override default values.
|
protected boolean |
processConfiguration()
Wrapper around the real processConfiguration.
|
protected boolean |
processConfiguration(String[] argsArray)
Does all the work to set the command line arguments info the
configuration object.
|
protected String[] |
processExtras(String[] extraOptions) |
protected void |
reportConfigurationException(org.apache.royale.compiler.exceptions.ConfigurationException e)
Convert conifguration exceptions to problems and collect them for
reporting.
|
void |
setConfiguration(String[] args,
String defaultVariable)
Sets the configuration parameters.
|
void |
setConfigurationPathResolver(org.apache.royale.compiler.common.IPathResolver pathResolver) |
void |
setToken(String name,
String value)
Defines a token.
|
static List<File> |
toFileList(List<String> paths)
Convert file path strings to
File objects. |
static List<File> |
toFiles(List<String> paths)
Convert file path strings to
File objects. |
static String[] |
toPaths(File[] files)
Convert
File objects to String, where each String is
the absolute file path of the file. |
String |
toString() |
Collection<org.apache.royale.compiler.problems.ICompilerProblem> |
validateConfiguration(String[] args) |
protected Configuration configuration
protected Collection<org.apache.royale.compiler.problems.ICompilerProblem> configurationProblems
public Configurator()
public Configurator(Class<? extends Configuration> configurationClass)
public static List<File> toFiles(List<String> paths)
File objects. Null values are
discarded.paths - List of file pathspublic static List<File> toFileList(List<String> paths)
File objects. Null values are
discarded.paths - List of file pathspublic static String[] toPaths(File[] files)
File objects to String, where each String is
the absolute file path of the file. Null values are discarded.files - file specificationspublic Collection<org.apache.royale.compiler.problems.ICompilerProblem> validateConfiguration(String[] args)
public Collection<org.apache.royale.compiler.problems.ICompilerProblem> getConfigurationProblems()
public void setConfigurationPathResolver(org.apache.royale.compiler.common.IPathResolver pathResolver)
public Configuration getConfiguration()
public ConfigurationBuffer getConfigurationBuffer()
protected Configuration createConfiguration()
protected void initializeConfiguration()
protected ConfigurationBuffer createConfigurationBuffer(Class<? extends Configuration> configurationClass)
configurationClass - The Configuration objectprotected boolean processConfiguration()
protected boolean processConfiguration(String[] argsArray)
argsArray - - command line argumentsprotected void overrideDefaults()
throws org.apache.royale.compiler.exceptions.ConfigurationException
org.apache.royale.compiler.exceptions.ConfigurationExceptionprotected boolean loadConfig()
-load-config option on
command-line.protected boolean loadLocalConfig()
protected final boolean loadConfigFromFile(ConfigurationBuffer buffer, File fileSpec, String context, String rootElement, boolean ignoreUnknownItems)
FileConfigurator.load() is
wrapped in this method because we want to print a message after loading
using MXMLC#println(String).protected void reportConfigurationException(org.apache.royale.compiler.exceptions.ConfigurationException e)
e - protected String[] getOptions(Map<String,Object> args, Map<String,Object> more, String[] extras)
protected String[] processExtras(String[] extraOptions) throws org.apache.royale.compiler.exceptions.ConfigurationException
org.apache.royale.compiler.exceptions.ConfigurationExceptionpublic void setConfiguration(String[] args, String defaultVariable)
mxmlc/compc command-line arguments.args - mxmlc/compc command-line argumentsdefaultVariable - the default variable of the configuration.public void setToken(String name, String value)
mxmlc +royalelib=path1 +foo=bar --var=${foo}
var=bar after the substitution of ${foo}.name - The name of the token.value - The value of the token.public Configurator clone()
Copyright © 2023 The Apache Software Foundation. All rights reserved.