public static final class DocumentTransformer.SystemPropertiesTransformer extends Object implements Document.ValueTransformer
Document.ValueTransformer
that replaces variables in the
field values with values from the system properties. Only string values are considered, since other types cannot contain
variables (and since the transformers are never called on Document or List values).
Variables may appear anywhere within a string value, and multiple variables can be used within the same value. Variables take the form:
variable := '${' variableNames [ ':' defaultValue ] '}' variableNames := variableName [ ',' variableNames ] variableName := /* any characters except ',' and ':' and '}' defaultValue := /* any characters exceptNote that variableName is the name used to look up a System property via
System.getProperty(String)
.
Notice that the syntax supports multiple variables. The logic will process the variables from let to right,
until an existing System property is found. And at that point, it will stop and will not attempt to find values for the
other variables.
Constructor and Description |
---|
DocumentTransformer.SystemPropertiesTransformer() |
public DocumentTransformer.SystemPropertiesTransformer()
public Object transform(String name, Object value)
Document.ValueTransformer
transform
in interface Document.ValueTransformer
name
- the name of the field; never nullvalue
- the existing value for the fieldvalue
object if no transformation should be
madeCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.