public abstract class AbstractParser
extends java.lang.Object
implements org.xml.sax.XMLReader, org.xml.sax.Parser
Modifier and Type | Method and Description |
---|---|
org.xml.sax.ContentHandler |
getContentHandler() |
java.lang.String |
getDefaultEncoding()
Gets the default encoding if none is specified.
|
org.xml.sax.DTDHandler |
getDTDHandler() |
java.lang.String |
getEncoding() |
boolean |
getEntitiesAsText() |
org.xml.sax.EntityResolver |
getEntityResolver()
Sets the callback object finding files from system ids.
|
org.xml.sax.ErrorHandler |
getErrorHandler() |
boolean |
getFeature(java.lang.String name) |
boolean |
getForgiving()
Returns true if the parser is forgiving.
|
boolean |
getJsp()
Returns true if the parser should handle special JSP forgiveness.
|
java.lang.Object |
getProperty(java.lang.String name) |
boolean |
getResinInclude()
Returns true if resin:include will include other XML documents.
|
Path |
getSearchPath()
Gets the search path for included documents.
|
boolean |
getSkipComments() |
boolean |
isCoalescing()
Returns true if text and cdata nodes will be combined.
|
boolean |
isDtdValidating()
Returns true if the XML should be validated
|
boolean |
isNamespaceAware()
Returns true if the parsing is namespace aware.
|
boolean |
isNamespacePrefixes()
Returns true if the parsing uses namespace prefixes
|
boolean |
isSAXNamespaces()
Returns true if the parsing uses sax namespaces
|
boolean |
isValidating()
Returns true if the XML should be validated
|
protected java.io.InputStream |
openSource(org.xml.sax.InputSource source)
Opens the source
|
java.io.InputStream |
openStream(java.lang.String systemId,
java.lang.String publicId)
Looks up an input stream from the system id.
|
java.io.InputStream |
openStream(java.lang.String systemId,
java.lang.String publicId,
org.xml.sax.EntityResolver entityResolver)
Looks up an input stream from the system id.
|
protected java.io.InputStream |
openStream(java.lang.String systemId,
java.lang.String publicId,
org.xml.sax.EntityResolver entityResolver,
boolean isTop)
Looks up an input stream from the system id.
|
java.io.InputStream |
openTopStream(java.lang.String systemId,
java.lang.String publicId)
Looks up an input stream from the system id.
|
void |
parse(org.xml.sax.InputSource source)
SAX parsing from a SAX InputSource
|
void |
parse(java.io.InputStream is)
SAX parsing from an InputStream
|
void |
parse(java.io.InputStream is,
java.lang.String systemId)
SAX parsing from an InputStream
|
void |
parse(Path path)
SAX parsing from a VFS path
|
void |
parse(java.lang.String systemId)
SAX parsing from a file path
|
org.w3c.dom.Document |
parseDocument(org.xml.sax.InputSource source)
Parses a document from a SAX InputSource
|
org.w3c.dom.Document |
parseDocument(java.io.InputStream is)
Parses an input stream into a DOM document
|
org.w3c.dom.Document |
parseDocument(java.io.InputStream is,
java.lang.String systemId)
Parses an input stream into a DOM document
|
org.w3c.dom.Document |
parseDocument(Path path)
Parses a document from a VFS path
|
void |
parseDocument(QDocument doc,
java.io.InputStream is,
java.lang.String systemId) |
org.w3c.dom.Document |
parseDocument(java.lang.String systemId)
Parses a document from system path.
|
org.w3c.dom.Document |
parseDocumentString(java.lang.String string)
Parses a string into a DOM document
|
void |
parseImpl(java.io.InputStream is,
java.lang.String systemId)
SAX parsing from an InputStream
|
void |
parseString(java.lang.String string)
SAX parsing from a string.
|
void |
setAutodetectXml(boolean autodetectXml)
Set true if the parser should switch from HTML to XML if it detects
the <?xml ?> header.
|
void |
setCoalescing(boolean isCoalescing)
Set true if text and cdata nodes should be combined.
|
void |
setConfig(javax.xml.parsers.DocumentBuilderFactory factory)
Sets the configuration for a document builder.
|
void |
setContentHandler(org.xml.sax.ContentHandler handler) |
void |
setDefaultEncoding(java.lang.String encoding)
Sets the default encoding if none is specified.
|
void |
setDocumentHandler(org.xml.sax.DocumentHandler handler)
Configures the document handler callback.
|
void |
setDTDHandler(org.xml.sax.DTDHandler handler) |
void |
setDtdValidating(boolean isValidating)
Set true if the XML should be validated
|
void |
setEntitiesAsText(boolean entitiesAsText) |
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
Sets the callback object to find files.
|
void |
setErrorHandler(org.xml.sax.ErrorHandler handler) |
void |
setExpandEntities(boolean expandEntities) |
void |
setFeature(java.lang.String name,
boolean value) |
void |
setFilename(java.lang.String filename) |
void |
setForgiving(boolean forgiving)
Sets the parser as a forgiving parser, allowing some non-strict
XML.
|
void |
setJsp(boolean isJsp)
Sets the parser to handle special JSP forgiveness.
|
void |
setLexicalHandler(org.xml.sax.ext.LexicalHandler handler) |
void |
setLocale(java.util.Locale locale) |
void |
setNamespaceAware(boolean isNamespaceAware)
Set true if the parsing is namespace aware.
|
void |
setNamespacePrefixes(boolean isNamespaces)
Set true if the parsing uses sax namespaces
|
void |
setOwner(QDocument doc)
Sets the owner.
|
void |
setProperty(java.lang.String name,
java.lang.Object obj) |
void |
setResinInclude(boolean doResinInclude)
Enables including of other XML documents with resin:include.
|
void |
setSAXNamespaces(boolean isNamespaces)
Set true if the parsing uses sax namespaces
|
void |
setSearchPath(Path path)
Sets the search path for included documents.
|
void |
setSkipComments(boolean skipComments)
Set to true if comments should be skipped.
|
void |
setSkipWhitespace(boolean skipWhitespace)
Set to true if ignorable-whitespace should be skipped.
|
void |
setToLower(boolean toLower)
If true, normalizes HTML tags to lower case.
|
void |
setValidating(boolean isValidating)
Set true if the XML should be validated
|
public void setOwner(QDocument doc)
public java.lang.String getEncoding()
public void setFilename(java.lang.String filename)
public void setConfig(javax.xml.parsers.DocumentBuilderFactory factory)
public void setEntitiesAsText(boolean entitiesAsText)
public boolean getEntitiesAsText()
public void setExpandEntities(boolean expandEntities)
public void setSkipComments(boolean skipComments)
public void setSkipWhitespace(boolean skipWhitespace)
public boolean isCoalescing()
public void setCoalescing(boolean isCoalescing)
public boolean isValidating()
public void setValidating(boolean isValidating)
public boolean isDtdValidating()
public void setDtdValidating(boolean isValidating)
public boolean isNamespaceAware()
public void setNamespaceAware(boolean isNamespaceAware)
public boolean isSAXNamespaces()
public void setSAXNamespaces(boolean isNamespaces)
public boolean isNamespacePrefixes()
public void setNamespacePrefixes(boolean isNamespaces)
public void setToLower(boolean toLower)
public boolean getSkipComments()
public void setForgiving(boolean forgiving)
forgiving
- if true, forgives non-strict XML.public boolean getForgiving()
public void setAutodetectXml(boolean autodetectXml)
public void setJsp(boolean isJsp)
isJsp
- if true, handles special JSP forgiveness.public boolean getJsp()
public void setSearchPath(Path path)
path
- the path to searchpublic Path getSearchPath()
public void setDefaultEncoding(java.lang.String encoding)
encoding
- the default encodingpublic java.lang.String getDefaultEncoding()
public void setResinInclude(boolean doResinInclude)
doResinInclude
- if true, enables the include.public boolean getResinInclude()
doResinInclude
- if true, enables the include.public java.lang.Object getProperty(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException
getProperty
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
public void setProperty(java.lang.String name, java.lang.Object obj) throws org.xml.sax.SAXNotSupportedException
setProperty
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotSupportedException
public boolean getFeature(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException
getFeature
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotRecognizedException
public void setFeature(java.lang.String name, boolean value) throws org.xml.sax.SAXNotSupportedException
setFeature
in interface org.xml.sax.XMLReader
org.xml.sax.SAXNotSupportedException
public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver
in interface org.xml.sax.Parser
setEntityResolver
in interface org.xml.sax.XMLReader
resolver
- the object to find files.public org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver
in interface org.xml.sax.XMLReader
public void setDTDHandler(org.xml.sax.DTDHandler handler)
setDTDHandler
in interface org.xml.sax.Parser
setDTDHandler
in interface org.xml.sax.XMLReader
public org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler
in interface org.xml.sax.XMLReader
public void setContentHandler(org.xml.sax.ContentHandler handler)
setContentHandler
in interface org.xml.sax.XMLReader
public org.xml.sax.ContentHandler getContentHandler()
getContentHandler
in interface org.xml.sax.XMLReader
public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
setDocumentHandler
in interface org.xml.sax.Parser
handler
- the new document handler.public void setErrorHandler(org.xml.sax.ErrorHandler handler)
setErrorHandler
in interface org.xml.sax.Parser
setErrorHandler
in interface org.xml.sax.XMLReader
public org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler
in interface org.xml.sax.XMLReader
public void setLocale(java.util.Locale locale)
setLocale
in interface org.xml.sax.Parser
public void parse(org.xml.sax.InputSource source) throws java.io.IOException, org.xml.sax.SAXException
parse
in interface org.xml.sax.Parser
parse
in interface org.xml.sax.XMLReader
source
- source containing the XMLjava.io.IOException
org.xml.sax.SAXException
public void parse(java.io.InputStream is) throws java.io.IOException, org.xml.sax.SAXException
is
- stream containing the XMLjava.io.IOException
org.xml.sax.SAXException
public void parse(java.io.InputStream is, java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
is
- stream containing the XMLjava.io.IOException
org.xml.sax.SAXException
public void parseImpl(java.io.InputStream is, java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
is
- stream containing the XMLjava.io.IOException
org.xml.sax.SAXException
public void parse(java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
parse
in interface org.xml.sax.Parser
parse
in interface org.xml.sax.XMLReader
systemId
- path to the file containing the XMLjava.io.IOException
org.xml.sax.SAXException
public void parse(Path path) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void parseString(java.lang.String string) throws java.io.IOException, org.xml.sax.SAXException
string
- string containing the XMLjava.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocument(org.xml.sax.InputSource source) throws java.io.IOException, org.xml.sax.SAXException
source
- SAX InputSource containing the XML data.java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocument(java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
systemId
- path to the XML data.java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocument(Path path) throws java.io.IOException, org.xml.sax.SAXException
path
- the VFS path containing the XML document.java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocument(java.io.InputStream is) throws java.io.IOException, org.xml.sax.SAXException
is
- the input stream containing the XMLjava.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocument(java.io.InputStream is, java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
is
- the input stream containing the XMLsystemId
- the URL of the stream.java.io.IOException
org.xml.sax.SAXException
public void parseDocument(QDocument doc, java.io.InputStream is, java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public org.w3c.dom.Document parseDocumentString(java.lang.String string) throws java.io.IOException, org.xml.sax.SAXException
string
- the string containing the XMLjava.io.IOException
org.xml.sax.SAXException
public java.io.InputStream openStream(java.lang.String systemId, java.lang.String publicId) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.io.InputStream openTopStream(java.lang.String systemId, java.lang.String publicId) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.io.InputStream openStream(java.lang.String systemId, java.lang.String publicId, org.xml.sax.EntityResolver entityResolver) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
protected java.io.InputStream openStream(java.lang.String systemId, java.lang.String publicId, org.xml.sax.EntityResolver entityResolver, boolean isTop) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
protected java.io.InputStream openSource(org.xml.sax.InputSource source) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException