Package org.apache.xbean.asm

Examples of org.apache.xbean.asm.ClassReader.accept()


    private static void file(File file, DependencyVisitor dependencyVisitor) {
        try {
            FileInputStream in = new FileInputStream(file);
            try {
                ClassReader classReader = new ClassReader(in);
                classReader.accept(dependencyVisitor, ClassWriter.COMPUTE_MAXS);
            } finally {
                in.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here


     * enum class.
     */
    private static boolean isEnum(byte[] bytes) {
        IsEnumVisitor isEnumVisitor = new IsEnumVisitor();
        ClassReader classReader = new ClassReader(bytes);
        classReader.accept(isEnumVisitor, ClassReader.SKIP_DEBUG);
        return isEnumVisitor.isEnum;
    }

    /**
     * Fast-parse the given class bytecode to determine if it is an
View Full Code Here

     * annotation class.
     */
    private static boolean isAnnotationClass(byte[] bytes) {
        IsAnnotationVisitor isAnnotationVisitor = new IsAnnotationVisitor();
        ClassReader classReader = new ClassReader(bytes);
        classReader.accept(isAnnotationVisitor, ClassReader.SKIP_DEBUG);
        return isAnnotationVisitor.isAnnotation;
    }

    public static class IsAnnotationVisitor extends EmptyVisitor {
        public boolean isAnnotation = false;
View Full Code Here

    private static void file(File file, KeysAnnotationVisitor visitor) {
        try {
            FileInputStream in = new FileInputStream(file);
            try {
                ClassReader classReader = new ClassReader(in);
                classReader.accept(visitor, ClassWriter.COMPUTE_MAXS);
            } finally {
                in.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

        Map<Constructor, List<String>> constructorParameters = new HashMap<Constructor, List<String>>();
        try {
            ClassReader reader = AsmParameterNameLoader.createClassReader(clazz);

            AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz);
            reader.accept(visitor, 0);

            Map exceptions = visitor.getExceptions();
            if (exceptions.size() == 1) {
                throw new RuntimeException((Exception) exceptions.values().iterator().next());
            }
View Full Code Here

        Map<Method, List<String>>  methodParameters = new HashMap<Method, List<String>>();
        try {
            ClassReader reader = AsmParameterNameLoader.createClassReader(clazz);

            AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor visitor = new AsmParameterNameLoader.AllParameterNamesDiscoveringVisitor(clazz, methodName);
            reader.accept(visitor, 0);

            Map exceptions = visitor.getExceptions();
            if (exceptions.size() == 1) {
                throw new RuntimeException((Exception) exceptions.values().iterator().next());
            }
View Full Code Here

        if (processed.contains(c.getName())) return;

        try {
            URL u = c.getResource("/" + c.getName().replace('.', '/') + ".class");
            ClassReader r = new ClassReader(u.openStream());
            r.accept(new PersistenceContextReader(), ClassReader.SKIP_DEBUG);
        } catch (IOException e) {
            throw new OpenEJBException("Unable to read class " + c.getName());
        }

        processed.add(c.getName());
View Full Code Here

            if (resource != null) {
                InputStream in = resource.openStream();
//                in = new BufferedInputStream(in, 8192 / 4);
                try {
                    ClassReader classReader = new ClassReader(in);
                    classReader.accept(visitor, ASM_FLAGS);
                } finally {
                    in.close();
                }
            } else {
                new Exception("Could not load " + className).printStackTrace();
View Full Code Here

            if (resource != null) {
                InputStream in = resource.openStream();
//                in = new BufferedInputStream(in, 8192 / 4);
                try {
                    ClassReader classReader = new ClassReader(in);
                    classReader.accept(visitor, ASM_FLAGS);
                } finally {
                    in.close();
                }
            } else {
                new Exception("Could not load " + className).printStackTrace();
View Full Code Here

     * enum class.
     */
    private static boolean isEnum(byte[] bytes) {
        IsEnumVisitor isEnumVisitor = new IsEnumVisitor();
        ClassReader classReader = new ClassReader(bytes);
        classReader.accept(isEnumVisitor, ClassReader.SKIP_DEBUG);
        return isEnumVisitor.isEnum;
    }

    /**
     * Fast-parse the given class bytecode to determine if it is an
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.