|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cyberneko.html.parsers.DOMFragmentParser
A DOM parser for HTML fragments.
Field Summary | |
protected static String |
CURRENT_ELEMENT_NODE
Current element node. |
protected static String |
DOCUMENT_FRAGMENT
Document fragment balancing only. |
protected static String |
ERROR_HANDLER
Property identifier: error handler. |
protected Node |
fCurrentNode
Current node. |
protected Document |
fDocument
Document. |
protected DocumentFragment |
fDocumentFragment
DOM document fragment. |
protected XMLDocumentSource |
fDocumentSource
Document source. |
protected boolean |
fInCDATASection
True if within a CDATA section. |
protected XMLParserConfiguration |
fParserConfiguration
Parser configuration. |
protected static String[] |
RECOGNIZED_FEATURES
Recognized features. |
protected static String[] |
RECOGNIZED_PROPERTIES
Recognized properties. |
Constructor Summary | |
DOMFragmentParser()
Default constructor. |
Method Summary | |
void |
characters(XMLString text,
Augmentations augs)
Characters. |
void |
comment(XMLString text,
Augmentations augs)
Comment. |
void |
doctypeDecl(String root,
String pubid,
String sysid,
Augmentations augs)
Document type declaration. |
void |
emptyElement(QName element,
XMLAttributes attrs,
Augmentations augs)
Empty element. |
void |
endCDATA(Augmentations augs)
End CDATA section. |
void |
endDocument(Augmentations augs)
End document. |
void |
endElement(QName element,
Augmentations augs)
End element. |
void |
endGeneralEntity(String name,
Augmentations augs)
End general entity. |
void |
endPrefixMapping(String prefix,
Augmentations augs)
End prefix mapping. |
XMLDocumentSource |
getDocumentSource()
Returns the document source. |
ErrorHandler |
getErrorHandler()
Return the current error handler. |
boolean |
getFeature(String featureId)
Query the state of a feature. |
Object |
getProperty(String propertyId)
Query the value of a property. |
void |
ignorableWhitespace(XMLString text,
Augmentations augs)
Ignorable whitespace. |
void |
parse(InputSource source,
DocumentFragment fragment)
Parses a document fragment. |
void |
parse(String systemId,
DocumentFragment fragment)
Parses a document fragment. |
void |
processingInstruction(String target,
XMLString data,
Augmentations augs)
Processing instruction. |
void |
setDocumentSource(XMLDocumentSource source)
Sets the document source. |
void |
setErrorHandler(ErrorHandler errorHandler)
Allow an application to register an error event handler. |
void |
setFeature(String featureId,
boolean state)
Set the state of any feature in a SAX2 parser. |
void |
setProperty(String propertyId,
Object value)
Set the value of any property in a SAX2 parser. |
void |
startCDATA(Augmentations augs)
Start CDATA section. |
void |
startDocument(XMLLocator locator,
String encoding,
Augmentations augs)
Start document. |
void |
startDocument(XMLLocator locator,
String encoding,
NamespaceContext nscontext,
Augmentations augs)
Start document. |
void |
startElement(QName element,
XMLAttributes attrs,
Augmentations augs)
Start element. |
void |
startGeneralEntity(String name,
XMLResourceIdentifier id,
String encoding,
Augmentations augs)
Start general entity. |
void |
startPrefixMapping(String prefix,
String uri,
Augmentations augs)
Start prefix mapping. |
void |
textDecl(String version,
String encoding,
Augmentations augs)
Text declaration. |
void |
xmlDecl(String version,
String encoding,
String standalone,
Augmentations augs)
XML declaration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String DOCUMENT_FRAGMENT
protected static final String[] RECOGNIZED_FEATURES
protected static final String ERROR_HANDLER
protected static final String CURRENT_ELEMENT_NODE
protected static final String[] RECOGNIZED_PROPERTIES
protected XMLParserConfiguration fParserConfiguration
protected XMLDocumentSource fDocumentSource
protected DocumentFragment fDocumentFragment
protected Document fDocument
protected Node fCurrentNode
protected boolean fInCDATASection
Constructor Detail |
public DOMFragmentParser()
Method Detail |
public void parse(String systemId, DocumentFragment fragment) throws SAXException, IOException
SAXException
IOException
public void parse(InputSource source, DocumentFragment fragment) throws SAXException, IOException
SAXException
IOException
public void setErrorHandler(ErrorHandler errorHandler)
If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
errorHandler
- The error handler.
NullPointerException
- If the handler
argument is null.getErrorHandler()
public ErrorHandler getErrorHandler()
setErrorHandler(org.xml.sax.ErrorHandler)
public void setFeature(String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature.state
- The requested state of the feature (true or false).
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
- If the
requested feature is known, but the requested
state is not supported.public boolean getFeature(String featureId) throws SAXNotRecognizedException, SAXNotSupportedException
featureId
- The unique identifier (URI) of the feature
being set.
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
- If the
requested feature is known but not supported.public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.value
- The value to which the property is being set.
SAXNotRecognizedException
- If the
requested property is not known.
SAXNotSupportedException
- If the
requested property is known, but the requested
value is not supported.public Object getProperty(String propertyId) throws SAXNotRecognizedException, SAXNotSupportedException
propertyId
- The unique identifier (URI) of the property
being set.
SAXNotRecognizedException
- If the
requested property is not known.
SAXNotSupportedException
- If the
requested property is known but not supported.public void setDocumentSource(XMLDocumentSource source)
setDocumentSource
in interface XMLDocumentHandler
public XMLDocumentSource getDocumentSource()
getDocumentSource
in interface XMLDocumentHandler
public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException
XNIException
public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException
startDocument
in interface XMLDocumentHandler
XNIException
public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException
xmlDecl
in interface XMLDocumentHandler
XNIException
public void doctypeDecl(String root, String pubid, String sysid, Augmentations augs) throws XNIException
doctypeDecl
in interface XMLDocumentHandler
XNIException
public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException
processingInstruction
in interface XMLDocumentHandler
XNIException
public void comment(XMLString text, Augmentations augs) throws XNIException
comment
in interface XMLDocumentHandler
XNIException
public void startPrefixMapping(String prefix, String uri, Augmentations augs) throws XNIException
XNIException
public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException
XNIException
public void startElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException
startElement
in interface XMLDocumentHandler
XNIException
public void emptyElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException
emptyElement
in interface XMLDocumentHandler
XNIException
public void characters(XMLString text, Augmentations augs) throws XNIException
characters
in interface XMLDocumentHandler
XNIException
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException
ignorableWhitespace
in interface XMLDocumentHandler
XNIException
public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) throws XNIException
startGeneralEntity
in interface XMLDocumentHandler
XNIException
public void textDecl(String version, String encoding, Augmentations augs) throws XNIException
textDecl
in interface XMLDocumentHandler
XNIException
public void endGeneralEntity(String name, Augmentations augs) throws XNIException
endGeneralEntity
in interface XMLDocumentHandler
XNIException
public void startCDATA(Augmentations augs) throws XNIException
startCDATA
in interface XMLDocumentHandler
XNIException
public void endCDATA(Augmentations augs) throws XNIException
endCDATA
in interface XMLDocumentHandler
XNIException
public void endElement(QName element, Augmentations augs) throws XNIException
endElement
in interface XMLDocumentHandler
XNIException
public void endDocument(Augmentations augs) throws XNIException
endDocument
in interface XMLDocumentHandler
XNIException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |