public class Parser extends DefaultHandler implements ScanHandler, XMLReader, LexicalHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
autoDetectorProperty
Specifies the AutoDetector (for encoding detection) this Parser uses.
|
static String |
bogonsEmptyFeature
A value of "true" indicates that the parser will give unknown
elements a content model of EMPTY; a value of "false", a
content model of ANY.
|
static String |
CDATAElementsFeature
A value of "true" indicates that the parser will treat CDATA
elements specially.
|
static String |
defaultAttributesFeature
A value of "true" indicates that the parser will return default
attribute values for missing attributes that have default values.
|
static String |
externalGeneralEntitiesFeature
Reports whether this parser processes external general entities
(it doesn't).
|
static String |
externalParameterEntitiesFeature
Reports whether this parser processes external parameter entities
(it doesn't).
|
static String |
ignorableWhitespaceFeature
A value of "true" indicates that the parser will
transmit whitespace in element-only content via the SAX
ignorableWhitespace callback.
|
static String |
ignoreBogonsFeature
A value of "true" indicates that the parser will ignore
unknown elements.
|
static String |
isStandaloneFeature
May be examined only during a parse, after the startDocument()
callback has been completed; read-only.
|
static String |
lexicalHandlerParameterEntitiesFeature
A value of "true" indicates that the LexicalHandler will report
the beginning and end of parameter entities (it won't).
|
static String |
lexicalHandlerProperty
Used to see some syntax events that are essential in some
applications: comments, CDATA delimiters, selected general
entity inclusions, and the start and end of the DTD (and
declaration of document element name).
|
static String |
namespacePrefixesFeature
A value of "true" indicates that XML qualified names (with prefixes)
and attributes (including xmlns* attributes) will be available.
|
static String |
namespacesFeature
A value of "true" indicates namespace URIs and unprefixed local
names for element and attribute names will be available.
|
static String |
resolveDTDURIsFeature
A value of "true" indicates that system IDs in declarations will
be absolutized (relative to their base URIs) before reporting.
|
static String |
restartElementsFeature
A value of "true" indicates that the parser will
attempt to restart the restartable elements.
|
static String |
rootBogonsFeature
A value of "true" indicates that the parser will allow unknown
elements to be the root element.
|
static String |
scannerProperty
Specifies the Scanner object this Parser uses.
|
static String |
schemaProperty
Specifies the Schema object this Parser uses.
|
static String |
stringInterningFeature
Has a value of "true" if all XML names (for elements,
prefixes, attributes, entities, notations, and local
names), as well as Namespace URIs, will have been interned
using java.lang.String.intern.
|
static String |
translateColonsFeature
A value of "true" indicates that the parser will
translate colons into underscores in names.
|
static String |
unicodeNormalizationCheckingFeature
Controls whether the parser reports Unicode normalization
errors as described in section 2.13 and Appendix B of the XML
1.1 Recommendation.
|
static String |
useAttributes2Feature
Returns "true" if the Attributes objects passed by this
parser in ContentHandler.startElement() implement the
org.xml.sax.ext.Attributes2 interface.
|
static String |
useEntityResolver2Feature
Returns "true" if, when setEntityResolver is given an object
implementing the org.xml.sax.ext.EntityResolver2 interface,
those new methods will be used.
|
static String |
useLocator2Feature
Returns "true" if the Locator objects passed by this parser
in ContentHandler.setDocumentLocator() implement the
org.xml.sax.ext.Locator2 interface.
|
static String |
validationFeature
Controls whether the parser is reporting all validity errors
(We don't report any validity errors.)
|
static String |
XML11Feature
Returns "true" if the parser supports both XML 1.1 and XML 1.0.
|
static String |
xmlnsURIsFeature
Controls whether, when the namespace-prefixes feature is set,
the parser treats namespace declaration attributes as being in
the http://www.w3.org/2000/xmlns/ namespace.
|
| Constructor and Description |
|---|
Parser() |
| Modifier and Type | Method and Description |
|---|---|
void |
adup(char[] buff,
int offset,
int length)
Reports an attribute name without a value.
|
void |
aname(char[] buff,
int offset,
int length)
Reports an attribute name; a value will follow.
|
void |
aval(char[] buff,
int offset,
int length)
Reports an attribute value.
|
void |
cdsect(char[] buff,
int offset,
int length)
Reports the content of a CDATA section (not a CDATA element)
|
void |
cmnt(char[] buff,
int offset,
int length)
Reports a comment.
|
void |
comment(char[] ch,
int start,
int length) |
void |
decl(char[] buff,
int offset,
int length)
Parsing the complete XML Document Type Definition is way too complex,
but for many simple cases we can extract something useful from it.
|
void |
endCDATA() |
void |
endDTD() |
void |
endEntity(String name) |
void |
entity(char[] buff,
int offset,
int length)
Reports an entity reference or character reference.
|
void |
eof(char[] buff,
int offset,
int length)
Reports EOF.
|
void |
etag_basic(char[] buff,
int offset,
int length) |
boolean |
etag_cdata(char[] buff,
int offset,
int length) |
void |
etag(char[] buff,
int offset,
int length)
Reports an end-tag.
|
ContentHandler |
getContentHandler() |
DTDHandler |
getDTDHandler() |
int |
getEntity()
Returns the value of the last entity or character reference reported.
|
EntityResolver |
getEntityResolver() |
ErrorHandler |
getErrorHandler() |
boolean |
getFeature(String name) |
Object |
getProperty(String name) |
void |
gi(char[] buff,
int offset,
int length)
Reports the general identifier (element type name) of a start-tag.
|
void |
parse(InputSource input) |
void |
parse(String systemid) |
void |
pcdata(char[] buff,
int offset,
int length)
Reports character content.
|
void |
pi(char[] buff,
int offset,
int length)
Reports the data part of a processing instruction.
|
void |
pitarget(char[] buff,
int offset,
int length)
Reports the target part of a processing instruction.
|
void |
setContentHandler(ContentHandler handler) |
void |
setDTDHandler(DTDHandler handler) |
void |
setEntityResolver(EntityResolver resolver) |
void |
setErrorHandler(ErrorHandler handler) |
void |
setFeature(String name,
boolean value) |
void |
setProperty(String name,
Object value) |
void |
stagc(char[] buff,
int offset,
int length)
Reports the close of a start-tag.
|
void |
stage(char[] buff,
int offset,
int length)
Reports the close of an empty-tag.
|
void |
startCDATA() |
void |
startDTD(String name,
String publicid,
String systemid) |
void |
startEntity(String name) |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warningpublic static final String namespacesFeature
public static final String namespacePrefixesFeature
public static final String externalGeneralEntitiesFeature
public static final String externalParameterEntitiesFeature
public static final String isStandaloneFeature
public static final String lexicalHandlerParameterEntitiesFeature
public static final String resolveDTDURIsFeature
public static final String stringInterningFeature
public static final String useAttributes2Feature
public static final String useLocator2Feature
public static final String useEntityResolver2Feature
public static final String validationFeature
public static final String unicodeNormalizationCheckingFeature
public static final String xmlnsURIsFeature
public static final String XML11Feature
public static final String ignoreBogonsFeature
public static final String bogonsEmptyFeature
public static final String rootBogonsFeature
public static final String defaultAttributesFeature
public static final String translateColonsFeature
public static final String restartElementsFeature
public static final String ignorableWhitespaceFeature
public static final String CDATAElementsFeature
public static final String lexicalHandlerProperty
public static final String scannerProperty
public static final String schemaProperty
public static final String autoDetectorProperty
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature in interface XMLReaderSAXNotRecognizedExceptionSAXNotSupportedExceptionpublic void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature in interface XMLReaderSAXNotRecognizedExceptionSAXNotSupportedExceptionpublic Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty in interface XMLReaderSAXNotRecognizedExceptionSAXNotSupportedExceptionpublic void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty in interface XMLReaderSAXNotRecognizedExceptionSAXNotSupportedExceptionpublic void setEntityResolver(EntityResolver resolver)
setEntityResolver in interface XMLReaderpublic EntityResolver getEntityResolver()
getEntityResolver in interface XMLReaderpublic void setDTDHandler(DTDHandler handler)
setDTDHandler in interface XMLReaderpublic DTDHandler getDTDHandler()
getDTDHandler in interface XMLReaderpublic void setContentHandler(ContentHandler handler)
setContentHandler in interface XMLReaderpublic ContentHandler getContentHandler()
getContentHandler in interface XMLReaderpublic void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface XMLReaderpublic ErrorHandler getErrorHandler()
getErrorHandler in interface XMLReaderpublic void parse(InputSource input) throws IOException, SAXException
parse in interface XMLReaderIOExceptionSAXExceptionpublic void parse(String systemid) throws IOException, SAXException
parse in interface XMLReaderIOExceptionSAXExceptionpublic void adup(char[] buff,
int offset,
int length)
throws SAXException
ScanHandleradup in interface ScanHandlerSAXExceptionpublic void aname(char[] buff,
int offset,
int length)
throws SAXException
ScanHandleraname in interface ScanHandlerSAXExceptionpublic void aval(char[] buff,
int offset,
int length)
throws SAXException
ScanHandleraval in interface ScanHandlerSAXExceptionpublic void entity(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerentity in interface ScanHandlerSAXExceptionpublic void eof(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlereof in interface ScanHandlerSAXExceptionpublic void etag(char[] buff,
int offset,
int length)
throws SAXException
ScanHandleretag in interface ScanHandlerSAXExceptionpublic boolean etag_cdata(char[] buff,
int offset,
int length)
throws SAXException
SAXExceptionpublic void etag_basic(char[] buff,
int offset,
int length)
throws SAXException
SAXExceptionpublic void decl(char[] buff,
int offset,
int length)
throws SAXException
decl in interface ScanHandlerSAXExceptionpublic void gi(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlergi in interface ScanHandlerSAXExceptionpublic void cdsect(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlercdsect in interface ScanHandlerSAXExceptionpublic void pcdata(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerpcdata in interface ScanHandlerSAXExceptionpublic void pitarget(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerpitarget in interface ScanHandlerSAXExceptionpublic void pi(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerpi in interface ScanHandlerSAXExceptionpublic void stagc(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerstagc in interface ScanHandlerSAXExceptionpublic void stage(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlerstage in interface ScanHandlerSAXExceptionpublic void cmnt(char[] buff,
int offset,
int length)
throws SAXException
ScanHandlercmnt in interface ScanHandlerSAXExceptionpublic int getEntity()
ScanHandlergetEntity in interface ScanHandlerpublic void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void startDTD(String name, String publicid, String systemid) throws SAXException
startDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlerSAXExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved