| |
|
| java.lang.Object org.netbeans.api.xml.parsers.SAXEntityParser
SAXEntityParser | public class SAXEntityParser implements XMLReader(Code) | | 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.
author: Petr Kuzel |
Constructor Summary | |
public | SAXEntityParser(XMLReader peer) Creates a new instance of general entity parser.
Parameters: peer - parser that will be used for parsing. | public | SAXEntityParser(XMLReader peer, boolean generalEntity) Creates a new instance of SAXEntityParser.
Parameters: peer - parser that will be used for parsing Parameters: generalEntity - if false treat entity as parameterentity (i.e. |
SAXEntityParser | public SAXEntityParser(XMLReader peer)(Code) | | Creates a new instance of general entity parser.
Parameters: peer - parser that will be used for parsing. Wrapped parser is exclusively owned by this class no other clients can share it. |
SAXEntityParser | public SAXEntityParser(XMLReader peer, boolean generalEntity)(Code) | | Creates a new instance of SAXEntityParser.
Parameters: peer - parser that will be used for parsing Parameters: generalEntity - if false treat entity as parameterentity (i.e. DTD entities). |
parse | public void parse(InputSource entity) throws IOException, SAXException(Code) | | Start entity parsing using peer parser. Staring from this moment
all other methods calls are not supported.
Parameters: entity - entity input source |
propagateException | protected boolean propagateException(SAXParseException ex)(Code) | | Examine if the exception should be propagated into client's ErrorHandler .
Parameters: ex - examined exception true if the exception originates from client'sInputSource and should be propagated. |
wrapInputSource | protected InputSource wrapInputSource(InputSource input)(Code) | | Create wrapper input source. Default implementation utilizes fact that
default EntityResolver redirects the first query to wrapped
InputSource .
Parameters: input - InputSource to be wrapped. InputSource that hosts of client's one since: 0.6 |
|
|
|