Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.schema.rules
Class InvokeParentRule  view InvokeParentRule download InvokeParentRule.java

java.lang.Object
  extended byorg.apache.hivemind.impl.BaseLocatable
      extended byorg.apache.hivemind.schema.rules.BaseRule
          extended byorg.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.


Field Summary
private  int _depth
           
private  java.lang.String _methodName
           
 
Fields inherited from class org.apache.hivemind.impl.BaseLocatable
 
Constructor Summary
InvokeParentRule()
           
InvokeParentRule(java.lang.String methodName)
           
 
Method Summary
 void begin(org.apache.hivemind.schema.SchemaProcessor processor, org.apache.hivemind.Element element)
          Invokes the named method on the parent object (using reflection).
private  java.lang.reflect.Method findMethod(java.lang.Object target, java.lang.String name, java.lang.Class parameterType)
          Searches for the *first* public method the has the right name, and takes a single parameter that is compatible with the parameter type.
 int getDepth()
           
 java.lang.String getMethodName()
           
 void setDepth(int i)
          Sets the depth of the parent object.
 void setMethodName(java.lang.String string)
           
 
Methods inherited from class org.apache.hivemind.schema.rules.BaseRule
end
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Field Detail

_methodName

private java.lang.String _methodName

_depth

private int _depth
Constructor Detail

InvokeParentRule

public InvokeParentRule()

InvokeParentRule

public InvokeParentRule(java.lang.String methodName)
Method Detail

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.