public class SAXEventRecorder extends DefaultHandler implements LexicalHandler, DeclHandler, DTDHandler, Externalizable
Records SAX events such that they may be "replayed" at a later time. Provides an alternative serialization approach when externalizing a DOM4J document. Rather than serializing a document as text and re-parsing, the sax events may be serialized instead.
Example usage:SAXEventRecorder recorder = new SAXEventRecorder(); SAXWriter saxWriter = new SAXWriter(recorder, recorder); saxWriter.write(document); out.writeObject(recorder); ... SAXEventRecorder recorder = (SAXEventRecorder)in.readObject(); SAXContentHandler saxContentHandler = new SAXContentHandler(); recorder.replay(saxContentHandler); Document document = saxContentHandler.getDocument();
限定符和类型 | 字段和说明 |
---|---|
static long |
serialVersionUID |
构造器和说明 |
---|
SAXEventRecorder() |
限定符和类型 | 方法和说明 |
---|---|
void |
attributeDecl(String eName,
String aName,
String type,
String valueDefault,
String value) |
void |
characters(char[] ch,
int start,
int end) |
void |
comment(char[] ch,
int start,
int end) |
void |
elementDecl(String name,
String model) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String namespaceURI,
String localName,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
externalEntityDecl(String name,
String publicId,
String sysId) |
void |
internalEntityDecl(String name,
String value) |
void |
processingInstruction(String target,
String data) |
void |
readExternal(ObjectInput in) |
void |
replay(ContentHandler handler) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId) |
void |
startElement(String namespaceURI,
String localName,
String qualifiedName,
Attributes attributes) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
writeExternal(ObjectOutput out) |
error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notationDecl, unparsedEntityDecl
public static final long serialVersionUID
public void replay(ContentHandler handler) throws SAXException
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
在接口中 ContentHandler
processingInstruction
在类中 DefaultHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
在接口中 ContentHandler
startPrefixMapping
在类中 DefaultHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
在接口中 ContentHandler
endPrefixMapping
在类中 DefaultHandler
SAXException
public void startDocument() throws SAXException
startDocument
在接口中 ContentHandler
startDocument
在类中 DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
在接口中 ContentHandler
endDocument
在类中 DefaultHandler
SAXException
public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes attributes) throws SAXException
startElement
在接口中 ContentHandler
startElement
在类中 DefaultHandler
SAXException
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
endElement
在接口中 ContentHandler
endElement
在类中 DefaultHandler
SAXException
public void characters(char[] ch, int start, int end) throws SAXException
characters
在接口中 ContentHandler
characters
在类中 DefaultHandler
SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
在接口中 LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
在接口中 LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
在接口中 LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
在接口中 LexicalHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
在接口中 LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
在接口中 LexicalHandler
SAXException
public void comment(char[] ch, int start, int end) throws SAXException
comment
在接口中 LexicalHandler
SAXException
public void elementDecl(String name, String model) throws SAXException
elementDecl
在接口中 DeclHandler
SAXException
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException
attributeDecl
在接口中 DeclHandler
SAXException
public void internalEntityDecl(String name, String value) throws SAXException
internalEntityDecl
在接口中 DeclHandler
SAXException
public void externalEntityDecl(String name, String publicId, String sysId) throws SAXException
externalEntityDecl
在接口中 DeclHandler
SAXException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
在接口中 Externalizable
IOException
public void readExternal(ObjectInput in) throws ClassNotFoundException, IOException
readExternal
在接口中 Externalizable
ClassNotFoundException
IOException
Copyright © 2005 MetaStuff Ltd. All Rights Reserved. Hosted by