Search in sources :

Example 16 with AttributesImpl

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);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 17 with AttributesImpl

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");
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 18 with AttributesImpl

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);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 19 with AttributesImpl

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);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 20 with AttributesImpl

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);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Aggregations

AttributesImpl (org.xml.sax.helpers.AttributesImpl)310 SAXException (org.xml.sax.SAXException)53 Test (org.junit.Test)34 DiskWriteAttributesImpl (org.apache.geode.internal.cache.DiskWriteAttributesImpl)23 PartitionAttributesImpl (org.apache.geode.internal.cache.PartitionAttributesImpl)23 ContentHandler (org.xml.sax.ContentHandler)21 Attributes (org.xml.sax.Attributes)17 PreparedStatement (java.sql.PreparedStatement)16 ResultSet (java.sql.ResultSet)16 Map (java.util.Map)16 PackOut (org.adempiere.pipo.PackOut)16 IOException (java.io.IOException)15 POSaveFailedException (org.adempiere.pipo.exception.POSaveFailedException)12 Iterator (java.util.Iterator)11 TransformerHandler (javax.xml.transform.sax.TransformerHandler)11 StreamResult (javax.xml.transform.stream.StreamResult)11 Metadata (org.apache.tika.metadata.Metadata)11 File (java.io.File)9 SAXTransformerFactory (javax.xml.transform.sax.SAXTransformerFactory)9 DatabaseAccessException (org.adempiere.pipo.exception.DatabaseAccessException)9