Package org.ow2.asm

Examples of org.ow2.asm.AnnotationVisitor


                    superType,
                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    List<AnnotationDefinition> annotations = classDef.getAnnotations();
                    if ( annotations != null && ! annotations.isEmpty() ) {
                        for ( Iterator<AnnotationDefinition> iter = annotations.iterator(); iter.hasNext(); ) {
                            AnnotationDefinition adef = iter.next();
                            if ( Trait.class.getName().equals( adef.getName() ) ) {
                                if ( adef.getPropertyValue( "logical" ) != null ) {
                                    av0.visit( "logical", (Boolean) adef.getPropertyValue( "logical" ) );
                                }
                                if ( adef.getPropertyValue( "impl" ) != null ) {
                                    av0.visit( "impl", Type.getType( (Class) adef.getPropertyValue( "impl" ) ) );
                                }
                                break;
                            }
                        }
                    }
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );


                        "Lorg/drools/factmodel/traits/CoreWrapper<" + BuildUtils.getTypeDescriptor( coreName ) + ">;",
                BuildUtils.getInternalType( coreName ),
                new String[] { Type.getInternalName( CoreWrapper.class ), Type.getInternalName( Externalizable.class ) } );

        {
            AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Traitable.class ), true );
            av0.visit( "logical", core.isFullTraiting() );
        }

        {
            fv = cw.visitField( ACC_PRIVATE, "core", BuildUtils.getTypeDescriptor( coreName ), null, null);
            fv.visitEnd();

                    superType,
                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );

                        "Lorg/drools/factmodel/traits/CoreWrapper<" + BuildUtils.getTypeDescriptor( coreName ) + ">;",
                BuildUtils.getInternalType( coreName ),
                new String[] { Type.getInternalName( CoreWrapper.class ), Type.getInternalName( Externalizable.class ) } );

        {
            AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Traitable.class ), true );
            av0.visit( "logical", core.isFullTraiting() );
        }

        {
            fv = cw.visitField( ACC_PRIVATE, "core", BuildUtils.getTypeDescriptor( coreName ), null, null);
            fv.visitEnd();

                    superType,
                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    List<AnnotationDefinition> annotations = classDef.getAnnotations();
                    if ( annotations != null && ! annotations.isEmpty() ) {
                        for ( Iterator<AnnotationDefinition> iter = annotations.iterator(); iter.hasNext(); ) {
                            AnnotationDefinition adef = iter.next();
                            if ( Trait.class.getName().equals( adef.getName() ) ) {
                                if ( adef.getPropertyValue( "logical" ) != null ) {
                                    av0.visit( "logical", (Boolean) adef.getPropertyValue( "logical" ) );
                                }
                                if ( adef.getPropertyValue( "impl" ) != null ) {
                                    av0.visit( "impl", Type.getType( (Class) adef.getPropertyValue( "impl" ) ) );
                                }
                                break;
                            }
                        }
                    }
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );

                                                    "Lorg/drools/factmodel/traits/CoreWrapper<" + BuildUtils.getTypeDescriptor( coreName ) + ">;",
                                            BuildUtils.getInternalType( coreName ),
                                            new String[] { Type.getInternalName( CoreWrapper.class ), Type.getInternalName( Externalizable.class ) } );

        {
            AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Traitable.class ), true );
            av0.visit( "logical", core.isFullTraiting() );
        }

        {
            fv = cw.visitField( ACC_PRIVATE, "core", BuildUtils.getTypeDescriptor( coreName ), null, null);
            fv.visitEnd();

                                    superType,
                                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    List<AnnotationDefinition> annotations = classDef.getAnnotations();
                    if ( annotations != null && ! annotations.isEmpty() ) {
                        for ( Iterator<AnnotationDefinition> iter = annotations.iterator(); iter.hasNext(); ) {
                            AnnotationDefinition adef = iter.next();
                            if ( Trait.class.getName().equals( adef.getName() ) ) {
                                if ( adef.getPropertyValue( "logical" ) != null ) {
                                    av0.visit( "logical", (Boolean) adef.getPropertyValue( "logical" ) );
                                }
                                if ( adef.getPropertyValue( "impl" ) != null ) {
                                    av0.visit( "impl", Type.getType( (Class) adef.getPropertyValue( "impl" ) ) );
                                }
                                break;
                            }
                        }
                    }
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );

                    superType,
                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    List<AnnotationDefinition> annotations = classDef.getAnnotations();
                    if ( annotations != null && ! annotations.isEmpty() ) {
                        for ( Iterator<AnnotationDefinition> iter = annotations.iterator(); iter.hasNext(); ) {
                            AnnotationDefinition adef = iter.next();
                            if ( Trait.class.getName().equals( adef.getName() ) ) {
                                if ( adef.getPropertyValue( "logical" ) != null ) {
                                    av0.visit( "logical", (Boolean) adef.getPropertyValue( "logical" ) );
                                }
                                if ( adef.getPropertyValue( "impl" ) != null ) {
                                    av0.visit( "impl", Type.getType( (Class) adef.getPropertyValue( "impl" ) ) );
                                }
                                break;
                            }
                        }
                    }
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );

                    superType,
                    intfaces );

            {
                if ( classDef.getDefinedClass() == null || classDef.getDefinedClass().getAnnotation( Trait.class ) == null ) {
                    AnnotationVisitor av0 = cw.visitAnnotation( Type.getDescriptor( Trait.class ), true);
                    av0.visitEnd();
                }
            }

            for ( FieldDefinition field : classDef.getFieldsDefinitions() ) {
                buildField( cw, field );

    final class AnnotationValueArrayRule extends Rule {

        @Override
        public void begin(final String nm, final Attributes attrs) {
            AnnotationVisitor av = (AnnotationVisitor) peek();
            push(av == null ? null : av.visitArray(attrs.getValue("name")));
        }

TOP

Related Classes of org.ow2.asm.AnnotationVisitor

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.