Package cookxml.core.interfaces

Examples of cookxml.core.interfaces.Handler


        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)
    {
View Full Code Here


    if (valueClass == null)
    {
      if (value != null)
        valueClass = value.getClass ();
    }
    Handler handler = decodeEngine.getHandler (ns, tag, 'f', funcName, valueClass);

    // 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 (obj, funcName, valueClass);
      if (handler == null)
        throw new NoHandlerException (decodeEngine, ns, tag, funcName, obj, value);
      decodeEngine.setHandler (ns, tag, 'f', funcName, valueClass, handler);
    }

    handler.invoke (ns, obj, value, decodeEngine);
  }
View Full Code Here

    {
      Class valueClass = null;
      if (value != null && !(value instanceof String))  // ignore string class since we may need to do conversions
        valueClass = value.getClass ();

      Handler handler = decodeEngine.getHandler (ns, tag, ' ', attr, valueClass);

      // 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)
      {
        String funcName = PREFIX + attr;

        handler = FunctionHandler.getHandler (obj, funcName, valueClass);
        if (handler == null)
          handler = VariableHandler.getHandler (obj, attr, valueClass);

        if (handler != null)
          decodeEngine.setHandler (ns, tag, ' ', attr, valueClass, handler);
      }
      //System.out.println ("obj = " + obj.getClass () + ", value = " + value);
      if (handler != null)
      {
        handler.invoke (ns, obj, value, decodeEngine);
        return;
      }
    }
    catch (Exception ex)
    {
View Full Code Here

          return;
        if (!targetClass.isAssignableFrom (fieldObj.getClass ()))
          return;
      }

      Handler handler = decodeEngine.getHandler (ns, tag, 'v', funcName, targetClass);

      // 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 (obj, funcName, targetClass);
        if (handler != null)
          decodeEngine.setHandler (ns, tag, 'v', funcName, targetClass, handler);
      }

      if (handler != null)
      {
        handler.invoke (ns, obj, fieldObj, decodeEngine);
        return;
      }
    }
    catch (Exception ex)
    {
View Full Code Here

      String funcName = m_funcName;
      Class targetClass = m_targetClass;

      Object fieldObj = ObjectConverter.getInstance ().convert ((String)value, decodeEngine);

      Handler handler = decodeEngine.getHandler (ns, tag, 'f', funcName, targetClass);

      // 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 (obj, funcName, targetClass);
        if (handler != null)
          decodeEngine.setHandler (ns, tag, 'f', funcName, targetClass, handler);
      }

      if (handler != null)
      {
        handler.invoke (ns, obj, fieldObj, decodeEngine);
        return;
      }
    }
    catch (Exception ex)
    {
View Full Code Here

      else if (targetClass == null || targetClass.isInstance (value))
      {
        fieldObj = value;
      }

      Handler handler = decodeEngine.getHandler (ns, tag, 'f', funcName, targetClass);

      // 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 (obj, funcName, targetClass);
        if (handler != null)
          decodeEngine.setHandler (ns, tag, 'f', funcName, targetClass, handler);
      }

      if (handler != null)
      {
        handler.invoke (ns, obj, fieldObj, decodeEngine);
        return;
      }
    }
    catch (Exception ex)
    {
View Full Code Here

TOP

Related Classes of cookxml.core.interfaces.Handler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.