Search in sources :

Example 21 with AttributesImpl

use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.

the class SAXCodeAdapter method visitTableSwitchInsn.

public final void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "min", "min", "", Integer.toString(min));
    attrs.addAttribute("", "max", "max", "", Integer.toString(max));
    attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = AbstractVisitor.OPCODES[Opcodes.TABLESWITCH];
    addStart(o, attrs);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        addElement("label", att2);
    }
    addEnd(o);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 22 with AttributesImpl

use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.

the class SAXCodeAdapter method visitFrame.

public void visitFrame(final int type, final int nLocal, final Object[] local, final int nStack, final Object[] stack) {
    AttributesImpl attrs = new AttributesImpl();
    switch(type) {
        case Opcodes.F_NEW:
        case Opcodes.F_FULL:
            if (type == Opcodes.F_NEW) {
                attrs.addAttribute("", "type", "type", "", "NEW");
            } else {
                attrs.addAttribute("", "type", "type", "", "FULL");
            }
            addStart("frame", attrs);
            appendFrameTypes(true, nLocal, local);
            appendFrameTypes(false, nStack, stack);
            break;
        case Opcodes.F_APPEND:
            attrs.addAttribute("", "type", "type", "", "APPEND");
            addStart("frame", attrs);
            appendFrameTypes(true, nLocal, local);
            break;
        case Opcodes.F_CHOP:
            attrs.addAttribute("", "type", "type", "", "CHOP");
            attrs.addAttribute("", "count", "count", "", Integer.toString(nLocal));
            addStart("frame", attrs);
            break;
        case Opcodes.F_SAME:
            attrs.addAttribute("", "type", "type", "", "SAME");
            addStart("frame", attrs);
            break;
        case Opcodes.F_SAME1:
            attrs.addAttribute("", "type", "type", "", "SAME1");
            addStart("frame", attrs);
            appendFrameTypes(false, 1, stack);
            break;
    }
    addEnd("frame");
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 23 with AttributesImpl

use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.

the class SAXCodeAdapter method visitTryCatchBlock.

public final void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "start", "start", "", getLabel(start));
    attrs.addAttribute("", "end", "end", "", getLabel(end));
    attrs.addAttribute("", "handler", "handler", "", getLabel(handler));
    if (type != null) {
        attrs.addAttribute("", "type", "type", "", type);
    }
    addElement("TryCatch", attrs);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 24 with AttributesImpl

use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.

the class SAXCodeAdapter method visitJumpInsn.

public final void visitJumpInsn(final int opcode, final Label label) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "label", "label", "", getLabel(label));
    addElement(AbstractVisitor.OPCODES[opcode], attrs);
}
Also used : AttributesImpl(org.xml.sax.helpers.AttributesImpl)

Example 25 with AttributesImpl

use of org.xml.sax.helpers.AttributesImpl in project enclojure by EricThorsen.

the class SAXCodeAdapter method visitLabel.

public final void visitLabel(final Label label) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "name", "name", "", getLabel(label));
    addElement("Label", 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