public void parse(InputStream in) throws IOException { Clazz clazz = new Clazz("", null); clazz.parseClassFile(in, new ClassDataCollector() { Scope s; Scope enclosing;
byte code[] = new byte[code_length]; in.readFully(code); crawl(code); int exception_table_length = in.readUnsignedShort(); in.skipBytes(exception_table_length * 8); doAttributes(in, ElementType.METHOD, false);
private void doAnnotations(DataInputStream in, ElementType member, RetentionPolicy policy) throws IOException { int num_annotations = in.readUnsignedShort(); // # of annotations for (int a = 0; a < num_annotations; a++) { if (cd == null) doAnnotation(in, member, policy, false); else { Annotation annotion = doAnnotation(in, member, policy, true); cd.annotation(annotion); } } }
break process; case 1: constantUtf8(in, poolIndex); break; constantInteger(in, poolIndex); break; constantFloat(in, poolIndex); break; constantLong(in, poolIndex); poolIndex++; break; constantDouble(in, poolIndex); poolIndex++; break; constantClass(in, poolIndex); break; constantString(in, poolIndex); break; methodRef(in, poolIndex); break; nameAndType(in, poolIndex, tag);
clazz = new Clazz(relativePath, resource); clazz.parseClassFile(); in.close(); } catch (Throwable e) { String calculatedPath = clazz.getClassName() + ".class"; if (!calculatedPath.equals(relativePath)) error("Class in different directory than declared. Path from class name is " referred.putAll(clazz.getReferred()); if (t == null) uses.put(pack, t = new LinkedHashSet<String>()); t.addAll(clazz.getReferred().keySet()); t.remove(pack);
return doAnnotation(in, member, policy, collect); Object[] result = new Object[num_values]; for (int i = 0; i < num_values; i++) { result[i] = doElementValue(in, member, policy, collect);
public static ComponentDef getComponentDef(File f) throws Exception { Resource r = new FileResource(f); Clazz c = new Clazz("", r); AnnotationReader car = new AnnotationReader(c); return car.getComponent(); }
break process; case 1: constantUtf8(in, poolIndex); break; constantInteger(in, poolIndex); break; constantFloat(in, poolIndex); break; constantLong(in, poolIndex); poolIndex++; break; constantDouble(in, poolIndex); poolIndex++; break; constantClass(in, poolIndex); break; constantString(in, poolIndex); break; methodRef(in, poolIndex); break; nameAndType(in, poolIndex, tag);
clazz = new Clazz(relativePath, resource); try { } else { clazz.parseClassFile(); String calculatedPath = clazz.getClassName() + ".class"; if (!calculatedPath.equals(relativePath)) { if (!isNoBundle() && reportWrongPath) { for (String p : clazz.getReferred()) { Map<String, String> attrs = referred.get(p); if (attrs == null) { if (t == null) uses.put(pack, t = new LinkedHashSet<String>()); t.addAll(clazz.getReferred()); t.remove(pack);
return doAnnotation(in, member, policy, collect); Object[] result = new Object[num_values]; for (int i = 0; i < num_values; i++) { result[i] = doElementValue(in, member, policy, collect);
/** * Find a clazz on the class path. This class has been parsed. * * @param path * @return */ public Clazz findClass(String path) throws Exception { Clazz c = classspace.get(path); if (c != null) return c; c = importedClassesCache.get(path); if (c != null) return c; Resource r = findResource(path); if (r != null) { c = new Clazz(path, r); c.parseClassFile(); importedClassesCache.put(path, c); } return c; }
byte code[] = new byte[code_length]; in.readFully(code); crawl(code); int exception_table_length = in.readUnsignedShort(); in.skipBytes(exception_table_length * 8); doAttributes(in, ElementType.METHOD, false);
private void doAnnotations(DataInputStream in, ElementType member, RetentionPolicy policy) throws IOException { int num_annotations = in.readUnsignedShort(); // # of annotations for (int a = 0; a < num_annotations; a++) { if (cd == null) doAnnotation(in, member, policy, false); else { Annotation annotion = doAnnotation(in, member, policy, true); cd.annotation(annotion); } } }
if (key.endsWith(".class")) { InputStream in = r.openInputStream(); Clazz clazz = new Clazz(key, r); out.print(key); Set<String> xref = clazz.parseClassFile(); in.close(); for (String element : xref) {
if (key.endsWith(".class")) { InputStream in = r.openInputStream(); Clazz clazz = new Clazz(key, r); out.print(key); Set<String> xref = clazz.parseClassFile(); in.close(); for (String element : xref) {