Interface StringSubstitutor
- All Known Implementing Classes:
StringSubstitutionEngine
public interface StringSubstitutor
An object which allows to set the custom behavior 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
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.
-
Method Details
-
setAttributePreprocessor
Set's theAttributePreprocessorto customize the substitution process. Attribute preprocessor takes care to retrieve the value of substitutable key.- Parameters:
attributePreprocessor- Custom implementation ofAttributePreprocessor
-
setEntryFactory
Set's a factory which can process aFileEntryor anArchiveentry to retrieve all theSubstitutableentries.- Parameters:
factory-
-
setFileBackupLocation
TODO: Missing Implementation- Parameters:
backupLocation-
-
getDefaultProperties
Get's the defaultPropertyfor 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
StringsubsDefinition getStringSubsDefinition()Get's the string-subs definition object. AStringSubsDefinitonobject contains the details of component, groups and files used in substitution.NOTE: This object is updatable.
- Returns:
- Parsed string-subs configuration object.
-
substituteAll
Perform's string substitution.- Throws:
StringSubstitutionException- If any error occurs in string substitution.
-
substituteComponents
Perform's string substitution for give components.- Parameters:
component- List ofComponentidentifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException- If any error occurs during substitution.
-
substituteGroups
Perform's string substitution for give groups.- Parameters:
groups- List ofGroupidentifiers for which the string substitution has to be performed.- Throws:
StringSubstitutionException- If any error occurs during substitution.
-