cookxml.core.adder
Class CallFunctionAdder

java.lang.Object
  extended bycookxml.core.adder.CallFunctionAdder
All Implemented Interfaces:
Adder

public class CallFunctionAdder
extends Object
implements Adder

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

Since:
CookXml 1.0

Constructor Summary
CallFunctionAdder(String funcName, Class parentClass, Class childClass)
           
 
Method Summary
 boolean add(String ns, String parentTag, Object parent, Object child, DecodeEngine decodeEngine)
          Add the child to the parent.
static boolean add(String parentNS, String parentTag, Object parent, Object child, DecodeEngine decodeEngine, Class parentClass, Class childClass, String funcName, Adder adder)
           
 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

add

public boolean add(String ns,
                   String parentTag,
                   Object parent,
                   Object child,
                   DecodeEngine decodeEngine)
            throws AdderException
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.

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:
AdderException - the exception to be thrown when error occurs. Other types of exceptions should be wrapped inside an AdderException.

add

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

toString

public String toString()