use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXClassAdapter method visitMethod.
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
StringBuffer sb = new StringBuffer();
appendAccess(access, sb);
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "access", "access", "", sb.toString());
att.addAttribute("", "name", "name", "", name);
att.addAttribute("", "desc", "desc", "", desc);
if (signature != null) {
att.addAttribute("", "signature", "signature", "", signature);
}
addStart("method", att);
addStart("exceptions", new AttributesImpl());
if (exceptions != null && exceptions.length > 0) {
for (int i = 0; i < exceptions.length; i++) {
AttributesImpl att2 = new AttributesImpl();
att2.addAttribute("", "name", "name", "", exceptions[i]);
addElement("exception", att2);
}
}
addEnd("exceptions");
return new SAXCodeAdapter(getContentHandler(), access);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXClassAdapter method visit.
public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) {
StringBuffer sb = new StringBuffer();
appendAccess(access | ACCESS_CLASS, sb);
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "access", "access", "", sb.toString());
if (name != null) {
att.addAttribute("", "name", "name", "", name);
}
if (signature != null) {
att.addAttribute("", "signature", "signature", "", encode(signature));
}
if (superName != null) {
att.addAttribute("", "parent", "parent", "", superName);
}
att.addAttribute("", "major", "major", "", Integer.toString(version & 0xFFFF));
att.addAttribute("", "minor", "minor", "", Integer.toString(version >>> 16));
addStart("class", att);
addStart("interfaces", new AttributesImpl());
if (interfaces != null && interfaces.length > 0) {
for (int i = 0; i < interfaces.length; i++) {
AttributesImpl att2 = new AttributesImpl();
att2.addAttribute("", "name", "name", "", interfaces[i]);
addElement("interface", att2);
}
}
addEnd("interfaces");
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXClassAdapter method visitInnerClass.
public final void visitInnerClass(final String name, final String outerName, final String innerName, final int access) {
StringBuffer sb = new StringBuffer();
appendAccess(access | ACCESS_INNER, sb);
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "access", "access", "", sb.toString());
if (name != null) {
att.addAttribute("", "name", "name", "", name);
}
if (outerName != null) {
att.addAttribute("", "outerName", "outerName", "", outerName);
}
if (innerName != null) {
att.addAttribute("", "innerName", "innerName", "", innerName);
}
addElement("innerclass", att);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXClassAdapter method visitOuterClass.
public void visitOuterClass(final String owner, final String name, final String desc) {
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "owner", "owner", "", owner);
if (name != null) {
att.addAttribute("", "name", "name", "", name);
}
if (desc != null) {
att.addAttribute("", "desc", "desc", "", desc);
}
addElement("outerclass", att);
}
use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.
the class SAXCodeAdapter method visitTypeInsn.
public final void visitTypeInsn(final int opcode, final String type) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "desc", "desc", "", type);
addElement(AbstractVisitor.OPCODES[opcode], attrs);
}
Aggregations