cookxml.core.adder
Class CallFunctionAdder

java.lang.Object
  extended by cookxml.core.adder.CallFunctionAdder
All Implemented Interfaces:
DocletActionReporter, Adder

public class CallFunctionAdder
extends Object
implements Adder, DocletActionReporter

This Adder redirect the call to a different function, if the parameters match.

Since:
CookXml 1.0
Version:
$Id: CallFunctionAdder.java 265 2007-06-10 18:47:06Z coconut $

Constructor Summary
CallFunctionAdder(String funcName, Class parentClass, Class childClass)
           
 
Method Summary
 boolean add(String ns, String parentTag, Object parent, Object child, cookxml.core.DecodeEngine decodeEngine)
          Add the child to the parent.
static boolean add(String parentNS, String parentTag, Object parent, Object child, cookxml.core.DecodeEngine decodeEngine, Class parentClass, Class childClass, String funcName, Adder adder)
           
 Object[] getActions(TagLibrary tagLibrary, String tagNS, String tag, String attrNS, String attr, Class cl)
          This function returns the related function/constructor/field/methods that is called by creator/setter etc.
static Adder getAdder(String funcName, Class parentClass, Class childClass)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallFunctionAdder

public CallFunctionAdder(String funcName,
                         Class parentClass,
                         Class childClass)
Method Detail

getAdder

public static Adder getAdder(String funcName,
                             Class parentClass,
                             Class childClass)

add

public boolean add(String ns,
                   String parentTag,
                   Object parent,
                   Object child,
                   cookxml.core.DecodeEngine decodeEngine)
            throws Exception
Description copied from interface: Adder
Add the child to the parent. The function should return true if it is the right adder for the request. False if it is not. Throw exceptions for errors.

Specified by:
add in interface Adder
Parameters:
ns - the parent tag namespace.
parentTag - the parent tag name.
parent - the parent object.
child - the child object.
decodeEngine - the DecodeEngine instance being used.
Returns:
whether or not the adder can handle the request.
Throws:
Exception - If the exception is not a AdderException, then it is wrapped inside one by the DecodeEngine and handled by the ExceptionHandler.

add

public static boolean add(String parentNS,
                          String parentTag,
                          Object parent,
                          Object child,
                          cookxml.core.DecodeEngine decodeEngine,
                          Class parentClass,
                          Class childClass,
                          String funcName,
                          Adder adder)
                   throws AdderException
Throws:
AdderException

toString

public String toString()
Overrides:
toString in class Object

getActions

public Object[] getActions(TagLibrary tagLibrary,
                           String tagNS,
                           String tag,
                           String attrNS,
                           String attr,
                           Class cl)
Description copied from interface: DocletActionReporter
This function returns the related function/constructor/field/methods that is called by creator/setter etc. CookXmlDoc would then retrieve the JavaDoc associated with Member object and use it in the documentation.

Specified by:
getActions in interface DocletActionReporter
Parameters:
tagLibrary - the tag library being used.
tagNS - the namespace of the tag
tag - possible tag
attrNS - the namespace of the attribute
attr - the attribute
cl - the possible class
Returns:
A non-empty array of actions performed by this object.