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<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property> |
getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.PropertyType type)
Gets the default
Property for the given PropertyType, If
the property type is null then all the default properties will be returned. |
com.sun.enterprise.admin.servermgmt.xml.stringsubs.StringsubsDefinition |
getStringSubsDefinition()
Gets 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 |
substituteAll()
Performs string substitution.
|
void |
substituteComponents(List<String> components)
Performs string substitution for give components.
|
void |
substituteGroups(List<String> groups)
Performs 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 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<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property> getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.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 StringSubstitutorcomponents - List of Component identifiers for which the string
substitution has to be performed.StringSubstitutionException - 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 com.sun.enterprise.admin.servermgmt.xml.stringsubs.StringsubsDefinition getStringSubsDefinition()
StringSubstitutorStringSubsDefiniton object
contains the details of component, groups and files used in substitution.
NOTE: This object is updateable.
getStringSubsDefinition in interface StringSubstitutorCopyright © 2019. All rights reserved.