Package org.apache.xbean.asm

Examples of org.apache.xbean.asm.Type


                throw new IllegalArgumentException("No such property " + cmpFieldName + " defined on bean class " + beanClassName);
            }
            // if this is an abstract method, then it's one we have to generate
            if (Modifier.isAbstract(getter.getModifiers())) {

                Type type = Type.getType(getter.getReturnType());
                CmpField cmpField = new CmpField(cmpFieldName, type, getter);
                this.cmpFields.put(cmpFieldName, cmpField);
            }
            else {
                // the getter is non-abstract.  We only allow this if the class that
View Full Code Here


     * @param mv       The method context we're initializing in.
     * @param cmrField The CMR field to process.
     */
    private void initCmrFields(MethodVisitor mv, CmrField cmrField) {
        // this.${cmrField.name} = new ${cmrField.initialValueType}();
        Type initialValueType = cmrField.getInitialValueType();
        if (initialValueType != null) {
            mv.visitVarInsn(ALOAD, 0);
            mv.visitTypeInsn(NEW, initialValueType.getInternalName());
            mv.visitInsn(DUP);
            mv.visitMethodInsn(INVOKESPECIAL, initialValueType.getInternalName(), "<init>", "()V");
            mv.visitFieldInsn(PUTFIELD, implClassName, cmrField.getName(), cmrField.getDescriptor());
        }

        // this.${cmrField.name}Cmr = new ${cmrField.accessorType}<${cmrField.type}, ${cmrField.proxyType}>(this,
        //         ${cmrField.name},
View Full Code Here

            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);

            int offset = 1;
            for (Class<?> aClass : constructor.getParameterTypes()) {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(ILOAD), offset);
                offset += type.getSize();
            }

            mv.visitMethodInsn(INVOKESPECIAL, classFileName, "<init>", descriptor);
            mv.visitInsn(RETURN);
            mv.visitMaxs(-1, -1);
View Full Code Here

                mv.visitCode();
                mv.visitVarInsn(ALOAD, 0);

                int offset = 1;
                for (Class<?> aClass : impl.getParameterTypes()) {
                    final Type type = Type.getType(aClass);
                    mv.visitVarInsn(type.getOpcode(ILOAD), offset);
                    offset += type.getSize();
                }

                final Type declaringClass = Type.getType(impl.getDeclaringClass());
                mv.visitMethodInsn(INVOKESPECIAL, declaringClass.getInternalName(), name, methodDescriptor);

                final Type returnType = Type.getType(method.getReturnType());
                mv.visitInsn(returnType.getOpcode(IRETURN));
                mv.visitMaxs(-1, -1);
                mv.visitEnd();
            }
        } catch (NoSuchMethodException e) {
        }
View Full Code Here

    @Override
    public void visit(final String name, final Object value) {
        if ("value".equals(name)) {
            if (value instanceof Type) {
                final Type type = (Type) value;
                final int sort = type.getSort();
                switch (sort) {
                    case Type.OBJECT:
                        if (type.getClassName().equals(ValidationRunner.class.getName())) {
                            classInfos.add(current);
                        }
                        break;
                }
            } else {
View Full Code Here

TOP

Related Classes of org.apache.xbean.asm.Type

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.