|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fi.karppinen.gnu.xml.pipeline.DomConsumer.Handler
public static class DomConsumer.Handler
Class used to intercept various parsing events and use them to populate a DOM document. Subclasses would typically know and use backdoors into specific DOM implementations, used to implement DTD-related functionality.
Note that if this ever throws a DOMException (runtime exception) that will indicate a bug in the DOM (e.g. doesn't support something per specification) or the parser (e.g. emitted an illegal name, or accepted illegal input data).
Field Summary | |
---|---|
private AttributesImpl |
attributes
|
protected DomConsumer |
consumer
|
private String |
currentEntity
|
private Document |
document
|
private DOMImplementation |
impl
|
private boolean |
inCDATA
|
private boolean |
inDTD
|
private boolean |
isL2
|
private Locator |
locator
|
private boolean |
mergeCDATA
|
private boolean |
recreatedAttrs
|
private Node |
top
|
(package private) static String |
xmlnsURI
|
Constructor Summary | |
---|---|
protected |
DomConsumer.Handler(DomConsumer consumer)
Subclasses may use SAX2 events to provide additional behaviors in the resulting DOM. |
Method Summary | |
---|---|
void |
attributeDecl(String eName,
String aName,
String type,
String mode,
String value)
|
boolean |
canPopulateEntityRefs()
May be overridden by subclasses to return true, indicating that entity reference nodes can be populated and then made read-only. |
void |
characters(char[] ch,
int start,
int length)
|
(package private) Document |
clearDocument()
Returns and forgets the document produced. |
void |
comment(char[] ch,
int start,
int length)
|
protected Text |
createText(boolean isCDATA,
char[] ch,
int start,
int length)
Subclasses may overrride this method to provide a more efficient way to construct text nodes. |
void |
elementDecl(String name,
String model)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
void |
externalEntityDecl(String name,
String publicId,
String SystemId)
|
private void |
fatal(String message,
Exception x)
|
protected Document |
getDocument()
Returns the document under construction. |
private String |
getNamespace(String prefix,
Attributes attrs)
|
private String |
getPrefix(String name)
|
protected Node |
getTop()
Returns the current node being populated. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
internalEntityDecl(String name,
String value)
|
private void |
namespaceError(String description)
|
void |
notationDecl(String name,
String publicId,
String SystemId)
|
private void |
populateAttributes(Element element,
Attributes attrs)
|
void |
processingInstruction(String target,
String data)
|
void |
setDocumentLocator(Locator locator)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String SystemId)
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
void |
unparsedEntityDecl(String name,
String publicId,
String SystemId,
String notationName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DomConsumer consumer
private DOMImplementation impl
private Document document
private boolean isL2
private Locator locator
private Node top
private boolean inCDATA
private boolean mergeCDATA
private boolean inDTD
private String currentEntity
private boolean recreatedAttrs
private AttributesImpl attributes
static final String xmlnsURI
Constructor Detail |
---|
protected DomConsumer.Handler(DomConsumer consumer) throws SAXException
SAXException
Method Detail |
---|
private void fatal(String message, Exception x) throws SAXException
SAXException
Document clearDocument()
protected Document getDocument()
protected Node getTop()
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
protected Text createText(boolean isCDATA, char[] ch, int start, int length)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
SAXException
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
SAXException
private void populateAttributes(Element element, Attributes attrs) throws SAXParseException
SAXParseException
private String getPrefix(String name)
private String getNamespace(String prefix, Attributes attrs) throws SAXParseException
SAXParseException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void startDTD(String name, String publicId, String SystemId) throws SAXException
startDTD
in interface LexicalHandler
SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void comment(char[] ch, int start, int length) throws SAXException
comment
in interface LexicalHandler
SAXException
public boolean canPopulateEntityRefs()
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
SAXException
public void notationDecl(String name, String publicId, String SystemId) throws SAXException
notationDecl
in interface DTDHandler
SAXException
public void unparsedEntityDecl(String name, String publicId, String SystemId, String notationName) throws SAXException
unparsedEntityDecl
in interface DTDHandler
SAXException
public void elementDecl(String name, String model) throws SAXException
elementDecl
in interface DeclHandler
SAXException
public void attributeDecl(String eName, String aName, String type, String mode, String value) throws SAXException
attributeDecl
in interface DeclHandler
SAXException
public void internalEntityDecl(String name, String value) throws SAXException
internalEntityDecl
in interface DeclHandler
SAXException
public void externalEntityDecl(String name, String publicId, String SystemId) throws SAXException
externalEntityDecl
in interface DeclHandler
SAXException
private void namespaceError(String description) throws SAXParseException
SAXParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |