public class VariableSubstitutor extends Substitutor
VariableExpander
implementations. Supports setting an expander just
for body text or just for attributes. Also supported is setting no expanders for body text and for attributes.Constructor and Description |
---|
VariableSubstitutor(VariableExpander expander)
Constructs a Substitutor which uses the same VariableExpander for both body text and attibutes.
|
VariableSubstitutor(VariableExpander attributesExpander,
VariableExpander bodyTextExpander)
Constructs a Substitutor.
|
Modifier and Type | Method and Description |
---|---|
Attributes |
substitute(Attributes attributes)
Substitutes the attributes (before they are passed to the
Rule implementations's). |
String |
substitute(String bodyText)
Substitutes for the body text.
|
public VariableSubstitutor(VariableExpander expander)
expander
- VariableExpander implementation, null if no substitutions are to be performedpublic VariableSubstitutor(VariableExpander attributesExpander, VariableExpander bodyTextExpander)
attributesExpander
- VariableExpander implementation to be used for attributes, null if no attribute
substitutions are to be performedbodyTextExpander
- VariableExpander implementation to be used for bodyTextExpander, null if no attribute
substitutions are to be performedpublic Attributes substitute(Attributes attributes)
Substitutes the attributes (before they are passed to the Rule
implementations's).
Digester
will only call this method a second time once the original Attributes
instance
can be safely reused. The implementation is therefore free to reuse the same Attributes
instance for
all calls.
substitute
in class Substitutor
attributes
- the Attributes
passed into Digester
by the SAX parser, not null (but
may be empty)Attributes
to be passed to the Rule
implementations. This method may pass back
the Attributes passed in. Not null but possibly empty.public String substitute(String bodyText)
substitute
in class Substitutor
bodyText
- the body text (as passed to Digester
)Rule
implementationsCopyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.