Class Settings
Settings are typed variables identified with their case-sensitive name.
When you set the value of a setting, the value object you supply must be
of the correct type. See the description of the TYPE_...
to see the available setting types.
Methods that change setting values have a variation
that require String
value(s) instead of Object
(s).
These methods should be used when you get the setting values from text-only
sources, such as command-line option values, XML attributes or
.properties file. To demonstrate the difference, assume you have
string value "a, b, c"
. If you try to use this value for a
setting of type list, the normal setter method will interpret the value
as a list of length 1, that stores string "a, b, c"
. If you
try to use the same value with the string version of the same method, it
will interpret the string as a list of length 3, that stores 3 strings,
"a"
, "b"
, and "c"
.
Notes:
- All settings you want to set/get must be defined. See
define(java.lang.String, fmpp.setting.Settings.SettingType, boolean, boolean)
. Standard settings (the settings documented in the FMPP Manual) are initially already defined. - If you have used an object as the value of a setting, the object must not be changed anymore.
- If a method throws
SettingException
, then it is ensured that the method doesn't change theSettings
object. For example, withadd(Map)
, either all settings in the map will be successfully set, or neither will be set.
You can execute the processing session described by the setting with
execute()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Represents the type of the value of a setting. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Primary default file name.static final String
Secondary (legacy) default file name.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final Settings.SettingType
Any object.static final Settings.SettingType
Boolean setting type.static final Settings.SettingType
"Configuration relative path" setting type.static final Settings.SettingType
"Configuration relative paths" setting type.static final Settings.SettingType
Data model setting type.static final Settings.SettingType
Hash setting type.static final Settings.SettingType
Hash-of-configuration-relative-paths setting type.static final Settings.SettingType
Integer setting type.static final Settings.SettingType
Local data model setting type.static final Settings.SettingType
Sequence setting type.static final Settings.SettingType
String setting type.static final Settings.SettingType
"Unresolved configuration relative paths" setting type.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a setting value.void
Adds all name-value pairs stored in the map withadd(String, Object)
.void
addDefault
(String name, Object value) Adds a setting value with low priority.void
addDefaults
(Map settingMap) Adds all entries stored in the map withaddDefault(String, Object)
.void
addDefaultsWithStrings
(Properties props) Same asaddDefaults(Map)
, but uses aProperties
object, so the values are strings.void
addDefaultWithString
(String name, String value) Same asaddDefault(String, Object)
, but uses string value.void
Adds a progress listener.void
addWithString
(String name, String value) Same asadd(String, Object)
, but uses string value that will be interpreted bySettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
.void
addWithStrings
(Properties props) Same asadd(Map)
, but uses aProperties
object, so the values are strings.void
Removes all engine attributes.void
Removes all progress listeneres.void
define
(String name, Settings.SettingType type, boolean merge, boolean forceStr) Defines a new setting.protected void
doProcessing
(Engine eng, File[] sources, File sourceFile, File outputFile) Executes the processing session(s) on theEngine
level, using the already initializedEngine
object.dump()
Dumps the current content of this object for debugging purposes.void
execute()
Executes a processing session based on the setting values.static void
Backward compatibility hack: renames properties that use pre-FMPP 0.9.0 names of settings.Gets the current value of a setting.static String
getDashedName
(String name) Converts mixed-case setting name to dashed form, like sourceRoot to source-root.static File
Returns the default configuration file in the directory.boolean
getEngineAttribute
(String name) Reads an engine attribute.getNames()
Lists the names of settings that were set.static Iterator
Returns names of the standard (not user-defined) settings.boolean
Returns if a setting with the given name is defined (do not mix it up with being set).void
Loads settings from a configuration file.void
loadDefaults
(File cfgFile) Same asload
, except that it adds the settings withaddDefaults(Map)
.static int
quietSettingValueToInt
(String value, String name) Returns 0 for verbose mode, 1 for quiet mode, 2 for really-quiet mode.Removes a setting value; after thisget(String)
will returnnull
.removeAttribute
(String name) Removes an engine attribute.void
Convenience method for setting aBoolean
value.void
Convenience method for setting anInteger
value.void
Sets the value of a setting.void
Callsset(String, Object)
for each name-value pair of theMap
.void
setDefault
(String name, boolean value) Convenience method for setting aBoolean
value; seesetDefault(String, Object)
.void
setDefault
(String name, int value) Convenience method for setting anInteger
value; seesetDefault(String, Object)
.void
setDefault
(String name, Object value) Sets the value of a setting if the value wasn't set yet.void
setDefaults
(Map settingValues) void
setDefaultsWithStrings
(Properties props) Similar tosetWithStrings(Properties)
, but callssetDefaultWithString(String, String)
instead ofsetWithString(String, String)
.void
setDefaultWithString
(String name, String value) Same assetDefault(String, Object)
, but uses a string value that will be parsed withSettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
.void
setDontTraverseDirectories
(boolean dontTraverseDirs) setEngineAttribute
(String name, Object value) Sets an engine attribute.void
setWithString
(String name, String value) Same asset(String, Object)
, but uses string value that will be parsed withSettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
.void
setWithStrings
(Properties props) CallssetWithString(String, String)
for each name-value pair of theProperties
.void
trimValues
(Properties props) Trims all property values.void
undashNames
(Properties props) Converts legacy dashed setting names to the standard format, assource-root
tosourceRoot
.
-
Field Details
-
NAME_SKIP_UNCHANGED
- See Also:
-
NAME_TURNS
- See Also:
-
NAME_SOURCES
- See Also:
-
NAME_SOURCE_ROOT
- See Also:
-
NAME_OUTPUT_ROOT
- See Also:
-
NAME_OUTPUT_FILE
- See Also:
-
NAME_DATA_ROOT
- See Also:
-
NAME_OBJECT_WRAPPER
- See Also:
-
NAME_RECOMMENDED_DEFAULTS
- See Also:
-
NAME_FREEMARKER_INCOMPATIBLE_IMPROVEMENTS
- See Also:
-
NAME_FREEMARKER_LINKS
- See Also:
-
NAME_INHERIT_CONFIGURATION
- See Also:
-
NAME_MODES
- See Also:
-
NAME_BORDERS
- See Also:
-
NAME_DATA
- See Also:
-
NAME_LOCAL_DATA
- See Also:
-
NAME_TEMPLATE_DATA
- See Also:
-
NAME_SOURCE_ENCODING
- See Also:
-
NAME_OUTPUT_ENCODING
- See Also:
-
NAME_URL_ESCAPING_CHARSET
- See Also:
-
NAME_LOCALE
- See Also:
-
NAME_NUMBER_FORMAT
- See Also:
-
NAME_BOOLEAN_FORMAT
- See Also:
-
NAME_DATE_FORMAT
- See Also:
-
NAME_TIME_FORMAT
- See Also:
-
NAME_DATETIME_FORMAT
- See Also:
-
NAME_TIME_ZONE
- See Also:
-
NAME_SQL_DATE_AND_TIME_TIME_ZONE
- See Also:
-
NAME_TAG_SYNTAX
- See Also:
-
NAME_INTERPOLATION_SYNTAX
- See Also:
-
NAME_OUTPUT_FORMAT
- See Also:
-
NAME_OUTPUT_FORMATS_BY_PATH
- See Also:
-
NAME_MAP_COMMON_EXTENSIONS_TO_OUTPUT_FORMATS
- See Also:
-
NAME_CASE_SENSITIVE
- See Also:
-
NAME_STOP_ON_ERROR
- See Also:
-
NAME_REMOVE_EXTENSIONS
- See Also:
-
OLD_NAME_REMOVE_EXTENSION
- See Also:
-
NAME_REMOVE_POSTFIXES
- See Also:
-
OLD_NAME_REMOVE_POSTFIX
- See Also:
-
NAME_REPLACE_EXTENSIONS
- See Also:
-
OLD_NAME_REPLACE_EXTENSION
- See Also:
-
NAME_REMOVE_FREEMARKER_EXTENSIONS
- See Also:
-
NAME_ALWAYS_CREATE_DIRECTORIES
- See Also:
-
NAME_IGNORE_CVS_FILES
- See Also:
-
NAME_IGNORE_SVN_FILES
- See Also:
-
NAME_IGNORE_TEMPORARY_FILES
- See Also:
-
NAME_EXPERT
- See Also:
-
NAME_LOG_FILE
- See Also:
-
NAME_APPEND_LOG_FILE
- See Also:
-
NAME_CONFIGURATION_BASE
- See Also:
-
NAME_ECHO_FORMAT
- See Also:
-
NAME_QUIET
- See Also:
-
NAME_COLUMNS
- See Also:
-
NAME_SNIP
- See Also:
-
NAME_PRINT_STACK_TRACE
- See Also:
-
NAME_XPATH_ENGINE
- See Also:
-
NAME_XML_CATALOG_FILES
- See Also:
-
NAME_XML_CATALOG_PREFER
- See Also:
-
NAME_VALIDATE_XML
- See Also:
-
NAME_XML_RENDERINGS
- See Also:
-
VALUE_SOURCE
- See Also:
-
VALUE_HOST
- See Also:
-
VALUE_OUTPUT
- See Also:
-
VALUE_OBJECTWRAPPER_SHARED_BEANS_WRAPPER
- See Also:
-
VALUE_TAG_SYNTAX_ANGLE_BRACKET
- See Also:
-
VALUE_TAG_SYNTAX_SQUARE_BRACKET
- See Also:
-
VALUE_TAG_SYNTAX_AUTO_DETECT
- See Also:
-
VALUE_INTERPOLATION_SYNTAX_LEGACY
- See Also:
-
VALUE_INTERPOLATION_SYNTAX_DOLLAR
- See Also:
-
VALUE_INTERPOLATION_SYNTAX_SQUARE_BRACKET
- See Also:
-
VALUE_NONE
- See Also:
-
VALUE_REALLY_QUIET
- See Also:
-
VALUE_XML_CATALOG_PREFER_PUBLIC
- See Also:
-
VALUE_XML_CATALOG_PREFER_SYSTEM
- See Also:
-
VALUE_GLOBAL_DEFAULT
- See Also:
-
DEFAULT_CFG_FILE_NAME
Primary default file name.- See Also:
-
DEFAULT_CFG_FILE_NAME_OLD
Secondary (legacy) default file name.- See Also:
-
TYPE_ANY
Any object.Input type:
Object
. Known bug:null
value is allowed (incorrectly), but in effect removes (un-sets) the value.Output type:
Object
.String input: any value, stored as is.
Merging: not supported.
-
TYPE_STRING
String setting type.Input type:
String
,Number
,Boolean
. The last two is converted to string withtoString()
Output type:
String
.String input: any value, stored as is.
Merging: not supported
-
TYPE_INTEGER
Integer setting type.Input type:
Number
that can be converted toInteger
without loss.Output type:
Integer
.String input: any value, that can be parsed to
Integer
byInteger.parseInt
after trimming. In additional, redundant+
sign is supported.Merging: not supported
-
TYPE_BOOLEAN
Boolean setting type.Input type:
Boolean
.Output type:
Boolean
.String input: After trimming and converting to lower-case,
"true"
,"false"
or empty string are allowed. Empty string is interpreted astrue
(consider a properties file that contains a key without value).Merging: not supported
-
TYPE_SEQUENCE
Sequence setting type.Input type:
List
, any array,Vector
. No restriction regarding the type of the list items.Output type:
List
. No restriction regarding the type of the list items.String input: TDD expression starting in list mode. If the result is a list that contains a single list, then the contained list will be used. This heuristic is used to fix this user mistake:
--some-list="[a, b, c]"
instead of:
--some-list="a, b, c"Merging: the two lists are concatenated, with the default (inherited) value coming last.
-
TYPE_LOCAL_DATA_MODEL
Local data model setting type. This is the same asTYPE_SEQUENCE
, just if the value is given as text (string input), it defers the evaluation of the hash parameter of the case function call, and stores that asFragment
. This is required because that hash parameter may uses data loaders, which shouldn't be executed until almost all settings of theEngine
are set. This also means that if you set the setting value with Java, the last parameter to the caseFunctionCall
must be aFragment
instead ofMap
, if you want to use data loaders in it. -
TYPE_HASH
Hash setting type.Input type:
Map
,Dictionary
.Output type:
Map
.String input: TDD expression, starting in hash mode.
Merging: the two maps are added (union)
-
TYPE_CFG_RELATIVE_PATH
"Configuration relative path" setting type.Input type:
String
,FileWithSettingValue
. PlainFile
is not allowed.Output type:
FileWithSettingValue
.String input: Any value, trimmed before converting.
Merging: not supported
-
TYPE_CFG_RELATIVE_PATHS
"Configuration relative paths" setting type.Input type: Same as for
TYPE_SEQUENCE
, but all list items must be string orFileWithSettingValue
.Output type: Same as for
TYPE_SEQUENCE
, but all list items areFileWithSettingValue
-s.String input: Same as for
TYPE_SEQUENCE
, but all sequence items must be strings. "force strings" option is on during the TDD interpretation.Merging: the two list are concatenated.
-
TYPE_UNRESOLVED_CFG_RELATIVE_PATHS
"Unresolved configuration relative paths" setting type.Input type: Same as for
TYPE_SEQUENCE
, but all list items must be strings orFileWithConfigurationBase
-s.Output type: Same as for
TYPE_SEQUENCE
, but all list items areFileWithConfigurationBase
-s.String input: Same as for
TYPE_SEQUENCE
, but all sequence items must be strings. "force strings" option is on during the TDD interpretation.Merging: the two list are concatenated.
-
TYPE_DATA_MODEL
Data model setting type.Input type:
Map
,Dictionary
,Fragment
, private classDataList
.Output type: private class
DataList
extendsArrayList
. The list may contains:Map
,String
,Fragment
.String input: TDD expression, starting in hash mode.
Merging: The tow lists are concatenated.
This type is used for the "data" setting. The hash value of that setting can't be generated until the final value of all other setting is set (because data loaders may use the other settings). This way, the value of the "data" setting is a
List
that records the changes made on the setting, and not aMap
. TheMap
will be built internally based on the list when you callexecute()
. -
TYPE_HASH_OF_SEQUENCE_OF_CFG_RELATIVE_PATHS
Hash-of-configuration-relative-paths setting type.Input type:
Map
orDictionary
, that stores aList
orVector
or array, that stores strings and/orFileWithSettingValue
-s. Also, the map may contains strings and/orFileWithSettingValue
directly as value (instead of a list of length 1 that stores the same value).Output type:
Map
ofList
ofFileWithSettingValue
-s.String input: TDD expression, starting in hash mode.
Merging: the two maps are added (union)
-
-
Constructor Details
-
Settings
Creates a new instance. The standard settings will be already defined in the new instance.- Parameters:
baseDir
- the base directory used to resolve relative paths in setting names. When you load settings from a configuration file, the parent directory of the file will be used instenad, for the settings coming from the file.- Throws:
SettingException
-
-
Method Details
-
define
public void define(String name, Settings.SettingType type, boolean merge, boolean forceStr) throws SettingException Defines a new setting. No setting with the same name can already exists.- Parameters:
name
- the name of the settingtype
- the type of the settingmerge
- specifies if when you add a new setting value, and the setting has already set, then the new and old value will be merged, or the new value will replace old value. Note that only a few setting types support merging, such as list and map.forceStr
- specifies if when parsing string values with TDD interpreter, it should be done with the "force strings" option or not.- Throws:
SettingException
-
isDefined
Returns if a setting with the given name is defined (do not mix it up with being set). -
getStandardSettingNames
Returns names of the standard (not user-defined) settings. -
add
Adds a setting value. Adding means that if a setting value already exists, it will be either replaced or merged with the new value, depending on the definition of the setting. When merging, the new value has higher priority than the old value. (With lists, higher priority means being earlier in the list.)- Throws:
SettingException
- See Also:
-
addDefault
Adds a setting value with low priority. Adding means that if a setting value already exists, it will be either kept (and thus the method call has no effect) or merged with the new value, depending on the definition of the setting. When merging, the new value has lower priority than the old value. (With lists, lower priority means being later in the list.)- Throws:
SettingException
- See Also:
-
addWithString
Same asadd(String, Object)
, but uses string value that will be interpreted bySettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
. Used when the value comes from a strings-only source.- Throws:
SettingException
-
addDefaultWithString
Same asaddDefault(String, Object)
, but uses string value.- Throws:
SettingException
-
add
Adds all name-value pairs stored in the map withadd(String, Object)
. Thus, all keys must beString
-s.- Throws:
SettingException
-
addDefaults
Adds all entries stored in the map withaddDefault(String, Object)
. Thus, all keys must beString
-s.- Throws:
SettingException
-
addWithStrings
Same asadd(Map)
, but uses aProperties
object, so the values are strings.- Throws:
SettingException
-
addDefaultsWithStrings
Same asaddDefaults(Map)
, but uses aProperties
object, so the values are strings.- Throws:
SettingException
-
set
Sets the value of a setting. If the setting value already exists, it will be replaced (never merged).- Parameters:
name
- The name of the setting. It's validated if a setting with this name is defined, otherwise it throwsSettingException
value
- Notnull
; useremove(String)
to un-set a value. (Known bug: if the type is#TYPE_ANY
,null
will not cause error, and in effect un-set the value.)- Throws:
SettingException
- If the setting name or value is not valid.
-
set
Convenience method for setting aBoolean
value.- Throws:
SettingException
-
set
Convenience method for setting anInteger
value.- Throws:
SettingException
-
setDefault
Sets the value of a setting if the value wasn't set yet. (The name is misleading, as if the setting value is removed later, it will not get the default value.) Seeset(String, Object)
for the parameters and thrown exception.- Throws:
SettingException
-
setDefault
Convenience method for setting aBoolean
value; seesetDefault(String, Object)
.- Throws:
SettingException
-
setDefault
Convenience method for setting anInteger
value; seesetDefault(String, Object)
.- Throws:
SettingException
-
setWithString
Same asset(String, Object)
, but uses string value that will be parsed withSettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
. Used when the value comes from a strings-only source.- Throws:
SettingException
-
setDefaultWithString
Same assetDefault(String, Object)
, but uses a string value that will be parsed withSettings.SettingType.parse(fmpp.setting.Settings, java.lang.String, boolean)
.- Throws:
SettingException
-
set
Callsset(String, Object)
for each name-value pair of theMap
. The change is atomic; if aSettingException
occurs, no setting values are changed.- Parameters:
settingValues
- Maps setting names (String
-s) to setting values (non-null
Object
-s).- Throws:
SettingException
-
setDefaults
- Throws:
SettingException
-
setWithStrings
CallssetWithString(String, String)
for each name-value pair of theProperties
. The change is atomic; if aSettingException
occurs, no setting values are changed.- Throws:
SettingException
-
setDefaultsWithStrings
Similar tosetWithStrings(Properties)
, but callssetDefaultWithString(String, String)
instead ofsetWithString(String, String)
.- Throws:
SettingException
-
load
Loads settings from a configuration file. The file will be interpreted as legacy properties file if its extension is cfg or properties, otherwise it will be interpreted as TDD file. The settings stored in the configuration file will be added to the this object withadd(Map)
.Note that meta-settings ("configurationBase" and "inheritConfiguration") will not be added to the settings object.
If the setting "configurationBase" or "inheritConfiguration" is set in this setting object, then they will override the meta-settings in the file directly loaded with this method. Files inherited by the directly loaded file, however, are not affected.
- Parameters:
cfgFile
- the configuration file, or the directory of the configuration file if its file name is one of the default configuration file names.- Throws:
SettingException
- See Also:
-
loadDefaults
Same asload
, except that it adds the settings withaddDefaults(Map)
.- Throws:
SettingException
- See Also:
-
get
Gets the current value of a setting.- Parameters:
name
- The name of the setting. The name won't be validated.- Returns:
- The value of the setting.
null
if the setting is not set.
-
remove
Removes a setting value; after thisget(String)
will returnnull
.- Returns:
- the removed value, or
null
if there was no value stored for the setting. - See Also:
-
getNames
Lists the names of settings that were set. -
execute
Executes a processing session based on the setting values. For each call of this method, a newEngine
object will be internally created, and initialized based on the setting values, and then itsprocess
method will be called. The method automatically chooses between bulk and single-file processing, based on the presence of the "outputFile" setting.Settings will go through semantical checks that are not done when you call other methods. For example, it will be checked if setting "modes" contains valid mode setter function calls, if "sourceRoot" and "outputRoot" are defined for bulk mode, if exactly 1 "sources" is defined for single-file mode, etc.
This method ignores the following settings: "logFile", "appendLogFile", "echoFormat", "quiet", "snip". It's the task of the embedding software (the front-end) to interpret these settings, at least the ones it is interested in. It usually involves adding progress listeners with
addProgressListener(ProgressListener)
.This method can be called for multiple times, but be aware of that for each call of this method, a new
Engine
object will be created and initialized, even if you didn't changed the settings since the last call. If this overhead is not acceptable in you case, you can callEngine.process(...)
for multiple times within the sameexecute()
call, by overriding thedoProcessing(Engine, File[], File, File)
method. Also, you can do extra engine initalization there.- Throws:
SettingException
- if the settings are not correct, or can't be applied because of some errors occured. This exception, when thrown, is always thrown before the execution of the processing session is stated.ProcessingException
- ifEngine.process
has thrown any exception, that is, there was an error during the execution of the processing session. The message of this exception holds nothing interesting (just a static text). Call itsgetCause()
method to get the exception that caused the termination. Note that all (so even non-checked exceptions) thrown be the engine are catched and wrapped by this exeption.
-
addProgressListener
Adds a progress listener. The progress listener will be added to the internally usedEngine
object when you callexecute()
.- See Also:
-
clearProgressListeners
public void clearProgressListeners()Removes all progress listeneres.- See Also:
-
setEngineAttribute
Sets an engine attribute. The attribute will be set in the internally usedEngine
object when you callexecute()
.- Returns:
- The previous value of the attribute, or
null
if there was no attribute with the given name.
-
getEngineAttribute
Reads an engine attribute.- Returns:
null
if no attribute exists with the given name.- See Also:
-
removeAttribute
Removes an engine attribute. It does nothing if the attribute does not exist.- Returns:
- The value of the removed attribute or
null
if there was no attribute with the given name. - See Also:
-
clearAttribues
public void clearAttribues()Removes all engine attributes.- See Also:
-
setDontTraverseDirectories
public void setDontTraverseDirectories(boolean dontTraverseDirs) -
getDontTraverseDirectories
public boolean getDontTraverseDirectories() -
dump
Dumps the current content of this object for debugging purposes. -
quietSettingValueToInt
Returns 0 for verbose mode, 1 for quiet mode, 2 for really-quiet mode.- Throws:
SettingException
-
getDefaultConfigurationFile
Returns the default configuration file in the directory.- Returns:
- the absolute file, or
null
if no default configuration file exists in the directory.
-
undashNames
Converts legacy dashed setting names to the standard format, assource-root
tosourceRoot
.- Parameters:
props
- theProperties
object to convert.- Throws:
SettingException
- if no setting with the given name exists.
-
trimValues
Trims all property values. -
doProcessing
protected void doProcessing(Engine eng, File[] sources, File sourceFile, File outputFile) throws SettingException, ProcessingException Executes the processing session(s) on theEngine
level, using the already initializedEngine
object.By overriding this method, you can
- call
Engine.process(...)
for multiple times, so you can do multiple processing sessions with the same already initializedEngine
object. - do extra
Engine
initialization.
The inital implementation of this method (that is, the implementation in the
Settings
class) is something like this:if (outputFile == null) { eng.process(sources); } else { eng.process(sourceFile, outputFile); }
Modifying the
Settings
object in this method has no effect on theEngine
object (which is passed in as argument), since all settings are already applied on it. If you need to modify theEngine
object, call its methods directly.An implementation of this method may leak out the initialized
Engine
object for the caller ofexecute()
. Also, it may does not callEngine.proccess(...)
, but left it for the caller (who has the out-leakedEngine
object). These are extreme, but otherwise legitimate usages.- Parameters:
eng
- the already initializedEngine
object. You may do extra addjustments on it.sources
- the list of source files, the parameter toEngine.process(File[])
. It'snull
if the processing session usesoutputFile
setting.sourceFile
- if the session usesoutputFile
setting, then it' the 1st parameter toEngine.process(File, File)
, otherwise it is null.outputFile
- if the session usesoutputFile
setting, then it' the 2nd parameter toEngine.process(File, File)
, otherwise it is null.- Throws:
SettingException
ProcessingException
- call
-
getDashedName
Converts mixed-case setting name to dashed form, like sourceRoot to source-root. -
fixVersion08SettingNames
Backward compatibility hack: renames properties that use pre-FMPP 0.9.0 names of settings.- Throws:
SettingException
-