Examples of ClassData


Examples of org.fakereplace.data.ClassData

    public static Field getField(Class<?> clazz, String name) throws NoSuchFieldException {
        if (!ClassDataStore.instance().isClassReplaced(clazz)) {
            return clazz.getField(name);
        }
        ClassData cd = ClassDataStore.instance().getModifiedClassData(clazz.getClassLoader(), Descriptor.toJvmName(clazz.getName()));

        if (cd == null) {
            return clazz.getField(name);
        }
        FieldData fd = cd.getField(name);
        if (fd == null) {
            return clazz.getField(name);
        }
        if (!AccessFlag.isPublic(fd.getAccessFlags())) {
            throw new NoSuchFieldException(clazz.getName() + "." + name);
View Full Code Here

Examples of org.fakereplace.data.ClassData

    public static Field getDeclaredField(Class<?> clazz, String name) throws NoSuchFieldException {
        if (!ClassDataStore.instance().isClassReplaced(clazz)) {
            return clazz.getDeclaredField(name);
        }

        ClassData cd = ClassDataStore.instance().getModifiedClassData(clazz.getClassLoader(), Descriptor.toJvmName(clazz.getName()));

        if (cd == null) {
            return clazz.getDeclaredField(name);
        }
        FieldData fd = cd.getField(name);
        if (fd == null) {
            return clazz.getDeclaredField(name);
        }

        switch (fd.getMemberType()) {
View Full Code Here

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

Examples of org.jabsorb.reflect.ClassData

    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

Examples of org.jabsorb.reflect.ClassData

        {
          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

Examples of org.jabsorb.reflect.ClassData

      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

Examples of org.mmisw.orrclient.gwt.client.rpc.VocabularyOntologyData.ClassData

    vp.setSpacing(4);
   
    if ( classes == null || classes.size() == 0 ) {
      // empty data - we must be creating a new vocabulary
      // insert a default contents to initialize the table
      ClassData classData = new ClassData();
     
//      classData.setClassUri("");
     
//      List<String> classHeader = new ArrayList<String>();
//      classHeader.add("name");
//      classHeader.add("definition");
//     
//      List<IRow> rows = new ArrayList<IRow>();
//      rows.add(new IRow() {
//        public String getColValue(String sortColumn) {
//          return "";
//        }
//      });

      VocabClassPanel classPanel = new VocabClassPanel(classData, myVocabPanel, readOnly);
      baseOntologyContentsPanels.add(classPanel);

//      classPanel.importContents(classHeader, rows);
     
      vp.add(classPanel.getWidget());
     
      return vp;
    }
   
    for ( ClassData classData : classes ) {
      List<String> classHeader = classData.getDatatypeProperties();
     
      VocabClassPanel classPanel = new VocabClassPanel(classData, myVocabPanel, readOnly);
      baseOntologyContentsPanels.add(classPanel);
     
//      ViewTable viewTable = new ViewTable(colNames);
//      tp.add(viewTable.getWidget());
     

      List<IndividualInfo> individuals = classData.getIndividuals();
      log("num individuals: " +individuals.size());
     
      List<IRow> rows = new ArrayList<IRow>();
     
      for ( IndividualInfo entity : individuals ) {
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.VocabularyOntologyData.ClassData

      String classUri = entity.getDomainUri();
      if ( classUri == null ) {
        continue;
      }
     
      ClassData classData = classMap.get(classUri);
      if ( classData == null ) {
        classData = new ClassData();
        classMap.put(classUri, classData);
        classData.setClassUri(classUri);
        classData.setClassInfo(entity.getDomainClassInfo());
        classData.setDatatypeProperties(new ArrayList<String>());
      }
     
      classData.getDatatypeProperties().add(entity.getLocalName());
    }
   
    // add the found classes and add corresponding individuals:

    List<ClassData> classes = new ArrayList<ClassData>();
    ontologyData.setClasses(classes);
   
    for ( String classUri : classMap.keySet() ) {
      ClassData classData = classMap.get(classUri);
      classes.add(classData);
     
      // add individuals whose type is classUri
     
      List<IndividualInfo> individuals = new ArrayList<IndividualInfo>();
      classData.setIndividuals(individuals);
     
      List<IndividualInfo> individualInfos = baseData.getIndividuals();
     
      Collections.sort(individualInfos, individualComparator);
     
View Full Code Here

Examples of org.sf.bee.commons.remoting.jrpc.reflect.ClassData

            throws NoSuchMethodException {
        final Map result = new HashMap();
        // if it is not an object
        if (objectID == 0) {
            final ObjectInstance instance = this.resolveObject(className);
            final ClassData classData = this.resolveClass(className);

            if (null == instance && null == classData) {
                throw new NoSuchMethodException(JSONRPCResult.MSG_ERR_NOMETHOD);
            }

            // Look up the class, object instance and method objects
            if (instance != null) {
                final ClassData cd = ClassAnalyzer.getInstance().getClassData(
                        instance.getClazz());
                result.putAll(cd.getMethodMap());
            } else if (methodName.equals(CONSTRUCTOR_FLAG)) {
                // try to get the constructor data
                try {
                    final ClassData cd = ClassAnalyzer.getInstance().getClassData(
                            this.lookupClass(className));
                    result.putAll(cd.getConstructorMap());
                } catch (Exception e) {
                    throw new NoSuchMethodException(JSONRPCResult.MSG_ERR_NOCONSTRUCTOR);
                }
            } else if (classData != null) {
                // else it must be static
                result.putAll(classData.getStaticMethodMap());
            }
        } else {
            // else it is an object, so we can get the member methods
            final ObjectInstance oi = this.resolveObject(objectID);
            if (oi == null) {
                throw new NoSuchMethodException();
            }
            ClassData cd = ClassAnalyzer.getInstance().getClassData(oi.getClazz());
            result.putAll(cd.getMethodMap());
        }
        return result;
    }
View Full Code Here

Examples of org.sf.bee.commons.remoting.jrpc.reflect.ClassData

     * @return The data associated with the className
     */
    private ClassData resolveClass(final String className) {
        final Logger logger = this.getLogger();
        Class clazz;
        ClassData cd = null;

        synchronized (_classMap) {
            clazz = (Class) _classMap.get(className);
        }

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

        if (cd != null) {
            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE,
                        "found class {0} named {1}",
                        new Object[]{
                            cd.getClazz().getName(),
                            className});
            }
            return cd;
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.