Class StringSubstitutionEngine
java.lang.Object
com.sun.enterprise.admin.servermgmt.stringsubs.impl.StringSubstitutionEngine
- All Implemented Interfaces:
StringSubstitutor
A class to encapsulate string-subs definition. Parse, validate and performs String substitution for the given
string-subs.xml.
-
Constructor Summary
ConstructorsConstructorDescriptionStringSubstitutionEngine(InputStream inputStream) ConstructsStringSubstitutionEnginebased on the given string-subs configuration stream. -
Method Summary
Modifier and TypeMethodDescriptionGet's the defaultPropertyfor the givenPropertyType, If the property type is null then all the default properties will be returned.Get's 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 ImplementationvoidPerform's string substitution.voidsubstituteComponents(List<String> components) Perform's string substitution for give components.voidsubstituteGroups(List<String> groups) Perform's string substitution for give groups.
-
Constructor Details
-
StringSubstitutionEngine
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 Details
-
setAttributePreprocessor
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
Description copied from interface:StringSubstitutorSet's a factory which can process aFileEntryor anArchiveentry to retrieve all theSubstitutableentries.- Specified by:
setEntryFactoryin interfaceStringSubstitutor- Parameters:
factory-
-
setFileBackupLocation
Description copied from interface:StringSubstitutorTODO: Missing Implementation- Specified by:
setFileBackupLocationin interfaceStringSubstitutor- Parameters:
backupLocation-
-
getDefaultProperties
Description copied from interface:StringSubstitutorGet's 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
Description copied from interface:StringSubstitutorPerform's string substitution.- Specified by:
substituteAllin interfaceStringSubstitutor- Throws:
StringSubstitutionException- If any error occurs in string substitution.
-
substituteComponents
Description copied from interface:StringSubstitutorPerform's string substitution for give components.- Specified by:
substituteComponentsin interfaceStringSubstitutor- Throws:
StringSubstitutionException- If any error occurs during substitution.
-
substituteGroups
Description copied from interface:StringSubstitutorPerform's 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
Description copied from interface:StringSubstitutorGet's the string-subs definition object. Aobject contains the details of component, groups and files used in substitution.invalid reference
StringSubsDefinitonNOTE: This object is updatable.
- Specified by:
getStringSubsDefinitionin interfaceStringSubstitutor- Returns:
- Parsed string-subs configuration object.
-