org.apache.tomcat.util.digester

Class CallParamRule

public class CallParamRule extends Rule

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

This parameter may be:

Field Summary
protected StringattributeName
The attribute from which to save the parameter value
protected ArrayStackbodyTextStack
Stack is used to allow nested body text to be processed.
protected booleanfromStack
Is the parameter to be set from the stack?
protected intparamIndex
The zero-relative index of the parameter we are saving.
protected intstackIndex
The position of the object from the top of the stack
Constructor Summary
CallParamRule(Digester digester, int paramIndex)
Construct a "call parameter" rule that will save the body text of this element as the parameter value.
CallParamRule(Digester digester, int paramIndex, String attributeName)
Construct a "call parameter" rule that will save the value of the specified attribute as the parameter value.
CallParamRule(int paramIndex)
Construct a "call parameter" rule that will save the body text of this element as the parameter value.
CallParamRule(int paramIndex, String attributeName)
Construct a "call parameter" rule that will save the value of the specified attribute 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.
Method Summary
voidbegin(Attributes attributes)
Process the start of this element.
voidbody(String bodyText)
Process the body text of this element.
voidend(String namespace, String name)
Process any body texts now.
StringtoString()
Render a printable version of this Rule.

Field Detail

attributeName

protected String attributeName
The attribute from which to save the parameter value

bodyTextStack

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

fromStack

protected boolean fromStack
Is the parameter to be set from the stack?

paramIndex

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

stackIndex

protected int stackIndex
The position of the object from the top of the stack

Constructor Detail

CallParamRule

public CallParamRule(Digester digester, int paramIndex)

Deprecated: The digester instance is now set in the Digester method. Use CallParamRule 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, String attributeName)

Deprecated: The digester instance is now set in the Digester method. Use CallParamRule 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, 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(Attributes attributes)
Process the start of this element.

Parameters: attributes The attribute list for this element

body

public void body(String bodyText)
Process the body text of this element.

Parameters: bodyText The body text of this element

end

public void end(String namespace, String name)
Process any body texts now.

toString

public String toString()
Render a printable version of this Rule.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.