Class ASMContentHandler

  • All Implemented Interfaces:
    Opcodes, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class ASMContentHandler
    extends org.xml.sax.helpers.DefaultHandler
    implements Opcodes
    A ContentHandler that transforms XML document into Java class file. This class can be feeded by any kind of SAX 2.0 event producers, e.g. XML parser, XSLT or XPath engines, or custom code.
    Author:
    Eugene Kuleshov
    See Also:
    SAXClassAdapter, Processor
    • Field Detail

      • labels

        protected java.util.Map<java.lang.Object,​Label> labels
        Map of the active Label instances for current method.
    • Constructor Detail

      • ASMContentHandler

        public ASMContentHandler​(ClassVisitor cv)
        Constructs a new ASMContentHandler object.
        Parameters:
        cv - class visitor that will be called to reconstruct the classfile using the XML stream.
    • Method Detail

      • startElement

        public final void startElement​(java.lang.String ns,
                                       java.lang.String lName,
                                       java.lang.String qName,
                                       org.xml.sax.Attributes list)
                                throws org.xml.sax.SAXException
        Process notification of the start of an XML element being reached.
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ns - - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        lName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        qName - - The qualified name (with prefix), or the empty string if qualified names are not available.
        list - - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
        Throws:
        org.xml.sax.SAXException - if a parsing error is to be reported
      • endElement

        public final void endElement​(java.lang.String ns,
                                     java.lang.String lName,
                                     java.lang.String qName)
                              throws org.xml.sax.SAXException
        Process notification of the end of an XML element being reached.
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class org.xml.sax.helpers.DefaultHandler
        Parameters:
        ns - - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
        lName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
        qName - - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.
        Throws:
        org.xml.sax.SAXException - if a parsing error is to be reported