org.apache.commons.digester3.substitution
Class CompoundSubstitutor

java.lang.Object
  extended by org.apache.commons.digester3.Substitutor
      extended by org.apache.commons.digester3.substitution.CompoundSubstitutor

public class CompoundSubstitutor
extends Substitutor

This Substitutor chains two Substitutors a and b. All values to substitute are first handled by a and passed to b afterwards.


Constructor Summary
CompoundSubstitutor(Substitutor a, Substitutor b)
          Creates a new CompoundSubstitutor instance.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundSubstitutor

public CompoundSubstitutor(Substitutor a,
                           Substitutor b)
Creates a new CompoundSubstitutor instance. All values overgiven to substitute() are first handled by a and passed to b afterwards. Both Substitutor have to be not null.

Parameters:
a - Substitutor a
b - Substitutor b
Method Detail

substitute

public 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.

Specified by:
substitute in class Substitutor
Parameters:
attributes - the Attributes passed into Digester by the SAX parser, not null (but may be empty)
Returns:
Attributes to be passed to the Rule implementations. This method may pass back the Attributes passed in. Not null but possibly empty.

substitute

public String substitute(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 class Substitutor
Parameters:
bodyText - the body text (as passed to Digester)
Returns:
the body text to be passed to the Rule implementations


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.