Package org.jabsorb.reflect

Examples of org.jabsorb.reflect.ClassData


   * @return The data associated with the className
   */
  private ClassData resolveClass(String className)
  {
    Class clazz;
    ClassData cd = null;

    synchronized (state)
    {
      HashMap classMap = state.getClassMap();
      clazz = (Class) classMap.get(className);
    }

    if (clazz != null)
    {
      cd = ClassAnalyzer.getClassData(clazz);
    }

    if (cd != null)
    {
      if (log.isDebugEnabled())
      {
        log.debug("found class " + cd.getClazz().getName() + " named "
            + className);
      }
      return cd;
    }

View Full Code Here


    ObjectInstance oi = null;

    // ClassData for resolved object instance, or if object instance cannot
    // resolve, class data for
    // class instance (static method) we are resolving to
    ClassData cd = null;

    HashMap methodMap = null;
    Method method = null;
    Object itsThis = null;

    if (objectID == 0)
    {
      // Handle "system.listMethods"
      // this is called by the browser side javascript
      // when a new JSONRpcClient object is initialized.
      if (encodedMethod.equals("system.listMethods"))
      {
        HashSet m = new HashSet();
        globalBridge.allInstanceMethods(m);
        if (globalBridge != this)
        {
          globalBridge.allStaticMethods(m);
          globalBridge.allInstanceMethods(m);
        }
        allStaticMethods(m);
        allInstanceMethods(m);
        JSONArray methods = new JSONArray();
        Iterator i = m.iterator();
        while (i.hasNext())
        {
          methods.put(i.next());
        }
        return new JSONRPCResult(JSONRPCResult.CODE_SUCCESS, requestId, methods);
      }
      // Look up the class, object instance and method objects
      if (className == null
          || methodName == null
          || ((oi = resolveObject(className)) == null && (cd = resolveClass(className)) == null))
      {
        return new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, requestId,
            JSONRPCResult.MSG_ERR_NOMETHOD);
      }
      if (oi != null)
      {
        itsThis = oi.o;
        cd = ClassAnalyzer.getClassData(oi.clazz);
        methodMap = cd.getMethodMap();
      }
      else
      {
        if (cd != null)
        {
          methodMap = cd.getStaticMethodMap();
        }
      }
    }
    else
    {
      if ((oi = resolveObject(Integer.valueOf(objectID))) == null)
      {
        return new JSONRPCResult(JSONRPCResult.CODE_ERR_NOMETHOD, requestId,
            JSONRPCResult.MSG_ERR_NOMETHOD);
      }
      itsThis = oi.o;
      cd = ClassAnalyzer.getClassData(oi.clazz);
      methodMap = cd.getMethodMap();
      // Handle "system.listMethods"
      // this is called by the browser side javascript
      // when a new JSONRpcClient object with an objectID is initialized.

      if (methodName != null && methodName.equals("listMethods"))
      {
        HashSet m = new HashSet();
        uniqueMethods(m, "", cd.getStaticMethodMap());
        uniqueMethods(m, "", cd.getMethodMap());
        JSONArray methods = new JSONArray();
        Iterator i = m.iterator();
        while (i.hasNext())
        {
          methods.put(i.next());
View Full Code Here

        {
          continue;
        }
        String name = (String) key;
        ObjectInstance oi = (ObjectInstance) oientry.getValue();
        ClassData cd = ClassAnalyzer.getClassData(oi.clazz);
        uniqueMethods(m, name + ".", cd.getMethodMap());
        uniqueMethods(m, name + ".", cd.getStaticMethodMap());
      }
    }
  }
View Full Code Here

      while (i.hasNext())
      {
        Map.Entry cdentry = (Map.Entry) i.next();
        String name = (String) cdentry.getKey();
        Class clazz = (Class) cdentry.getValue();
        ClassData cd = ClassAnalyzer.getClassData(clazz);
        uniqueMethods(m, name + ".", cd.getStaticMethodMap());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.jabsorb.reflect.ClassData

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.