public class SystemPropertyPreprocessor extends Object implements DocumentElementPreprocessor.ElementPreprocessor
SystemPropertyPreprocessor
is an DocumentElementPreprocessor.ElementPreprocessor
that will
replace XmlElement
content annotated with "system-property" attributes with appropriate
System.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.
Modifier and Type | Field and Description |
---|---|
static SystemPropertyPreprocessor |
INSTANCE
This singleton instance of the
SystemPropertyPreprocessor . |
Constructor and Description |
---|
SystemPropertyPreprocessor() |
Modifier and Type | Method and Description |
---|---|
boolean |
preprocess(ProcessingContext context,
XmlElement element)
Process an
XmlElement , optionally mutating it (or it's children) if required. |
static boolean |
processValueMacro(XmlElement element)
Process macros embedded in element's value
|
public static final SystemPropertyPreprocessor INSTANCE
SystemPropertyPreprocessor
.public boolean preprocess(ProcessingContext context, XmlElement element) throws ConfigurationException
XmlElement
, optionally mutating it (or it's children) if required.
Note: An implementation of this interface should avoid
attempting to traverse child XmlElement
s. If you wish to
manually traverse or change the entire document, you should instead use
a DocumentPreprocessor
.
preprocess
in interface DocumentElementPreprocessor.ElementPreprocessor
context
- the ProcessingContext
in which the pre-processing is occurringelement
- the XmlElement
to preprocesstrue
if the specified XmlElement
should be
re-preprocessed by this and other DocumentElementPreprocessor.ElementPreprocessor
s
due to the XmlElement
being modified, false
otherwise.ConfigurationException
- if during pre-processing of the XmlElement
a configuration
issue was discovered (or if pre-processing fails for some reason)public static boolean processValueMacro(XmlElement element)
element
- the XmlElement
to preprocess