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)
StringSubstitutor
AttributePreprocessor
to customize the substitution
process. Attribute preprocessor takes care to retrieve the value of
substitutable key.setAttributePreprocessor
in interface StringSubstitutor
attributePreprocessor
- Custom implementation of AttributePreprocessor
public void setEntryFactory(SubstitutableFactory factory)
StringSubstitutor
FileEntry
or an Archive
entry
to retrieve all the Substitutable
entries.setEntryFactory
in interface StringSubstitutor
public void setFileBackupLocation(File backupLocation)
StringSubstitutor
setFileBackupLocation
in interface StringSubstitutor
public List<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property> getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.PropertyType type)
StringSubstitutor
Property
for the given PropertyType
, If
the property type is null then all the default properties will be returned.getDefaultProperties
in interface StringSubstitutor
type
- The type for which default properties has to be retrieved.public void substituteAll() throws StringSubstitutionException
StringSubstitutor
substituteAll
in interface StringSubstitutor
StringSubstitutionException
- If any error occurs in string substitution.public void substituteComponents(List<String> components) throws StringSubstitutionException
StringSubstitutor
substituteComponents
in interface StringSubstitutor
components
- 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
StringSubstitutor
substituteGroups
in interface StringSubstitutor
groups
- 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()
StringSubstitutor
StringSubsDefiniton
object
contains the details of component, groups and files used in substitution.
NOTE: This object is updateable.
getStringSubsDefinition
in interface StringSubstitutor
Copyright © 2019. All rights reserved.