Examples of JClass


Examples of org.apache.kato.jvmti.javaruntime.model.JClass

   */
  private JClass nreadClass() throws IOException {
    long id = variablesIn.getStreamPosition();
    id--; // Class id/ImagePointer

    JClass c = model.getClass(id);

    // Prevent reference loops (check if this class is partly filled in)
    if (c.classSig != null)
      return c;

    int modifiers = variablesIn.readInt();
    c.modifiers = (short) modifiers;
    log.log(Level.FINEST, "mods " + modifiers + " " + c.modifiers);
    String name = readUTFString(variablesIn);
    String sourceFile = readUTFString(variablesIn);
    String genSig = readUTFString(variablesIn);

    // TODO move this to C implementation
    if (sourceFile.equals("NoSource")) {
      if (!(name.indexOf("[")>-1)&&name.indexOf("L")>-1){
        sourceFile = name.substring(name.lastIndexOf("/")+1, name.indexOf(";")); // Small attempt to extend number of sourcefiles reported to Eclipse
      }
    }
    c.classSig = name;
    c.classid = id;
    c.sourceFile = sourceFile;

    if (variablesIn.readByte() == CJVMTI_METHOD) {
      int num = variablesIn.readInt();
      for (int i = 0; i < num; i++) {
        nmethodDetails(c);
      }
    } else {
      throw new IOException();
    }

    if (variablesIn.readByte() == CJVMTI_CLASS_INSTANCE_FIELDS) {
      instanceFieldDetails(c);
    } else {
      throw new IOException();
    }

    int numStaticFields = 0;
    if (variablesIn.readByte() == CJVMTI_CLASS_STATIC_FIELDS) {
      numStaticFields = nstaticFieldDetails(c);
    } else {
      throw new IOException();
    }

    long supC = 0;
    if (variablesIn.readByte() == CJVMTI_SUPERCLASS_FIELDS) {
      supC = variablesIn.readLong();
    } else {
      throw new IOException();
    }

    long interfaceClasses[];
    if (variablesIn.readByte() == CJVMTI_CLASS_INTERFACES) {
      int numInterfaces = variablesIn.readInt();
      interfaceClasses = new long[numInterfaces];
      for (int i = 0; i < interfaceClasses.length; i++) {
        interfaceClasses[i] = variablesIn.readLong();
      }
    } else {
      throw new IOException();
    }

    if (!(variablesIn.readByte() == CJVMTI_CLASS_STATIC_FIELDS)) {
      throw new IOException();
    }

    long refs[] = new long[numStaticFields];
    for (int i = 0; i < numStaticFields; i++) {
      refs[i] = variablesIn.readLong();
    }

    long classLoaderRef = 0;
    if (variablesIn.readByte() == CJVMTI_CLASSLOADERS) {
      classLoaderRef = variablesIn.readLong();
    } else {
      throw new IOException();
    }

    c.superClassID = supC;
    if (supC != CJVMTI_NULL_OBJECT) {
      c.superclass = nreadClass(supC);
    }

    // Read static field references
    for (JField fl : (List<JField>) c.getDeclaredFields()) {
      if (fl.staticField) {
        fl.staticValue = nreadReference(refs[fl.index]);
      }
    }
    log.log(Level.FINEST, "num interf: " + interfaceClasses.length + " "
        + c.classSig);
    // Follow interface references
    for (long interfaceRef : interfaceClasses) {
      JClass interfaceC = nreadClass(interfaceRef);
      c.addInterface(interfaceC);
    }

    {
      JClassLoader jcl = nreadClassLoader(classLoaderRef);
View Full Code Here

Examples of org.apache.xmlbeans.impl.jam.JClass

    static InterfaceExtensionImpl newInstance(JamClassLoader loader, NameSet xbeanSet, Extensionconfig.Interface intfXO)
    {
        InterfaceExtensionImpl result = new InterfaceExtensionImpl();

        result._xbeanSet = xbeanSet;
        JClass interfaceJClass = validateInterface(loader, intfXO.getName(), intfXO);


        if (interfaceJClass == null)
        {
            BindingConfigImpl.error("Interface '" + intfXO.getStaticHandler() + "' not found.", intfXO);
            return null;
        }

        result._interfaceClassName = interfaceJClass.getQualifiedName();

        result._delegateToClassName = intfXO.getStaticHandler();
        JClass delegateJClass = validateClass(loader, result._delegateToClassName, intfXO);

        if (delegateJClass == null) // no HandlerClass
        {
            BindingConfigImpl.warning("Handler class '" + intfXO.getStaticHandler() + "' not found on classpath, skip validation.", intfXO);
            return result;
View Full Code Here

Examples of org.codehaus.jam.JClass

        JamService service = factory.createService(jam_service_parms);
        QName extraSchemaTypeName = null;
        JamClassIterator jClassIter = service.getClasses();
        // all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext()) {
            JClass jclass = (JClass)jClassIter.next();
            // serviceName = jclass.getSimpleName();
            // todo in the future , when we support annotation we can use this
            // JAnnotation[] annotations = jclass.getAnnotations();

            if (jclass.getQualifiedName().equals(generationParams.getSourceClassName())) {
                /**
                 * Schema genertaion done in two stage 1. Load all the methods
                 * and create type for methods parameters (if the parameters are
                 * Bean then it will create Complex types for those , and if the
                 * parameters are simple type which decribe in SimpleTypeTable
                 * nothing will happen) 2. In the next stage for all the methods
                 * messages and port types will be creteated
                 */
                methods = jclass.getDeclaredMethods();
                // short the elements in the array
                Arrays.sort(methods);

                // since we do not support overload
                HashMap uniqueMethods = new HashMap();
                XmlSchemaComplexType methodSchemaType;
                XmlSchemaSequence sequence = null;

                for (int i = 0; i < methods.length; i++) {
                    JMethod jMethod = methods[i];

                    String methodName = methods[i].getSimpleName();
                    // no need to think abt this method , since that is system
                    // config method
                    if (excludeMethods.contains(jMethod.getSimpleName())) {
                        continue;
                    }

                    if (uniqueMethods.get(jMethod.getSimpleName()) != null) {
                        throw new Exception(" Sorry we don't support methods overloading !!!! ");
                    }

                    if (!jMethod.isPublic()) {
                        // no need to generate Schema for non public methods
                        continue;
                    }
                    uniqueMethods.put(jMethod.getSimpleName(), jMethod);
                    // create the schema type for the method wrapper

                    uniqueMethods.put(jMethod.getSimpleName(), jMethod);
                    JParameter[] paras = jMethod.getParameters();
                    String parameterNames[] = null;
                    // better to handle void types too
                    parameterNames = methodTable.getParameterNames(methodName);
                    sequence = new XmlSchemaSequence();

                    methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName());
                    methodSchemaType.setParticle(sequence);

                    for (int j = 0; j < paras.length; j++) {
                        JParameter methodParameter = paras[j];
                        JClass paraType = methodParameter.getType();
                        generateSchemaForType(sequence, paraType, (parameterNames != null && parameterNames[j] != null)
                            ? parameterNames[j] : methodParameter.getSimpleName());
                    }
                    // for its return type
                    JClass returnType = jMethod.getReturnType();

                    // better to handle void types too
                    methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE);
                    sequence = new XmlSchemaSequence();
                    methodSchemaType.setParticle(sequence);
View Full Code Here

Examples of org.codehaus.jam.JClass

    }

    public void generate() throws IOException {
        List list = new ArrayList();
        for (int i = 0; i < classes.length; i++) {
            JClass type = classes[i];
            if (implementsInterface(type, Scenario.class) && !type.isAbstract() && !type.isInterface()) {
                generateTestsFor(type);
                list.add(type);
            }
        }
View Full Code Here

Examples of org.codehaus.jam.JClass

    protected void generatePropertiesFile(List list) throws IOException {
        PrintWriter writer = new PrintWriter(new FileWriter(scenariosFile));
        try {
            for (Iterator iter = list.iterator(); iter.hasNext();) {
                JClass type = (JClass) iter.next();
                writer.print(type.getQualifiedName());
                writer.print(" = ");
                writeInterfaces(writer, type);
                writer.println();
            }
        }
View Full Code Here

Examples of org.codehaus.jam.JClass

    protected void writeInterfaces(PrintWriter writer, JClass type) {
        List interfaces = new ArrayList();
        addAllInterfaces(interfaces, type);
        boolean first = true;
        for (Iterator iter = interfaces.iterator(); iter.hasNext();) {
            JClass interfaceType = (JClass) iter.next();
            if (first) {
                first = false;
            }
            else {
                writer.print(", ");
            }
            writer.print(interfaceType.getQualifiedName());
        }
    }
View Full Code Here

Examples of org.codehaus.jam.JClass

    }

    protected void addAllInterfaces(List list, JClass type) {
        JClass[] interfaces = type.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            JClass interfaceType = interfaces[i];
            list.add(interfaceType);
        }
        JClass superclass = type.getSuperclass();
        if (superclass != null) {
            addAllInterfaces(list, superclass);
        }
    }
View Full Code Here

Examples of org.codehaus.jam.JClass

    }

    protected boolean implementsInterface(JClass type, Class interfaceClass) {
        JClass[] interfaces = type.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            JClass anInterface = interfaces[i];
            if (anInterface.getQualifiedName().equals(interfaceClass.getName())) {
                return true;
            }
        }
        JClass superclass = type.getSuperclass();
        if (superclass == null || superclass == type) {
            return false;
        }
        else {
            return implementsInterface(superclass, interfaceClass);
View Full Code Here

Examples of org.codehaus.jam.JClass

    }

    public void generate() throws IOException {
        List list = new ArrayList();
        for (int i = 0; i < classes.length; i++) {
            JClass type = classes[i];
            if (implementsInterface(type, Scenario.class) && !type.isAbstract() && !type.isInterface()) {
                generateTestsFor(type);
                list.add(type);
            }
        }
View Full Code Here

Examples of org.codehaus.jam.JClass

    protected void generatePropertiesFile(List list) throws IOException {
        PrintWriter writer = new PrintWriter(new FileWriter(scenariosFile));
        try {
            for (Iterator iter = list.iterator(); iter.hasNext();) {
                JClass type = (JClass) iter.next();
                writer.print(type.getQualifiedName());
                writer.print(" = ");
                writeInterfaces(writer, type);
                writer.println();
            }
        }
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.