Package org.hotswap.agent.javassist.bytecode

Examples of org.hotswap.agent.javassist.bytecode.ClassFile


            throws ClassNotFoundException, RuntimeException {
        String classname = annotation.getTypeName();
        if (pool != null) {
            try {
                org.hotswap.agent.javassist.CtClass cc = pool.get(classname);
                ClassFile cf = cc.getClassFile2();
                org.hotswap.agent.javassist.bytecode.MethodInfo minfo = cf.getMethod(name);
                if (minfo != null) {
                    AnnotationDefaultAttribute ainfo
                            = (AnnotationDefaultAttribute)
                            minfo.getAttribute(AnnotationDefaultAttribute.tag);
                    if (ainfo != null) {
View Full Code Here


    public List<String> scanPlugins(ClassLoader classLoader, String path) throws IOException {
        final List<String> files = new LinkedList<String>();
        scanner.scan(classLoader, path, new ScannerVisitor() {
            @Override
            public void visit(InputStream file) throws IOException {
                ClassFile cf;
                try {
                    DataInputStream dstream = new DataInputStream(file);
                    cf = new ClassFile(dstream);
                } catch (IOException e) {
                    throw new IOException("Stream not a valid classFile", e);
                }

                if (hasAnnotation(cf))
                    files.add(cf.getName());
            }
        });
        return files;
    }
View Full Code Here

        if (isInterface || superclass == null)
            superName = null;
        else
            superName = superclass.getName();

        classfile = new ClassFile(isInterface, name, superName);
        if (isInterface && superclass != null)
            classfile.setInterfaces(new String[]{superclass.getName()});

        setModifiers(org.hotswap.agent.javassist.Modifier.setPublic(getModifiers()));
        hasConstructor = isInterface;
View Full Code Here

     * <p>This method may return <code>null</code>.
     *
     * @return a <code>Collection&lt;String&gt;</code> object.
     */
    public synchronized Collection getRefClasses() {
        ClassFile cf = getClassFile2();
        if (cf != null) {
            ClassMap cm = new ClassMap() {
                public void put(String oldname, String newname) {
                    put0(oldname, newname);
                }

                public Object get(Object jvmClassName) {
                    String n = toJavaName((String)jvmClassName);
                    put0(n, n);
                    return null;
                }

                public void fix(String name) {}
            };
            cf.getRefClasses(cm);
            return cm.values();
        }
        else
            return null;
    }
View Full Code Here

        super.setModifiers(mod);
        updateInnerEntry(mod, getName(), this, true);
    }

    private static void updateInnerEntry(int mod, String name, CtClass clazz, boolean outer) {
        ClassFile cf = clazz.getClassFile2();
        InnerClassesAttribute ica = (InnerClassesAttribute) cf.getAttribute(
                InnerClassesAttribute.tag);
        if (ica == null)
            return;

        int n = ica.tableLength();
View Full Code Here

TOP

Related Classes of org.hotswap.agent.javassist.bytecode.ClassFile

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.