Package javassist.bytecode

Examples of javassist.bytecode.AttributeInfo


    CodeAttribute codeAttribute = method.getMethodInfo().getCodeAttribute();

    LocalVariableAttribute locals = null;

    if (codeAttribute != null) {
      AttributeInfo attribute;
      attribute = codeAttribute.getAttribute("LocalVariableTable");
      locals = (LocalVariableAttribute) attribute;
    }

    String methodName = method.getName();
View Full Code Here


        else
            throw new NotFoundException(m.toString());
    }

    public byte[] getAttribute(String name) {
        AttributeInfo ai = getClassFile2().getAttribute(name);
        if (ai == null)
            return null;
        else
            return ai.get();
    }
View Full Code Here

    }

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

     * @param copyFrom
     */
    public static void copyCustomAttributes(final CtMethod copyTo, final CtMethod copyFrom) {
        List attributes = copyFrom.getMethodInfo().getAttributes();
        for (Iterator iterator = attributes.iterator(); iterator.hasNext();) {
            AttributeInfo attributeInfo = (AttributeInfo) iterator.next();
            if (attributeInfo.getName().startsWith(AttributeEnhancer.CUSTOM_ATTRIBUTE)) {
                copyTo.setAttribute(attributeInfo.getName(), attributeInfo.get());
               
                //FIXME bug here = ALEX WHAT DO YOU MEAN????
               
                //System.out.println("JavassistHelper.copyCustomAttributes " + copyFrom.getName() + " to " +
                // copyTo.getName() + " " + attributeInfo.getName());
View Full Code Here

    static boolean isInjectable(ClassFile cf, Log log) {
        log.debug("Analyzing " + cf.getName());

        try {
            AttributeInfo classAttribute = cf.getAttribute(AnnotationsAttribute.visibleTag);
            if (classAttribute != null) {
                if (findAnnotation(cf, log, classAttribute, "com.avast.syringe.config.ConfigBean")) return true;
            }

            List<FieldInfo> fields = cf.getFields();
            for (FieldInfo field : fields) {
                AttributeInfo fieldAttribute = field.getAttribute(AnnotationsAttribute.visibleTag);
                if (fieldAttribute != null) {
                    if (findAnnotation(cf, log, fieldAttribute, "com.avast.syringe.config.ConfigProperty")) return true;
                }
            }
View Full Code Here

        else
            throw new NotFoundException(m.toString());
    }

    public byte[] getAttribute(String name) {
        AttributeInfo ai = getClassFile2().getAttribute(name);
        if (ai == null)
            return null;
        else
            return ai.get();
    }
View Full Code Here

    }

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

        else
            throw new NotFoundException(m.toString());
    }

    public byte[] getAttribute(String name) {
        AttributeInfo ai = getClassFile2().getAttribute(name);
        if (ai == null)
            return null;
        else
            return ai.get();
    }
View Full Code Here

    }

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

        else
            throw new NotFoundException(m.toString());
    }

    public byte[] getAttribute(String name) {
        AttributeInfo ai = getClassFile2().getAttribute(name);
        if (ai == null)
            return null;
        else
            return ai.get();
    }
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.