Package org.eclipse.persistence.internal.libraries.asm

Examples of org.eclipse.persistence.internal.libraries.asm.Label


        String methodSig = "(L" + mapType.getInternalName() + "<L" + internalKeyName + ";L" + internalValueName + ";>;)V";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setItem", "(L" + mapType.getInternalName() + ";)V", methodSig, null);
        // TODO: Verify that we really want to put @XmlTranient on setItem
        // method
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, qualifiedInternalClassName, "entry", L + mapType.getInternalName() + SEMI_COLON);
        mv.visitInsn(Opcodes.RETURN);
        Label l1 = new Label();
        mv.visitLabel(l1);

        // Replacement?:LocalVariableTypeTableAttribute cvAttr = new
        // LocalVariableTypeTableAttribute();
        // mv.visitAttribute(cvAttr);
View Full Code Here


        // Write: public void setItem({collectionType})
        String methodSig = "(L" + collectionType.getInternalName() + "<" + componentTypeInternalName + ">;)V";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setItem", "(L" + collectionType.getInternalName() + ";)V", methodSig, null);
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        Label l0 = new Label(); // ??
        mv.visitLabel(l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, qualifiedInternalClassName, ITEM, L + collectionType.getInternalName() + SEMI_COLON);
        mv.visitInsn(Opcodes.RETURN);
        Label l1 = new Label(); // ??
        mv.visitLabel(l1);
        mv.visitMaxs(2, 2);
        mv.visitEnd();

        // Write: public {collectionType} getItem()
View Full Code Here

        String methodSig = "(L" + mapType.getInternalName() + "<L" + internalKeyName + ";L" + internalValueName + ";>;)V";
        mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setItem", "(L" + mapType.getInternalName() + ";)V", methodSig, null);
        // TODO: Verify that we really want to put @XmlTranient on setItem
        // method
        mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitFieldInsn(Opcodes.PUTFIELD, qualifiedInternalClassName, "entry", L + mapType.getInternalName() + SEMI_COLON);
        mv.visitInsn(Opcodes.RETURN);
        Label l1 = new Label();
        mv.visitLabel(l1);

        // Replacement?:LocalVariableTypeTableAttribute cvAttr = new
        // LocalVariableTypeTableAttribute();
        // mv.visitAttribute(cvAttr);
View Full Code Here

          // }    
            mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getItem", "()Ljava/lang/Object;", null, null);
          mv.visitCode();
          mv.visitVarInsn(Opcodes.ALOAD, 0);
          mv.visitFieldInsn(Opcodes.GETFIELD, classNameSeparatedBySlash, "adaptedValue", "Ljava/util/Collection;");
          Label l0 = new Label();
          mv.visitJumpInsn(Opcodes.IFNONNULL, l0);
          mv.visitInsn(Opcodes.ACONST_NULL);
          mv.visitInsn(Opcodes.ARETURN);
          mv.visitLabel(l0);
          mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
View Full Code Here

      }
      return sb.toString();
    }

    protected final Label getLabel( Object label) {
      Label lbl = ( Label) labels.get( label);
      if( lbl==null) {
        lbl = new Label();
        labels.put( label, lbl);
      }
      return lbl;
    }
View Full Code Here

   
    public final void end( String name) {
      Map vals = ( Map) pop();
      int min = Integer.parseInt(( String) vals.get( "min"));
      int max = Integer.parseInt(( String) vals.get( "max"));
      Label dflt = getLabel( vals.get( "dflt"));
      Label[] lbls = ( Label[])(( List) vals.get( "labels")).toArray( new Label[ 0]);
      getCodeVisitor().visitTableSwitchInsn( min, max, dflt, lbls);
    }
View Full Code Here

      push( vals);
    }
   
    public final void end( String name) {
      Map vals = ( Map) pop();
      Label dflt = getLabel( vals.get( "dflt"));
      List keyList = ( List) vals.get( "keys");
      Label[] lbls = ( Label[])(( List) vals.get( "labels")).toArray( new Label[ 0]);
      int[] keys = new int[ keyList.size()];
      for( int i = 0; i < keys.length; i++) {
        keys[ i] = Integer.parseInt(( String) keyList.get( i));
View Full Code Here

    public TryCatchRule( String path) {
      super( path);
    }

    public final void begin( String name, Attributes attrs) {
      Label start = getLabel( attrs.getValue( "start"));
      Label end = getLabel( attrs.getValue( "end"));
      Label handler = getLabel( attrs.getValue( "handler"));
      String type = attrs.getValue( "type");
      getCodeVisitor().visitTryCatchBlock( start, end, handler, type);
    }
View Full Code Here

      super( path);
    }

    public final void begin( String name, Attributes attrs) {
      int line = Integer.parseInt( attrs.getValue( "line"));
      Label start = getLabel( attrs.getValue( "start"));
      getCodeVisitor().visitLineNumber( line, start);
    }
View Full Code Here

    }

    public final void begin( String element, Attributes attrs) {
      String name = attrs.getValue( "name");
      String desc = attrs.getValue( "desc");
      Label start = getLabel( attrs.getValue( "start"));
      Label end = getLabel( attrs.getValue( "end"));
      int var = Integer.parseInt( attrs.getValue( "var"));
      getCodeVisitor().visitLocalVariable( name, desc, start, end, var);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.libraries.asm.Label

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.