if (parent == null)
return false;
if ((parentClass != null && !parentClass.isInstance (parent)) ||
(childClass != null && !childClass.isInstance (child)))
throw new AdderException (decodeEngine, null, adder, parentNS, parentTag, parent, child);
if (childClass == null)
{
if (child != null)
childClass = child.getClass ();
}
try
{
Handler handler = decodeEngine.getHandler (parentNS, parentTag, 'f', funcName, childClass);
// get the handler first.
// if the handler is not in cache, then we need to find it and then put
// it into the cache.
if (handler == null)
{
handler = FunctionHandler.getHandler (parent, funcName, childClass);
if (handler != null)
decodeEngine.setHandler (parentNS, parentTag, 'f', funcName, childClass, handler);
}
if (handler != null)
{
handler.invoke (parentNS, parent, child, decodeEngine);
return true;
}
}
catch (Exception ex)
{
throw new AdderException (decodeEngine, ex, adder, parentNS, parentTag, parent, child);
}
throw new AdderException (decodeEngine, null, adder, parentNS, parentTag, parent, child);
}