Class SystemPropertyPreprocessor
- java.lang.Object
-
- com.tangosol.coherence.config.xml.preprocessor.SystemPropertyPreprocessor
-
- All Implemented Interfaces:
DocumentElementPreprocessor.ElementPreprocessor
public class SystemPropertyPreprocessor extends Object implements DocumentElementPreprocessor.ElementPreprocessor
ASystemPropertyPreprocessoris anDocumentElementPreprocessor.ElementPreprocessorthat will replaceXmlElementcontent annotated with "system-property" attributes with appropriateSystem.getProperties().The element's value is processed for macro expansion. The macro syntax is ${system-property default-value}. Thus, a value of near-${coherence.client direct} can be macro expanded by default to near-direct. If system property coherence.client is set to remote, then the value would be expanded to near-remote.
- Since:
- Coherence 12.1.2
- Author:
- bo 2011.08.03
-
-
Field Summary
Fields Modifier and Type Field Description static SystemPropertyPreprocessorINSTANCEThis singleton instance of theSystemPropertyPreprocessor.
-
Constructor Summary
Constructors Constructor Description SystemPropertyPreprocessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanpreprocess(ProcessingContext context, XmlElement element)Process anXmlElement, optionally mutating it (or it's children) if required.static booleanprocessValueMacro(XmlElement element)Process macros embedded in element's valuestatic booleanprocessValueMacro(XmlElement element, ParameterResolver resolver)Process macros embedded in element's value
-
-
-
Field Detail
-
INSTANCE
public static final SystemPropertyPreprocessor INSTANCE
This singleton instance of theSystemPropertyPreprocessor.
-
-
Method Detail
-
preprocess
public boolean preprocess(ProcessingContext context, XmlElement element) throws ConfigurationException
Process anXmlElement, optionally mutating it (or it's children) if required.Note: An implementation of this interface should avoid attempting to traverse child
XmlElements. If you wish to manually traverse or change the entire document, you should instead use aDocumentPreprocessor.- Specified by:
preprocessin interfaceDocumentElementPreprocessor.ElementPreprocessor- Parameters:
context- theProcessingContextin which the pre-processing is occurringelement- theXmlElementto preprocess- Returns:
trueif the specifiedXmlElementshould be re-preprocessed by this and otherDocumentElementPreprocessor.ElementPreprocessors due to theXmlElementbeing modified,falseotherwise.- Throws:
ConfigurationException- if during pre-processing of theXmlElementa configuration issue was discovered (or if pre-processing fails for some reason)
-
processValueMacro
public static boolean processValueMacro(XmlElement element)
Process macros embedded in element's value- Parameters:
element- theXmlElementto preprocess- Returns:
- true iff the String value of element was macro expanded
-
processValueMacro
public static boolean processValueMacro(XmlElement element, ParameterResolver resolver)
Process macros embedded in element's value- Parameters:
element- theXmlElementto preprocessresolver- theParameterResolverto use to resolve macro values- Returns:
- true iff the String value of element was macro expanded
-
-