Interface StringSubstitutor
-
- All Known Implementing Classes:
StringSubstitutionEngine
public interface StringSubstitutor
An object which allows to set the custom behaviour for string substitution operation and facilitate String substitution process.String substitution is a process of substituting a string in a file with another string.
-
-
Method Summary
All Methods Instance Methods Abstract 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 defaultProperty
for the givenPropertyType
, 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 theAttributePreprocessor
to customize the substitution process.void
setEntryFactory(SubstitutableFactory factory)
Set's a factory which can process aFileEntry
or anArchive
entry to retrieve all theSubstitutable
entries.void
setFileBackupLocation(File backupLocation)
TODO: Missing Implementationvoid
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.
-
-
-
Method Detail
-
setAttributePreprocessor
void setAttributePreprocessor(AttributePreprocessor attributePreprocessor)
Set's theAttributePreprocessor
to customize the substitution process. Attribute preprocessor takes care to retrieve the value of substitutable key.- Parameters:
attributePreprocessor
- Custom implementation ofAttributePreprocessor
-
setEntryFactory
void setEntryFactory(SubstitutableFactory factory)
Set's a factory which can process aFileEntry
or anArchive
entry to retrieve all theSubstitutable
entries.- Parameters:
factory
-
-
setFileBackupLocation
void setFileBackupLocation(File backupLocation)
TODO: Missing Implementation- Parameters:
backupLocation
-
-
getDefaultProperties
List<com.sun.enterprise.admin.servermgmt.xml.stringsubs.Property> getDefaultProperties(com.sun.enterprise.admin.servermgmt.xml.stringsubs.PropertyType type)
Gets the defaultProperty
for the givenPropertyType
, If the property type is null then all the default properties will be returned.- Parameters:
type
- The type for which default properties has to be retrieved.- Returns:
- List of default properties or empty list if no property found.
-
getStringSubsDefinition
com.sun.enterprise.admin.servermgmt.xml.stringsubs.StringsubsDefinition getStringSubsDefinition()
Gets the string-subs definition object. AStringSubsDefiniton
object contains the details of component, groups and files used in substitution.NOTE: This object is updateable.
- Returns:
- Parsed string-subs configuration object.
-
substituteAll
void substituteAll() throws StringSubstitutionException
Performs string substitution.- Throws:
StringSubstitutionException
- If any error occurs in string substitution.
-
substituteComponents
void substituteComponents(List<String> components) throws StringSubstitutionException
Performs string substitution for give components.- Parameters:
components
- List ofComponent
identifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException
- If any error occurs during substitution.
-
substituteGroups
void substituteGroups(List<String> groups) throws StringSubstitutionException
Performs string substitution for give groups.- Parameters:
groups
- List ofGroup
identifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException
- If any error occurs during substitution.
-
-