| java.lang.Object org.xml.sax.helpers.DefaultHandler org.zkoss.idom.input.SAXHandler
SAXHandler | public class SAXHandler extends DefaultHandler implements LexicalHandler,DeclHandler(Code) | | The SAX Hanlder.
It implements ContentHandler, LexicalHandler and DeclHandler.
It is the caller's job to set up this handler properly if required.
This class doesn't depend on SAXBuilder, so it can be used in any
other place, e.g., javax.xml.transform.sax.SAXResult.
author: tomyeh See Also: SAXBuilder |
Method Summary | |
final protected void | addToCurrentGroup(Item vtx) Adds the item to the current group; also attach the locator. | final protected void | attachLocator(Item vtx) Attaches the locator to the item. | public void | attributeDecl(String eName, String aName, String type, String valueDefault, String value) | public void | characters(char[] ch, int start, int length) | public void | comment(char[] ch, int start, int length) | protected InputSource | defaultResolveEntity(String publicId, String systemId) The default entity resolver. | public void | elementDecl(String name, String model) | public void | endCDATA() | public void | endDTD() | public void | endDocument() | public void | endElement(String nsURI, String lname, String tname) | public void | endEntity(String name) | public void | endPrefixMapping(String prefix) | public void | error(SAXParseException ex) | public void | externalEntityDecl(String name, String pubId, String sysId) | public void | fatalError(SAXParseException ex) | final public Document | getDocument() Gets the document being created. | final public EntityResolver | getEntityResolver() Gets the org.xml.sax.EntityResolver. | final public ErrorHandler | getErrorHandler() Gets the org.xml.sax.ErrorHandler. | final public IDOMFactory | getIDOMFactory() Gets the iDOM factory. | final protected Group | getTopGroup() Returns the top group, or null if not available. | public void | ignorableWhitespace(char[] ch, int start, int length) | public void | internalEntityDecl(String name, String value) | final public boolean | isCoalescing() Indicates whether or not the factory is configured to produce parsers
which converts CDATA to Text and appends it to the adjacent (if any)
Text node. | final public boolean | isExpandEntityReferences() Tests whether to expand entity reference nodes. | final public boolean | isIgnoringComments() Indicates whether or not the factory is configured to produce parsers
which ignores comments. | final public boolean | isIgnoringElementContentWhitespace() Tests whether to ignore whitespaces in element content. | public void | notationDecl(String name, String publicID, String systemID) | final protected void | popGroup() Pops out the current group, and the one under it becomes the
new current group. | public void | processingInstruction(String target, String data) | final protected void | pushGroup(Group group) Adds a new group to the current group as a child,
and pushes the new group to be the new current group. | public InputSource | resolveEntity(String publicId, String systemId) | final public void | setCoalescing(boolean coalescing) Specifies that the parser produced by this code will convert
CDATA to Text and append it to the adjacent (if any) text. | public void | setDocumentLocator(Locator locator) | final public void | setEntityResolver(org.xml.sax.EntityResolver er) Specifies the org.xml.sax.EntityResolver to be used to resolve
entities present in the XML docu-ment to be parsed. | final public void | setErrorHandler(ErrorHandler eh) Specifies the org.xml.sax.ErrorHandler to be used to report errors
present in the XML document to be parsed. | final public void | setExpandEntityReferences(boolean expand) Sets whether to expand entities during parsing.
A true means to expand entities as normal content. | final public void | setIDOMFactory(IDOMFactory factory) Sets the iDOM factory. | final public void | setIgnoringComments(boolean ignoreComments) Specifies that the parser produced by this code will ignore comments. | final public void | setIgnoringElementContentWhitespace(boolean ignore) Sets whether the parser should elminate whitespace in
element content. | public void | startCDATA() | public void | startDTD(String name, String pubId, String sysId) | public void | startDocument() | public void | startElement(String nsURI, String lname, String tname, Attributes attrs) | public void | startEntity(String name) | public void | startPrefixMapping(String prefix, String uri) | public void | unparsedEntityDecl(String name, String pubId, String sysId, String notationName) | public void | warning(SAXParseException ex) |
_declNamespaces | protected List _declNamespaces(Code) | | The namespaces in between startPrefixMapping and endPrefixMapping.
|
_inCData | protected boolean _inCData(Code) | | Indicator of whether we are in a CDATA.
|
_inDTD | protected boolean _inDTD(Code) | | Indicator of whether we are in a DTD.
|
_stack | protected Stack _stack(Code) | | The Group stack. The top one is the current group being processed.
|
SAXHandler | public SAXHandler(IDOMFactory factory)(Code) | | Constructor.
Parameters: factory - the iDOM factory; null for DefaultIDOMFactory. |
SAXHandler | public SAXHandler()(Code) | | Constructor.
|
addToCurrentGroup | final protected void addToCurrentGroup(Item vtx)(Code) | | Adds the item to the current group; also attach the locator.
|
attachLocator | final protected void attachLocator(Item vtx)(Code) | | Attaches the locator to the item.
|
characters | public void characters(char[] ch, int start, int length) throws SAXException(Code) | | |
defaultResolveEntity | protected InputSource defaultResolveEntity(String publicId, String systemId) throws SAXException(Code) | | The default entity resolver.
It is used if
SAXHandler.setEntityResolver is not called.
This implementation searches the class path under /metainfo/xml.
For example, http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
is asked.
It searches from classpath
for /metainfo/xml/java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
and /metainfo/xml/portlet-app_1_0.xsd
|
getDocument | final public Document getDocument()(Code) | | Gets the document being created.
Called to retrieve the iDOM tree after parsed.
|
getEntityResolver | final public EntityResolver getEntityResolver()(Code) | | Gets the org.xml.sax.EntityResolver.
the enity resolverr; null to use the default implementation |
getErrorHandler | final public ErrorHandler getErrorHandler()(Code) | | Gets the org.xml.sax.ErrorHandler.
the error handler; null to use the default implementation |
getIDOMFactory | final public IDOMFactory getIDOMFactory()(Code) | | Gets the iDOM factory. Null for DefaultIDOMFactory.THE.
|
getTopGroup | final protected Group getTopGroup()(Code) | | Returns the top group, or null if not available.
|
ignorableWhitespace | public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException(Code) | | |
isCoalescing | final public boolean isCoalescing()(Code) | | Indicates whether or not the factory is configured to produce parsers
which converts CDATA to Text and appends it to the adjacent (if any)
Text node.
Default: false.
true if the factory is configured to produce parsers whichconverts CDATA nodes to Text nodesand appends it to the adjacent (if any) Text node; false otherwise. |
isExpandEntityReferences | final public boolean isExpandEntityReferences()(Code) | | Tests whether to expand entity reference nodes.
|
isIgnoringComments | final public boolean isIgnoringComments()(Code) | | Indicates whether or not the factory is configured to produce parsers
which ignores comments.
Default: false.
true if the factory is configured to produce parserswhich ignores comments; false otherwise. |
isIgnoringElementContentWhitespace | final public boolean isIgnoringElementContentWhitespace()(Code) | | Tests whether to ignore whitespaces in element content.
|
popGroup | final protected void popGroup()(Code) | | Pops out the current group, and the one under it becomes the
new current group.
|
pushGroup | final protected void pushGroup(Group group)(Code) | | Adds a new group to the current group as a child,
and pushes the new group to be the new current group.
|
setCoalescing | final public void setCoalescing(boolean coalescing)(Code) | | Specifies that the parser produced by this code will convert
CDATA to Text and append it to the adjacent (if any) text.
Default: false.
|
setDocumentLocator | public void setDocumentLocator(Locator locator)(Code) | | |
setEntityResolver | final public void setEntityResolver(org.xml.sax.EntityResolver er)(Code) | | Specifies the org.xml.sax.EntityResolver to be used to resolve
entities present in the XML docu-ment to be parsed.
Default: null -- to use the default implementation and behavior.
|
setErrorHandler | final public void setErrorHandler(ErrorHandler eh)(Code) | | Specifies the org.xml.sax.ErrorHandler to be used to report errors
present in the XML document to be parsed.
Default: null -- to use the default imple-mentation and behavior.
|
setExpandEntityReferences | final public void setExpandEntityReferences(boolean expand)(Code) | | Sets whether to expand entities during parsing.
A true means to expand entities as normal content. A false means to
leave entities unexpanded as EntityReference objects.
Default: true.
Parameters: expand - whether entity expansion should occur. |
setIDOMFactory | final public void setIDOMFactory(IDOMFactory factory)(Code) | | Sets the iDOM factory. Null for DefaultIDOMFactory.THE.
|
setIgnoringComments | final public void setIgnoringComments(boolean ignoreComments)(Code) | | Specifies that the parser produced by this code will ignore comments.
Default: false.
|
setIgnoringElementContentWhitespace | final public void setIgnoringElementContentWhitespace(boolean ignore)(Code) | | Sets whether the parser should elminate whitespace in
element content. They are known as "ignorable whitespace".
Only whitespace which is contained within element content that has
an element only content model will be eliminated (see XML Rec 2.10).
For this setting to take effect requires that validation be turned on.
Default: false.
Parameters: ignore - Whether to ignore whitespaces in element content. |
Methods inherited from org.xml.sax.helpers.DefaultHandler | public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc) public void error(SAXParseException e) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc) public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)
|
|
|