Search in sources :

Example 1 with AnnotatedFieldCollectVisitor

use of net.glowstone.linkstone.runtime.collect.AnnotatedFieldCollectVisitor in project Glowstone by GlowstoneMC.

the class LinkstonePluginScanner method scanPlugin.

private void scanPlugin(File pluginJar) throws IOException {
    ZipInputStream zin = new ZipInputStream(new FileInputStream(pluginJar));
    ZipEntry entry;
    while ((entry = zin.getNextEntry()) != null) {
        if (entry.isDirectory() || !entry.getName().endsWith(".class")) {
            continue;
        }
        ClassVisitor cv = new AnnotatedFieldCollectVisitor(this.fields);
        cv = new BoxCollectVisitor(this.boxes, cv);
        new ClassReader(zin).accept(cv, ClassReader.SKIP_CODE);
        zin.closeEntry();
    }
    zin.close();
}
Also used : ZipInputStream(java.util.zip.ZipInputStream) AnnotatedFieldCollectVisitor(net.glowstone.linkstone.runtime.collect.AnnotatedFieldCollectVisitor) ZipEntry(java.util.zip.ZipEntry) ClassReader(org.objectweb.asm.ClassReader) ClassVisitor(org.objectweb.asm.ClassVisitor) FileInputStream(java.io.FileInputStream) BoxCollectVisitor(net.glowstone.linkstone.runtime.collect.BoxCollectVisitor)

Aggregations

FileInputStream (java.io.FileInputStream)1 ZipEntry (java.util.zip.ZipEntry)1 ZipInputStream (java.util.zip.ZipInputStream)1 AnnotatedFieldCollectVisitor (net.glowstone.linkstone.runtime.collect.AnnotatedFieldCollectVisitor)1 BoxCollectVisitor (net.glowstone.linkstone.runtime.collect.BoxCollectVisitor)1 ClassReader (org.objectweb.asm.ClassReader)1 ClassVisitor (org.objectweb.asm.ClassVisitor)1