Package com.caucho.bytecode

Examples of com.caucho.bytecode.JavaField


      }
    }

    ArrayList<JavaField> fields = extClass.getFieldList();
    for (int i = 0; i < fields.size(); i++) {
      JavaField field = fields.get(i);

      field.setName(replaceString(className, field.getName()));
      field.setDescriptor(replaceString(className, field.getDescriptor()));
    }

    ArrayList<JavaMethod> methods = extClass.getMethodList();
    for (int i = 0; i < methods.size(); i++) {
      JavaMethod method = methods.get(i);
View Full Code Here


  private void addExtFields(JavaClass baseClass, JavaClass extClass)
  {
    ArrayList<JavaField> fields = baseClass.getFieldList();

    for (JavaField extField : extClass.getFieldList()) {
      JavaField field = extField.export(extClass, baseClass);

      if (! fields.contains(field))
        fields.add(field);
    }
  }
View Full Code Here

          // need to set descriptors, too

          // set private fields to protected
          ArrayList<JavaField> fields = cl.getFieldList();
          for (int i = 0; i < fields.size(); i++) {
            JavaField field = fields.get(i);

            int accessFlags = field.getAccessFlags();

            if ((accessFlags & ACC_PRIVATE) != 0) {
              accessFlags = (accessFlags & ~ ACC_PRIVATE) | ACC_PROTECTED;
              field.setAccessFlags(accessFlags);
            }
          }

          // set private methods to protected
          ArrayList<JavaMethod> methods = cl.getMethodList();
View Full Code Here

    // need to set descriptors, too

    // set private fields to protected
    ArrayList<JavaField> fields = jClass.getFieldList();
    for (int i = 0; i < fields.size(); i++) {
      JavaField field = fields.get(i);

      int accessFlags = field.getAccessFlags();

      if ((accessFlags & ACC_PRIVATE) != 0) {
        accessFlags = (accessFlags & ~ ACC_PRIVATE) | ACC_PROTECTED;
        field.setAccessFlags(accessFlags);
      }
    }

    // set private methods to protected
    ArrayList<JavaMethod> methods = jClass.getMethodList();
View Full Code Here

          // need to set descriptors, too

          // set private fields to protected
          ArrayList<JavaField> fields = cl.getFieldList();
          for (int i = 0; i < fields.size(); i++) {
            JavaField field = fields.get(i);

            int accessFlags = field.getAccessFlags();

            if ((accessFlags & ACC_PRIVATE) != 0) {
              accessFlags = (accessFlags & ~ ACC_PRIVATE) | ACC_PROTECTED;
              field.setAccessFlags(accessFlags);
            }
          }

          // set private methods to protected
          ArrayList<JavaMethod> methods = cl.getMethodList();
View Full Code Here

    // need to set descriptors, too

    // set private fields to protected
    ArrayList<JavaField> fields = jClass.getFieldList();
    for (int i = 0; i < fields.size(); i++) {
      JavaField field = fields.get(i);

      int accessFlags = field.getAccessFlags();

      if ((accessFlags & ACC_PRIVATE) != 0) {
        accessFlags = (accessFlags & ~ ACC_PRIVATE) | ACC_PROTECTED;
        field.setAccessFlags(accessFlags);
      }
    }

    // set private methods to protected
    ArrayList<JavaMethod> methods = jClass.getMethodList();
View Full Code Here

            jClass.addInterface(iface.getName().replace('.', '/'));
        }
       
        jClass.addInterface(ScopeProxy.class.getName().replace('.', '/'));

        JavaField factoryField =
          jClass.createField("_factory",
                             "Lcom/caucho/config/inject/InjectManager$ReferenceFactory;");
        factoryField.setAccessFlags(Modifier.PRIVATE);

        JavaMethod ctor =
          jClass.createMethod("<init>",
                              "(Lcom/caucho/config/inject/InjectManager$ReferenceFactory;)V");
        ctor.setAccessFlags(Modifier.PUBLIC);

        CodeWriterAttribute code = ctor.createCodeWriter();
        code.setMaxLocals(3);
        code.setMaxStack(4);

        code.pushObjectVar(0);
        code.pushObjectVar(1);
        code.putField(thisClassName, factoryField.getName(),
                      factoryField.getDescriptor());
       
        code.pushObjectVar(0);
        code.invokespecial(superClassName, "<init>", "()V", 1, 0);
        code.addReturn();
        code.close();
View Full Code Here

    code.close();
  }

  private void generateWriteReplace(JavaClass jClass)
  {
    JavaField jField
      = jClass.createField("__caucho_handle", "Ljava/lang/Object;");
    jField.setAccessFlags(Modifier.PRIVATE);
   
    JavaMethod jMethod
      = jClass.createMethod("writeReplace", "()Ljava/lang/Object;");
   
    jMethod.setAccessFlags(Modifier.PRIVATE);
View Full Code Here

      }
    }

    ArrayList<JavaField> fields = extClass.getFieldList();
    for (int i = 0; i < fields.size(); i++) {
      JavaField field = fields.get(i);

      field.setName(replaceString(className, field.getName()));
      field.setDescriptor(replaceString(className, field.getDescriptor()));
    }

    ArrayList<JavaMethod> methods = extClass.getMethodList();
    for (int i = 0; i < methods.size(); i++) {
      JavaMethod method = methods.get(i);
View Full Code Here

  private void addExtFields(JavaClass baseClass, JavaClass extClass)
  {
    ArrayList<JavaField> fields = baseClass.getFieldList();

    for (JavaField extField : extClass.getFieldList()) {
      JavaField field = extField.export(extClass, baseClass);

      if (! fields.contains(field))
        fields.add(field);
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.bytecode.JavaField

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.