|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.objectweb.asm.xml.ASMContentHandler
public class ASMContentHandler
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.
SAXClassAdapter,
Processor| 嵌套类摘要 | |
|---|---|
protected class |
ASMContentHandler.Rule
Rule |
| 字段摘要 | |
|---|---|
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 ClassWriter used to write
class bytecode. |
protected Map |
labels
Map of the active Label instances for current method. |
protected OutputStream |
os
Output stream to write result bytecode. |
| 构造方法摘要 | |
|---|---|
ASMContentHandler(OutputStream os,
boolean computeMax)
Constructs a new ASMContentHandler object. |
|
| 方法摘要 | |
|---|---|
void |
endDocument()
Process notification of the end of a document and write generated bytecode into output stream. |
void |
endElement(String ns,
String lName,
String qName)
Process notification of the end of an XML element being reached. |
void |
startElement(String ns,
String lName,
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. |
| 从类 org.xml.sax.helpers.DefaultHandler 继承的方法 |
|---|
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected boolean computeMax
protected OutputStream os
protected ClassWriter cw
ClassWriter used to write
class bytecode.
protected Map labels
Label instances for current method.
| 构造方法详细信息 |
|---|
public ASMContentHandler(OutputStream os,
boolean computeMax)
ASMContentHandler object.
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 ClassWriter instance.| 方法详细信息 |
|---|
public byte[] toByteArray()
public final void startElement(String ns,
String lName,
String qName,
Attributes list)
throws SAXException
ContentHandler 中的 startElementorg.xml.sax.helpers.DefaultHandler 中的 startElementns - - 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.
SAXException - if a parsing error is to be reported
public final void endElement(String ns,
String lName,
String qName)
throws SAXException
ContentHandler 中的 endElementorg.xml.sax.helpers.DefaultHandler 中的 endElementns - - 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.
SAXException - if a parsing error is to be reported
public final void endDocument()
throws SAXException
ContentHandler 中的 endDocumentorg.xml.sax.helpers.DefaultHandler 中的 endDocumentSAXException - if parsing or writing error is to be reported.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||