public class SetRootRule extends AbstractMethodRule
Rule implementation that calls a method on the root object on the stack, passing the top object (child) as an
argument. It is important to remember that this rule acts on end
.
This rule now supports more flexible method matching by default. It is possible that this may break (some) code
written against release 1.1.1 or earlier. See AbstractMethodRule.isExactMatch()
for more details.
fireOnBegin, methodName, paramType, paramTypeName, useExactMatch
Constructor and Description |
---|
SetRootRule(String methodName)
Construct a "set root" rule with the specified method name.
|
SetRootRule(String methodName,
Class<?> paramType)
Construct a "set root" rule with the specified method name.
|
SetRootRule(String methodName,
String paramType)
Construct a "set root" rule with the specified method name.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
getChild()
Returns the argument object of method has to be invoked.
|
protected Object |
getParent()
Returns the target object of method has to be invoked.
|
begin, end, isExactMatch, isFireOnBegin, setExactMatch, setFireOnBegin, toString
body, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
public SetRootRule(String methodName)
methodName
- Method name of the parent method to callpublic SetRootRule(String methodName, String paramType)
methodName
- Method name of the parent method to callparamType
- Java class name of the parent method's argument (if you wish to use a primitive type,
specify the corresonding Java wrapper class instead, such as java.lang.Boolean
for a boolean
parameter)public SetRootRule(String methodName, Class<?> paramType)
methodName
- Method name of the parent method to callparamType
- Java class of the parent method's argument (if you wish to use a primitive type, specify the
corresonding Java wrapper class instead, such as java.lang.Boolean
for a
boolean
parameter)protected Object getChild()
getChild
in class AbstractMethodRule
protected Object getParent()
getParent
in class AbstractMethodRule
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.