FileDocCategorySizeDatePackage
PathCallParamRule.javaAPI DocApache Tomcat 6.0.143048Fri Jul 20 04:20:34 BST 2007org.apache.tomcat.util.digester

PathCallParamRule

public class PathCallParamRule extends Rule

Rule implementation that saves a parameter containing the Digester matching path for use by a surrounding CallMethodRule. This Rule is most useful when making extensive use of wildcards in rule patterns.

since
1.6

Fields Summary
protected int
paramIndex
The zero-relative index of the parameter we are saving.
Constructors Summary
public PathCallParamRule(int paramIndex)
Construct a "call parameter" rule that will save the body text of this element as the parameter value.

param
paramIndex The zero-relative parameter number


        this.paramIndex = paramIndex;

    
Methods Summary
public voidbegin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)
Process the start of this element.

param
namespace the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
param
name the local name if the parser is namespace aware, or just the element name otherwise
param
attributes The attribute list for this element


    // --------------------------------------------------------- Public Methods


                                                                          
              

        String param = getDigester().getMatch();
        
        if(param != null) {
            Object parameters[] = (Object[]) digester.peekParams();
            parameters[paramIndex] = param;
        }
        
    
public java.lang.StringtoString()
Render a printable version of this Rule.


        StringBuffer sb = new StringBuffer("PathCallParamRule[");
        sb.append("paramIndex=");
        sb.append(paramIndex);
        sb.append("]");
        return (sb.toString());