|
org.netbeans.api.xml/1 1.14 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.api.xml.parsers.SAXEntityParser
SAX parser wrapper allowing to parse parsed XML entities (including DTDs) for wellformedness.
Default implementation cannot be used for parsing of XML document entities! It wraps client's parser that it actually used for performing the parsing task.
Primary use case (parse general entity):
XMLReader entityParser = new SAXEntityParser(xmlReader); entityParser.setErrorHandler(errorHandler); entityParser.parse(inputSource);Secondary use case (delegating parser): It requires subclassing and allow subclass entirely define internal wrapping logic. Warning: Implementation gurantees only proper ErrorHandler callbacks.
| Constructor Summary | |
|---|---|
SAXEntityParser(XMLReader peer)
Creates a new instance of general entity parser. |
|
SAXEntityParser(XMLReader peer,
boolean generalEntity)
Creates a new instance of SAXEntityParser. |
|
| Method Summary | |
|---|---|
ContentHandler |
getContentHandler()
|
DTDHandler |
getDTDHandler()
|
EntityResolver |
getEntityResolver()
|
ErrorHandler |
getErrorHandler()
|
boolean |
getFeature(String name)
|
Object |
getProperty(String name)
|
void |
parse(InputSource entity)
Start entity parsing using peer parser. |
void |
parse(String sid)
|
protected boolean |
propagateException(SAXParseException ex)
Examine if the exception should be propagated into client's ErrorHandler. |
void |
setContentHandler(ContentHandler contentHandler)
|
void |
setDTDHandler(DTDHandler dTDHandler)
|
void |
setEntityResolver(EntityResolver entityResolver)
|
void |
setErrorHandler(ErrorHandler errorHandler)
|
void |
setFeature(String name,
boolean val)
|
void |
setProperty(String name,
Object val)
|
protected InputSource |
wrapInputSource(InputSource input)
Create wrapper input source. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SAXEntityParser(XMLReader peer)
peer - parser that will be used for parsing. Wrapped parser is
exclusively owned by this class no other clients can share it.public SAXEntityParser(XMLReader peer, boolean generalEntity)
peer - parser that will be used for parsinggeneralEntity - if false treat entity as parameter
entity (i.e. DTD entities).| Method Detail |
|---|
public void parse(InputSource entity) throws IOException, SAXException
entity - entity input source
IOException
SAXExceptionprotected InputSource wrapInputSource(InputSource input)
EntityResolver redirects the first query to wrapped
InputSource.
input - InputSource to be wrapped.
protected boolean propagateException(SAXParseException ex)
ErrorHandler.
ex - examined exception
true if the exception originates from client's
InputSource and should be propagated.public ContentHandler getContentHandler()
getContentHandler in interface XMLReaderpublic DTDHandler getDTDHandler()
getDTDHandler in interface XMLReaderpublic EntityResolver getEntityResolver()
getEntityResolver in interface XMLReaderpublic ErrorHandler getErrorHandler()
getErrorHandler in interface XMLReaderpublic boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature in interface XMLReaderpublic Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty in interface XMLReaderpublic void parse(String sid) throws IOException, SAXException
IOException
SAXExceptionpublic void setContentHandler(ContentHandler contentHandler)
setContentHandler in interface XMLReaderpublic void setDTDHandler(DTDHandler dTDHandler)
setDTDHandler in interface XMLReaderpublic void setEntityResolver(EntityResolver entityResolver)
setEntityResolver in interface XMLReaderpublic void setErrorHandler(ErrorHandler errorHandler)
setErrorHandler in interface XMLReaderpublic void setFeature(String name, boolean val) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature in interface XMLReaderpublic void setProperty(String name, Object val) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty in interface XMLReader
|
org.netbeans.api.xml/1 1.14 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||