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

Examples of org.eclipse.persistence.internal.libraries.asm.CodeVisitor.visitFieldInsn()


        cv = cw.visitMethod(Constants.ACC_PUBLIC, "setItem", "(L" + mapType.getInternalName() + ";)V", null, methodAttrs1);
        Label l0 = new Label();
        cv.visitLabel(l0);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitVarInsn(Constants.ALOAD, 1);
        cv.visitFieldInsn(Constants.PUTFIELD, qualifiedInternalClassName, "entry", "L" + mapType.getInternalName() + ";");
        cv.visitInsn(Constants.RETURN);
        Label l1 = new Label();
        cv.visitLabel(l1);
        // CODE ATTRIBUTE
View Full Code Here


        methodAttrs2 = new SignatureAttribute("()L" + mapType.getInternalName() + "<L" + internalKeyName + ";L" + internalValueName + ";>;");
        methodAttrs1.next = methodAttrs2;
        cv = cw.visitMethod(Constants.ACC_PUBLIC, "getItem", "()L" + mapType.getInternalName() + ";", null, methodAttrs1);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitFieldInsn(Constants.GETFIELD, qualifiedInternalClassName, "entry", "L" + mapType.getInternalName() + ";");
        cv.visitInsn(Constants.ARETURN);
        cv.visitMaxs(1, 1);

        cv = cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_BRIDGE + Constants.ACC_SYNTHETIC, "getItem", "()Ljava/lang/Object;", null, null);
        cv.visitVarInsn(Constants.ALOAD, 0);
View Full Code Here

            + internalClassName + ";", null, null);

        // Add the "values()" method
        cv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "values", "()[L" + internalClassName + ";",
            null, null);
        cv.visitFieldInsn(GETSTATIC, internalClassName, "$VALUES", "[L" + internalClassName + ";");
        cv.visitMethodInsn(INVOKEVIRTUAL, "[L" + internalClassName + ";", "clone",
            "()Ljava/lang/Object;");
        cv.visitTypeInsn(CHECKCAST, "[L" + internalClassName + ";");
        cv.visitInsn(ARETURN);
        cv.visitMaxs(1, 0);
View Full Code Here

            else {
                cv.visitIntInsn(BIPUSH, i);
            }
            cv.visitMethodInsn(INVOKESPECIAL, internalClassName, "<init>",
                    "(Ljava/lang/String;I)V");
            cv.visitFieldInsn(PUTSTATIC, internalClassName, enumValue, "L" + internalClassName
                + ";");
            lastCount = i;
        }

        if (lastCount <= 5) {
View Full Code Here

                cv.visitInsn(ICONST[i]);
            }
            else {
                cv.visitIntInsn(BIPUSH, i);
            }
            cv.visitFieldInsn(GETSTATIC, internalClassName, enumValue, "L" + internalClassName
                + ";");
            cv.visitInsn(AASTORE);
        }
        cv.visitFieldInsn(PUTSTATIC, internalClassName, "$VALUES", "[L" + internalClassName + ";");
        cv.visitInsn(RETURN);
View Full Code Here

        }

        cv = cw.visitMethod(Constants.ACC_PROTECTED, "componentClass", "()Ljava/lang/Class;", null, null);
        JavaClass baseComponentClass = getBaseComponentType(componentClass);
        if(baseComponentClass.isPrimitive()) {
            cv.visitFieldInsn(Constants.GETSTATIC, getObjectType(baseComponentClass).getQualifiedName().replace('.', '/'), "TYPE", "Ljava/lang/Class;");
        } else {
            cv.visitLdcInsn(Type.getType("L" + baseComponentClass.getQualifiedName().replace('.', '/') + ";"));
        }
        cv.visitInsn(Constants.ARETURN);
        cv.visitMaxs(1, 1);
View Full Code Here

            }
            cv.visitFieldInsn(GETSTATIC, internalClassName, enumValue, "L" + internalClassName
                + ";");
            cv.visitInsn(AASTORE);
        }
        cv.visitFieldInsn(PUTSTATIC, internalClassName, "$VALUES", "[L" + internalClassName + ";");
        cv.visitInsn(RETURN);
        cv.visitMaxs(4, 0);

        cw.visitEnd();
        return cw.toByteArray();
View Full Code Here

        xmlElementAnnotation.add("name", "item");
        xmlElementAnnotation.add("type",  Type.getType("L" + getObjectType(nestedClass).getName().replace('.', '/') + ";"));
        getAdaptedValueMethodAnnotations.annotations.add(xmlElementAnnotation);
        cv = cw.visitMethod(Constants.ACC_PUBLIC, "getAdaptedValue", "()Ljava/util/List;", null, getAdaptedValueMethodAnnotations);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitFieldInsn(Constants.GETFIELD, qualifiedInternalClassName, "adaptedValue", "Ljava/util/List;");
        cv.visitInsn(Constants.ARETURN);
        cv.visitMaxs(1, 1);

        return generateClassFromBytes(qualifiedClassName, cw.toByteArray());
    }
View Full Code Here

        cv = cw.visitMethod(Constants.ACC_PUBLIC, "setItem", "(L" + collectionType.getInternalName() + ";)V", null, methodAttrs1);
        Label l0 = new Label();
        cv.visitLabel(l0);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitVarInsn(Constants.ALOAD, 1);
        cv.visitFieldInsn(Constants.PUTFIELD, qualifiedInternalClassName, "item", "L" + collectionType.getInternalName() + ";");
        cv.visitInsn(Constants.RETURN);
        Label l1 = new Label();
        cv.visitLabel(l1);
        // CODE ATTRIBUTE
               
View Full Code Here

        methodAttrs2 = new SignatureAttribute("()L" + collectionType.getInternalName() + "<" + componentTypeInternalName  + ">;");
        methodAttrs1.next = methodAttrs2;
        cv = cw.visitMethod(Constants.ACC_PUBLIC, "getItem", "()L" + collectionType.getInternalName() + ";", null, methodAttrs1);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitFieldInsn(Constants.GETFIELD, qualifiedInternalClassName, "item", "L" + collectionType.getInternalName() + ";");
        cv.visitInsn(Constants.ARETURN);
        cv.visitMaxs(1, 1);

        cv = cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_BRIDGE + Constants.ACC_SYNTHETIC, "getItem", "()Ljava/lang/Object;", null, null);
        cv.visitVarInsn(Constants.ALOAD, 0);
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.