Class CompoundSubstitutor
- java.lang.Object
-
- org.apache.commons.digester3.Substitutor
-
- org.apache.commons.digester3.substitution.CompoundSubstitutor
-
public class CompoundSubstitutor extends Substitutor
This Substitutor chains two Substitutorsa
andb
. All values to substitute are first handled bya
and passed tob
afterwards.
-
-
Field Summary
Fields Modifier and Type Field Description private Substitutor
a
Substitutor aprivate Substitutor
b
Substitutor b
-
Constructor Summary
Constructors Constructor Description CompoundSubstitutor(Substitutor a, Substitutor b)
Creates a new CompoundSubstitutor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
substitute(java.lang.String bodyText)
Substitutes for the body text.org.xml.sax.Attributes
substitute(org.xml.sax.Attributes attributes)
Substitutes the attributes (before they are passed to theRule
implementations's).
-
-
-
Field Detail
-
a
private final Substitutor a
Substitutor a
-
b
private final Substitutor b
Substitutor b
-
-
Constructor Detail
-
CompoundSubstitutor
public CompoundSubstitutor(Substitutor a, Substitutor b)
Creates a new CompoundSubstitutor instance. All values overgiven tosubstitute()
are first handled bya
and passed tob
afterwards. Both Substitutor have to be not null.- Parameters:
a
- Substitutor ab
- Substitutor b
-
-
Method Detail
-
substitute
public org.xml.sax.Attributes substitute(org.xml.sax.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 originalAttributes
instance can be safely reused. The implementation is therefore free to reuse the sameAttributes
instance for all calls.- Specified by:
substitute
in classSubstitutor
- Parameters:
attributes
- theAttributes
passed intoDigester
by the SAX parser, not null (but may be empty)- Returns:
Attributes
to be passed to theRule
implementations. This method may pass back the Attributes passed in. Not null but possibly empty.
-
substitute
public java.lang.String substitute(java.lang.String bodyText)
Substitutes for the body text. This method may substitute values into the body text of the elements that Digester parses.- Specified by:
substitute
in classSubstitutor
- Parameters:
bodyText
- the body text (as passed toDigester
)- Returns:
- the body text to be passed to the
Rule
implementations
-
-