Package net.sf.joafip.asm

Examples of net.sf.joafip.asm.FieldVisitor


public class ObjectDump implements Opcodes {

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(
        V1_5,
        ACC_PUBLIC + ACC_SUPER,
        "java/lang/Object",
        null,
        null,
        new String[] { "net/sf/joafip/store/service/proxy/IProxyCallBack" });

    {
      fv = cw.visitField(
          ACC_PRIVATE + ACC_TRANSIENT,
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;",
          null, null);
      fv.visitEnd();
    }
    {
      fv = cw.visitField(ACC_PRIVATE + ACC_TRANSIENT,
          "setProxyCallBackTrace", "Ljava/lang/Exception;", null,
          null);
      fv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
      mv.visitCode();
      mv.visitInsn(RETURN);
View Full Code Here


public class JoafipObjectDump implements Opcodes {

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    AnnotationVisitor av0;

    cw.visit(
        V1_6,
        ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/store/service/proxy/JoafipObject",
        null,
        "java/lang/Object",
        new String[] { "net/sf/joafip/store/service/proxy/IProxyCallBack" });

    {
      av0 = cw.visitAnnotation("Lnet/sf/joafip/NotStorableClass;", true);
      av0.visitEnd();
    }
    {
      fv = cw.visitField(
          ACC_PRIVATE + ACC_TRANSIENT,
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;",
          null, null);
      fv.visitEnd();
    }
    {
      fv = cw.visitField(ACC_PRIVATE + ACC_TRANSIENT,
          "setProxyCallBackTrace", "Ljava/lang/Exception;", null,
          null);
      fv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
View Full Code Here

   *
   * @param cv
   *            a class visitor.
   */
  public void accept(final ClassVisitor cv) {
    FieldVisitor fv = cv.visitField(access, name, desc, signature, value);
    if (fv == null) {
      return;
    }
    int i, n;
    n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
    for (i = 0; i < n; ++i) {
      AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);
      an.accept(fv.visitAnnotation(an.desc, true));
    }
    n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
    for (i = 0; i < n; ++i) {
      AnnotationNode an = (AnnotationNode) invisibleAnnotations.get(i);
      an.accept(fv.visitAnnotation(an.desc, false));
    }
    n = attrs == null ? 0 : attrs.size();
    for (i = 0; i < n; ++i) {
      fv.visitAttribute((Attribute) attrs.get(i));
    }
    fv.visitEnd();
  }
View Full Code Here

      CheckMethodAdapter.checkFieldSignature(signature);
    }
    if (value != null) {
      CheckMethodAdapter.checkConstant(value);
    }
    FieldVisitor av = cv.visitField(access, name, desc, signature, value);
    return new CheckFieldAdapter(av);
  }
View Full Code Here

public class NewDump implements Opcodes {

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "net/sf/joafip/asm/New", null,
        "java/lang/Object", null);

    {
      fv = cw.visitField(ACC_PRIVATE, "list", "Ljava/util/List;",
          "Ljava/util/List<Ljava/lang/Integer;>;", null);
      fv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
View Full Code Here

  @SuppressWarnings("unused")
  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/asm/NewProxyCallBack", null, "java/lang/Object",
        null);

    {
      fv = cw.visitField(
          ACC_PRIVATE + ACC_FINAL,
          "proxyCallBack",
          "Lnet/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation;",
          null, null);
      fv.visitEnd();
    }
    {
      mv = cw.visitMethod(
          ACC_PUBLIC,
          "<init>",
View Full Code Here

public class StaticProxyCallBackCallDump implements Opcodes {

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;

    cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER,
        "net/sf/joafip/asm/StaticProxyCallBackCall", null,
        "java/lang/Object", null);

    {
      fv = cw.visitField(ACC_PRIVATE, "field", "I", null, null);
      fv.visitEnd();
    }
    {
      mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
      mv.visitCode();
      mv.visitVarInsn(ALOAD, 0);
View Full Code Here

public class LdcDump implements Opcodes {

  public static byte[] dump() throws Exception {

    ClassWriter cw = new ClassWriter(0);
    @SuppressWarnings("unused")
    FieldVisitor fv;
    MethodVisitor mv;
    @SuppressWarnings("unused")
    AnnotationVisitor av0;
View Full Code Here

  }

  @Override
  public FieldVisitor visitField(final int access, final String name,
      final String desc, final String signature, final Object value) {
    final FieldVisitor fieldVisitor = classWriter.visitField(access, name,
        desc, signature, value);
    return new FieldGenerator(fieldVisitor);
  }
View Full Code Here

    }

    /*
     * $proxyCallBack$ private field
     */
    FieldVisitor fieldVisitor;
    MethodVisitor methodVisitor;
    fieldVisitor = classWriter.visitField(
    /**/ACC_TRANSIENT,/* access */
        /**/PROXY_CALL_BACK_FIELD_NAME,/* name */
        /**/I_PROXY_CALL_BACK_DELEGATION_DESC,/* desc */
        /**/null,/* signature */
        /**/null/* value */);
    fieldVisitor.visitEnd();

    /*
     * setProxyCallBack method
     */
    methodVisitor = classWriter.visitMethod(
View Full Code Here

TOP

Related Classes of net.sf.joafip.asm.FieldVisitor

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.