Class StringSubstitutionEngine
- java.lang.Object
-
- com.sun.enterprise.admin.servermgmt.stringsubs.impl.StringSubstitutionEngine
-
- All Implemented Interfaces:
StringSubstitutor
public class StringSubstitutionEngine extends Object implements StringSubstitutor
A class to encapsulate string-subs definition. Parse, validate and performs String substitution for the given string-subs.xml.
-
-
Constructor Summary
Constructors Constructor Description StringSubstitutionEngine(InputStream inputStream)ConstructsStringSubstitutionEnginebased on the given string-subs configuration stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property>getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.PropertyType type)Gets the defaultPropertyfor the givenPropertyType, If the property type is null then all the default properties will be returned.com.sun.enterprise.admin.servermgmt.xml.stringsubs.StringsubsDefinitiongetStringSubsDefinition()Gets the string-subs definition object.voidsetAttributePreprocessor(AttributePreprocessor attributePreprocessor)Set's theAttributePreprocessorto customize the substitution process.voidsetEntryFactory(SubstitutableFactory factory)Set's a factory which can process aFileEntryor anArchiveentry to retrieve all theSubstitutableentries.voidsetFileBackupLocation(File backupLocation)TODO: Missing ImplementationvoidsubstituteAll()Performs string substitution.voidsubstituteComponents(List<String> components)Performs string substitution for give components.voidsubstituteGroups(List<String> groups)Performs string substitution for give groups.
-
-
-
Constructor Detail
-
StringSubstitutionEngine
public StringSubstitutionEngine(InputStream inputStream) throws StringSubstitutionException
ConstructsStringSubstitutionEnginebased on the given string-subs configuration stream. Engine parse and validate the configuration and build the internal representation to perform string substitution.- Parameters:
inputStream- The string-subs configuration stream.- Throws:
StringSubstitutionException- If any error occurs in engine initialization.
-
-
Method Detail
-
setAttributePreprocessor
public void setAttributePreprocessor(AttributePreprocessor attributePreprocessor)
Description copied from interface:StringSubstitutorSet's theAttributePreprocessorto customize the substitution process. Attribute preprocessor takes care to retrieve the value of substitutable key.- Specified by:
setAttributePreprocessorin interfaceStringSubstitutor- Parameters:
attributePreprocessor- Custom implementation ofAttributePreprocessor
-
setEntryFactory
public void setEntryFactory(SubstitutableFactory factory)
Description copied from interface:StringSubstitutorSet's a factory which can process aFileEntryor anArchiveentry to retrieve all theSubstitutableentries.- Specified by:
setEntryFactoryin interfaceStringSubstitutor
-
setFileBackupLocation
public void setFileBackupLocation(File backupLocation)
Description copied from interface:StringSubstitutorTODO: Missing Implementation- Specified by:
setFileBackupLocationin interfaceStringSubstitutor
-
getDefaultProperties
public List<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property> getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.PropertyType type)
Description copied from interface:StringSubstitutorGets the defaultPropertyfor the givenPropertyType, If the property type is null then all the default properties will be returned.- Specified by:
getDefaultPropertiesin interfaceStringSubstitutor- Parameters:
type- The type for which default properties has to be retrieved.- Returns:
- List of default properties or empty list if no property found.
-
substituteAll
public void substituteAll() throws StringSubstitutionExceptionDescription copied from interface:StringSubstitutorPerforms string substitution.- Specified by:
substituteAllin interfaceStringSubstitutor- Throws:
StringSubstitutionException- If any error occurs in string substitution.
-
substituteComponents
public void substituteComponents(List<String> components) throws StringSubstitutionException
Description copied from interface:StringSubstitutorPerforms string substitution for give components.- Specified by:
substituteComponentsin interfaceStringSubstitutor- Parameters:
components- List ofComponentidentifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException- If any error occurs during substitution.
-
substituteGroups
public void substituteGroups(List<String> groups) throws StringSubstitutionException
Description copied from interface:StringSubstitutorPerforms string substitution for give groups.- Specified by:
substituteGroupsin interfaceStringSubstitutor- Parameters:
groups- List ofGroupidentifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException- If any error occurs during substitution.
-
getStringSubsDefinition
public com.sun.enterprise.admin.servermgmt.xml.stringsubs.StringsubsDefinition getStringSubsDefinition()
Description copied from interface:StringSubstitutorGets the string-subs definition object. AStringSubsDefinitonobject contains the details of component, groups and files used in substitution.NOTE: This object is updateable.
- Specified by:
getStringSubsDefinitionin interfaceStringSubstitutor- Returns:
- Parsed string-subs configuration object.
-
-