Save This Page
Home » commons-digester-1.8-src » org.apache.commons » digester » [javadoc | source]
org.apache.commons.digester
abstract public class: Substitutor [javadoc | source]
java.lang.Object
   org.apache.commons.digester.Substitutor

Direct Known Subclasses:
    VariableSubstitutor

(Logical) Interface for substitution strategies. (It happens to be implemented as a Java abstract class to allow future additions to be made without breaking backwards compatibility.)

Usage: When Digester#setSubstitutor is set, Digester calls the methods in this interface to create substitute values which will be passed into the Rule implementations. Of course, it is perfectly acceptable for implementations not to make substitutions and simply return the inputs.

Different strategies are supported for attributes and body text.

Method from org.apache.commons.digester.Substitutor Summary:
substitute,   substitute
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.digester.Substitutor Detail:
 abstract 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.

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