org.objectweb.asm.xml
public class ASMContentHandler extends DefaultHandler implements Opcodes
See Also: SAXClassAdapter
Nested Class Summary | |
---|---|
protected abstract class | ASMContentHandler.Rule
Rule |
Field Summary | |
---|---|
protected boolean | computeMax
true if the maximum stack size and number of local variables
must be automatically computed. |
protected ClassWriter | cw
Current instance of the {@link ClassWriter ClassWriter} used to write
class bytecode. |
protected Map | labels
Map of the active {@link Label Label} instances for current method. |
protected OutputStream | os
Output stream to write result bytecode. |
Constructor Summary | |
---|---|
ASMContentHandler(OutputStream os, boolean computeMax)
Constructs a new {@link ASMContentHandler ASMContentHandler} object.
|
Method Summary | |
---|---|
void | endDocument()
Process notification of the end of a document and write generated
bytecode into output stream.
|
void | endElement(String ns, String localName, String qName)
Process notification of the end of an XML element being reached.
|
void | startElement(String ns, String localName, String qName, Attributes list)
Process notification of the start of an XML element being reached.
|
byte[] | toByteArray()
Returns the bytecode of the class that was build with underneath class
writer.
|
Parameters: os output stream to write generated class. computeMax true if the maximum stack size and the maximum number of local variables must be automatically computed. This value is passed to {@link ClassWriter ClassWriter} instance.
Throws: SAXException if parsing or writing error is to be reported.
Parameters: ns - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. localName - 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: SAXException if a parsing error is to be reported
Parameters: ns - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. localName - 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: SAXException if a parsing error is to be reported
Returns: the bytecode of the class that was build with underneath class writer or null if there are no classwriter created.