public class StringSubstitutionEngine extends Object implements StringSubstitutor
| Constructor and Description |
|---|
StringSubstitutionEngine(InputStream inputStream)
Constructs
StringSubstitutionEngine based on the given string-subs
configuration stream. |
| Modifier and Type | Method and Description |
|---|---|
List<Property> |
getDefaultProperties(PropertyType type)
Get's the default
Property for the given PropertyType, If
the property type is null then all the default properties will be returned. |
StringsubsDefinition |
getStringSubsDefinition()
Get's the string-subs definition object.
|
void |
setAttributePreprocessor(AttributePreprocessor attributePreprocessor)
Set's the
AttributePreprocessor to customize the substitution
process. |
void |
setEntryFactory(SubstitutableFactory factory)
Set's a factory which can process a
FileEntry or an Archive entry
to retrieve all the Substitutable entries. |
void |
setFileBackupLocation(File backupLocation)
TODO: Missing Implementation
|
void |
setLookUpMap(Map<String,String> lookUpMap)
Set's the map contains the value for substitutable strings.
|
void |
substituteAll()
Perform's string substitution.
|
void |
substituteComponents(List<String> components)
Perform's string substitution for give components.
|
void |
substituteGroups(List<String> groups)
Perform's string substitution for give groups.
|
public StringSubstitutionEngine(InputStream inputStream) throws StringSubstitutionException
StringSubstitutionEngine based on the given string-subs
configuration stream. Engine parse and validate the configuration and build
the internal representation to perform string substitution.inputStream - The string-subs configuration stream.StringSubstitutionException - If any error occurs in engine initialization.public void setLookUpMap(Map<String,String> lookUpMap)
StringSubstitutorsetLookUpMap in interface StringSubstitutorlookUpMap - Map contains the value for the substitutable strings.public void setAttributePreprocessor(AttributePreprocessor attributePreprocessor)
StringSubstitutorAttributePreprocessor to customize the substitution
process. Attribute preprocessor takes care to retrieve the value of
substitutable key.setAttributePreprocessor in interface StringSubstitutorattributePreprocessor - Custom implementation of AttributePreprocessorpublic void setEntryFactory(SubstitutableFactory factory)
StringSubstitutorFileEntry or an Archive entry
to retrieve all the Substitutable entries.setEntryFactory in interface StringSubstitutorpublic void setFileBackupLocation(File backupLocation)
StringSubstitutorsetFileBackupLocation in interface StringSubstitutorpublic List<Property> getDefaultProperties(PropertyType type)
StringSubstitutorProperty for the given PropertyType, If
the property type is null then all the default properties will be returned.getDefaultProperties in interface StringSubstitutortype - The type for which default properties has to be retrieved.public void substituteAll()
throws StringSubstitutionException
StringSubstitutorsubstituteAll in interface StringSubstitutorStringSubstitutionException - If any error occurs in string substitution.public void substituteComponents(List<String> components) throws StringSubstitutionException
StringSubstitutorsubstituteComponents in interface StringSubstitutorStringSubstitutionException - If any error occurs during
substitution.public void substituteGroups(List<String> groups) throws StringSubstitutionException
StringSubstitutorsubstituteGroups in interface StringSubstitutorgroups - List of Group identifiers for which the string
substitution has to be performed.StringSubstitutionException - If any error occurs during
substitution.public StringsubsDefinition getStringSubsDefinition()
StringSubstitutorStringSubsDefiniton object
contains the details of component, groups and files used in substitution.
NOTE: This object is updatable.
getStringSubsDefinition in interface StringSubstitutorCopyright © 2013. All Rights Reserved.