java.lang.Object
org.apache.hivemind.impl.BaseLocatable
org.apache.hivemind.schema.rules.BaseRule
org.apache.hivemind.schema.rules.InvokeParentRule
- All Implemented Interfaces:
- org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, org.apache.hivemind.schema.Rule
- public class InvokeParentRule
- extends BaseRule
Rule used to connect a child object to its parent by invoking a method on the parent, passing the
child. The child object is the top object on the stack and the parent object is the next object
down on the stack. Created from the <invoke-parent> element. Generally, this
is the last rule in a sequence of rules.
| Fields inherited from class org.apache.hivemind.impl.BaseLocatable |
|
| Methods inherited from class org.apache.hivemind.schema.rules.BaseRule |
end |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_methodName
private java.lang.String _methodName
_depth
private int _depth
InvokeParentRule
public InvokeParentRule()
InvokeParentRule
public InvokeParentRule(java.lang.String methodName)
begin
public void begin(org.apache.hivemind.schema.SchemaProcessor processor,
org.apache.hivemind.Element element)
- Invokes the named method on the parent object (using reflection).
- Specified by:
begin in interface org.apache.hivemind.schema.Rule- Overrides:
begin in class BaseRule
getMethodName
public java.lang.String getMethodName()
setMethodName
public void setMethodName(java.lang.String string)
getDepth
public int getDepth()
- Since:
- 1.1
setDepth
public void setDepth(int i)
- Sets the depth of the parent object. The default is 1.
findMethod
private java.lang.reflect.Method findMethod(java.lang.Object target,
java.lang.String name,
java.lang.Class parameterType)
throws java.lang.NoSuchMethodException
- Searches for the *first* public method the has the right name, and takes a single parameter
that is compatible with the parameter type.