## org.apache.tomcat.util.digester
Class CallParamRule

    java.lang.Object
      org.apache.tomcat.util.digester.Rule
          org.apache.tomcat.util.digester.CallParamRule

    public class CallParamRule

extends Rule

Rule implementation that saves a parameter for use by a surrounding `CallMethodRule`.``

This parameter may be:

- from an attribute of the current element See `CallParamRule(int paramIndex, String attributeName)`
- from current the element body See `CallParamRule(int paramIndex)`
- from the top object on the stack. See `CallParamRule(int paramIndex, boolean fromStack)`
- the current path being processed (separate `Rule`). See `PathCallParamRule`

Field Summary
`protected java.lang.String` `attributeName` The attribute from which to save the parameter value
`protected ArrayStack` `bodyTextStack` Stack is used to allow nested body text to be processed.
`protected boolean` `fromStack` Is the parameter to be set from the stack?
`protected int` `paramIndex` The zero-relative index of the parameter we are saving.
`protected int` `stackIndex` The position of the object from the top of the stack

Fields inherited from class org.apache.tomcat.util.digester.Rule
`digester, namespaceURI`

Constructor Summary
`CallParamRule(Digester digester, int paramIndex)` Deprecated. The digester instance is now set in the `Digester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)` method. Use `CallParamRule(int paramIndex)` instead.
`CallParamRule(Digester digester, int paramIndex, java.lang.String attributeName)` Deprecated. The digester instance is now set in the `Digester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)` method. Use `CallParamRule(int paramIndex, String attributeName)` instead.
`CallParamRule(int paramIndex)` Construct a "call parameter" rule that will save the body text of this element as the parameter value.
`CallParamRule(int paramIndex, boolean fromStack)` Construct a "call parameter" rule.
`CallParamRule(int paramIndex, int stackIndex)` Constructs a "call parameter" rule which sets a parameter from the stack.
`CallParamRule(int paramIndex, java.lang.String attributeName)` Construct a "call parameter" rule that will save the value of the specified attribute as the parameter value.

Method Summary
`void` `begin(org.xml.sax.Attributes attributes)` Process the start of this element.
`void` `body(java.lang.String bodyText)` Process the body text of this element.
`void` `end(java.lang.String namespace, java.lang.String name)` Process any body texts now.
`java.lang.String` `toString()` Render a printable version of this Rule.

Methods inherited from class org.apache.tomcat.util.digester.Rule
`begin, body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### attributeName

    protected java.lang.String attributeName

  The attribute from which to save the parameter value

### paramIndex

    protected int paramIndex

  The zero-relative index of the parameter we are saving.

### fromStack

    protected boolean fromStack

  Is the parameter to be set from the stack?

### stackIndex

    protected int stackIndex

  The position of the object from the top of the stack

### bodyTextStack

    protected ArrayStack bodyTextStack

  Stack is used to allow nested body text to be processed. Lazy creation.

Constructor Detail

### CallParamRule

    public CallParamRule(Digester digester,
                         int paramIndex)

  Deprecated. The digester instance is now set in the `Digester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)` method. Use `CallParamRule(int paramIndex)` instead.

  Construct a "call parameter" rule that will save the body text of this element as the parameter value.

  Parameters:
    `digester` - The associated Digester
    `paramIndex` - The zero-relative parameter number

### CallParamRule

    public CallParamRule(Digester digester,
                         int paramIndex,
                         java.lang.String attributeName)

  Deprecated. The digester instance is now set in the `Digester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)` method. Use `CallParamRule(int paramIndex, String attributeName)` instead.

  Construct a "call parameter" rule that will save the value of the specified attribute as the parameter value.

  Parameters:
    `digester` - The associated Digester
    `paramIndex` - The zero-relative parameter number
    `attributeName` - The name of the attribute to save

### CallParamRule

    public CallParamRule(int paramIndex)

  Construct a "call parameter" rule that will save the body text of this element as the parameter value.

  Parameters:
    `paramIndex` - The zero-relative parameter number

### CallParamRule

    public CallParamRule(int paramIndex,
                         java.lang.String attributeName)

  Construct a "call parameter" rule that will save the value of the specified attribute as the parameter value.

  Parameters:
    `paramIndex` - The zero-relative parameter number
    `attributeName` - The name of the attribute to save

### CallParamRule

    public CallParamRule(int paramIndex,
                         boolean fromStack)

  Construct a "call parameter" rule.

  Parameters:
    `paramIndex` - The zero-relative parameter number
    `fromStack` - should this parameter be taken from the top of the stack?

### CallParamRule

    public CallParamRule(int paramIndex,
                         int stackIndex)

  Constructs a "call parameter" rule which sets a parameter from the stack. If the stack contains too few objects, then the parameter will be set to null.

  Parameters:
    `paramIndex` - The zero-relative parameter number
    `stackIndex` - the index of the object which will be passed as a parameter. The zeroth object is the top of the stack, 1 is the next object down and so on.

Method Detail

### begin

    public void begin(org.xml.sax.Attributes attributes)
               throws java.lang.Exception

  Process the start of this element.

  Overrides:
    `begin` in class `Rule`
  Parameters:
    `attributes` - The attribute list for this element
  Throws:
    `java.lang.Exception`

### body

    public void body(java.lang.String bodyText)
              throws java.lang.Exception

  Process the body text of this element.

  Overrides:
    `body` in class `Rule`
  Parameters:
    `bodyText` - The body text of this element
  Throws:
    `java.lang.Exception`

### end

    public void end(java.lang.String namespace,
                    java.lang.String name)

  Process any body texts now.

  Overrides:
    `end` in class `Rule`
  Parameters:
    `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
    `name` - the local name if the parser is namespace aware, or just the element name otherwise

### toString

    public java.lang.String toString()

  Render a printable version of this Rule.

  Overrides:
    `toString` in class `java.lang.Object`

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.