Package javassist.bytecode

Examples of javassist.bytecode.AttributeInfo


    private List<AnnotationMetadata> annotationsFor( ClassFile clazz ) {
        List<AnnotationMetadata> annotations = new LinkedList<AnnotationMetadata>();

        for (Object ob : clazz.getAttributes()) {
            AttributeInfo att = (AttributeInfo)ob;

            if (att instanceof AnnotationsAttribute) {
                for (Annotation ann : ((AnnotationsAttribute)att).getAnnotations()) {
                    annotations.add(new AnnotationMetadata(ann));
                }
View Full Code Here


    private List<AnnotationMetadata> annotationsFor( FieldInfo field ) {
        List<AnnotationMetadata> annotations = new LinkedList<AnnotationMetadata>();

        for (Object ob : field.getAttributes()) {
            AttributeInfo att = (AttributeInfo)ob;

            if (att instanceof AnnotationsAttribute) {
                for (Annotation ann : ((AnnotationsAttribute)att).getAnnotations()) {
                    annotations.add(new AnnotationMetadata(ann));
                }
View Full Code Here

    private List<AnnotationMetadata> annotationsFor( MethodInfo method ) {
        List<AnnotationMetadata> annotations = new LinkedList<AnnotationMetadata>();

        for (Object ob : method.getAttributes()) {
            AttributeInfo att = (AttributeInfo)ob;

            if (att instanceof AnnotationsAttribute) {
                for (Annotation ann : ((AnnotationsAttribute)att).getAnnotations()) {
                    annotations.add(new AnnotationMetadata(ann));
                }
View Full Code Here

/*  441 */     destClass.rebuildClassFile();
/*      */   }
/*      */
/*      */   public byte[] getAttribute(String name)
/*      */   {
/*  456 */     AttributeInfo ai = this.methodInfo.getAttribute(name);
/*  457 */     if (ai == null) {
/*  458 */       return null;
/*      */     }
/*  460 */     return ai.get();
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public void setAttribute(String name, byte[] data)
/*      */   {
/*  474 */     this.declaringClass.checkModify();
/*  475 */     this.methodInfo.addAttribute(new AttributeInfo(this.methodInfo.getConstPool(), name, data));
/*      */   }
View Full Code Here

/*      */
/*   87 */     FieldInfo fi = this.fieldInfo;
/*   88 */     fi.setAccessFlags(src.fieldInfo.getAccessFlags());
/*   89 */     ConstPool cp = fi.getConstPool();
/*   90 */     while (iterator.hasNext()) {
/*   91 */       AttributeInfo ainfo = (AttributeInfo)iterator.next();
/*   92 */       fi.addAttribute(ainfo.copy(cp, null));
/*      */     }
/*      */   }
View Full Code Here

/*  396 */     }throw new RuntimeException("bad tag: " + cp.getTag(index) + " at " + index);
/*      */   }
/*      */
/*      */   public byte[] getAttribute(String name)
/*      */   {
/*  413 */     AttributeInfo ai = this.fieldInfo.getAttribute(name);
/*  414 */     if (ai == null) {
/*  415 */       return null;
/*      */     }
/*  417 */     return ai.get();
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public void setAttribute(String name, byte[] data)
/*      */   {
/*  431 */     this.declaringClass.checkModify();
/*  432 */     this.fieldInfo.addAttribute(new AttributeInfo(this.fieldInfo.getConstPool(), name, data));
/*      */   }
View Full Code Here

/* 1334 */       throw new NotFoundException(m.toString());
/*      */     }
/*      */   }
/*      */
/*      */   public byte[] getAttribute(String name) {
/* 1338 */     AttributeInfo ai = getClassFile2().getAttribute(name);
/* 1339 */     if (ai == null) {
/* 1340 */       return null;
/*      */     }
/* 1342 */     return ai.get();
/*      */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public void setAttribute(String name, byte[] data) {
/* 1346 */     checkModify();
/* 1347 */     ClassFile cf = getClassFile2();
/* 1348 */     cf.addAttribute(new AttributeInfo(cf.getConstPool(), name, data));
/*      */   }
View Full Code Here

TOP

Related Classes of javassist.bytecode.AttributeInfo

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.