|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.digester.Rule org.apache.commons.digester.CallParamRule
public class CallParamRule
Rule implementation that saves a parameter for use by a surrounding
CallMethodRule
.
This parameter may be:
CallParamRule(int paramIndex, String attributeName)
CallParamRule(int paramIndex)
CallParamRule(int paramIndex, boolean fromStack)
Rule
).
See PathCallParamRule
Field Summary | |
---|---|
protected String |
attributeName
The attribute from which to save the parameter value |
protected Stack<String> |
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.commons.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.commons.digester.Rule) method.
Use CallParamRule(int paramIndex) instead. |
|
CallParamRule(Digester digester,
int paramIndex,
String attributeName)
Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.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,
String attributeName)
Construct a "call parameter" rule that will save the value of the specified attribute as the parameter value. |
Method Summary | |
---|---|
void |
begin(Attributes attributes)
Process the start of this element. |
void |
body(String bodyText)
Process the body text of this element. |
void |
end(String namespace,
String name)
Process any body texts now. |
String |
toString()
Render a printable version of this Rule. |
Methods inherited from class org.apache.commons.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 |
---|
protected String attributeName
protected int paramIndex
protected boolean fromStack
protected int stackIndex
protected Stack<String> bodyTextStack
Constructor Detail |
---|
@Deprecated public CallParamRule(Digester digester, int paramIndex)
Digester.addRule(java.lang.String, org.apache.commons.digester.Rule)
method.
Use CallParamRule(int paramIndex)
instead.
Note that if the element is empty the an empty string is passed to the target method, not null. And if automatic type conversion is being applied (ie if the target function takes something other than a string as a parameter) then the conversion will fail if the converter class does not accept an empty string as valid input.
digester
- The associated DigesterparamIndex
- The zero-relative parameter number@Deprecated public CallParamRule(Digester digester, int paramIndex, String attributeName)
Digester.addRule(java.lang.String, org.apache.commons.digester.Rule)
method.
Use CallParamRule(int paramIndex, String attributeName)
instead.
digester
- The associated DigesterparamIndex
- The zero-relative parameter numberattributeName
- The name of the attribute to savepublic CallParamRule(int paramIndex)
Note that if the element is empty the an empty string is passed to the target method, not null. And if automatic type conversion is being applied (ie if the target function takes something other than a string as a parameter) then the conversion will fail if the converter class does not accept an empty string as valid input.
paramIndex
- The zero-relative parameter numberpublic CallParamRule(int paramIndex, String attributeName)
paramIndex
- The zero-relative parameter numberattributeName
- The name of the attribute to savepublic CallParamRule(int paramIndex, boolean fromStack)
paramIndex
- The zero-relative parameter numberfromStack
- should this parameter be taken from the top of the stack?public CallParamRule(int paramIndex, int stackIndex)
paramIndex
- The zero-relative parameter numberstackIndex
- 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 |
---|
public void begin(Attributes attributes) throws Exception
begin
in class Rule
attributes
- The attribute list for this element
Exception
public void body(String bodyText) throws Exception
body
in class Rule
bodyText
- The body text of this element
Exception
public void end(String namespace, String name)
end
in class Rule
namespace
- the namespace URI of the matching element, or an
empty string if the parser is not namespace aware or the element has
no namespacename
- the local name if the parser is namespace aware, or just
the element name otherwisepublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |