|
Xerces 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.framework.XMLParser | +--org.apache.xerces.parsers.SAXParser
SAXParser provides a parser which implements the SAX1 and SAX2 parser APIs.
Nested Class Summary |
Nested classes inherited from class org.apache.xerces.framework.XMLDocumentHandler |
XMLDocumentHandler.DTDHandler |
Field Summary |
Fields inherited from class org.apache.xerces.framework.XMLParser |
fEntityHandler, fErrorReporter, fGrammarResolver, fParseInProgress, fScanner, fStringPool, fValidator, SAX2_FEATURES_PREFIX, SAX2_PROPERTIES_PREFIX, XERCES_FEATURES_PREFIX, XERCES_PROPERTIES_PREFIX |
Fields inherited from interface org.apache.xerces.framework.XMLErrorReporter |
ERRORTYPE_FATAL_ERROR, ERRORTYPE_RECOVERABLE_ERROR, ERRORTYPE_WARNING |
Constructor Summary | |
|
SAXParser()
Default constructor. |
protected |
SAXParser(org.apache.xerces.utils.StringPool stringPool)
|
Method Summary | |
void |
attlistDecl(org.apache.xerces.utils.QName elementDecl,
org.apache.xerces.utils.QName attributeDecl,
int attType,
boolean attList,
java.lang.String enumString,
int attDefaultType,
int attDefaultValue)
Report an attribute type declaration. |
void |
characters(char[] ch,
int start,
int length)
Characters. |
void |
characters(int dataIndex)
Not called. |
void |
comment(int dataIndex)
Comment. |
void |
elementDecl(org.apache.xerces.utils.QName elementDecl,
int contentSpecType,
int contentSpecIndex,
XMLContentSpec.Provider contentSpecProvider)
Report an element type declaration. |
void |
endCDATA()
End CDATA section. |
void |
endDocument()
End document. |
void |
endDTD()
This function will be called at the end of the DTD. |
void |
endElement(org.apache.xerces.utils.QName element)
End element. |
void |
endEntityReference(int entityName,
int entityType,
int entityContext)
End entity reference. |
void |
endNamespaceDeclScope(int prefix)
Report the end of the scope of a namespace declaration. |
void |
externalEntityDecl(int entityName,
int publicId,
int systemId)
Report a parsed external general entity declaration. |
void |
externalPEDecl(int entityName,
int publicId,
int systemId)
Report a parsed external parameter entity declaration. |
ContentHandler |
getContentHandler()
Return the current content handler. |
protected DeclHandler |
getDeclHandler()
Returns the DTD declaration event handler. |
DTDHandler |
getDTDHandler()
Return the current DTD handler. |
boolean |
getFeature(java.lang.String featureId)
Query the state of a feature. |
java.lang.String[] |
getFeaturesRecognized()
Returns a list of features that this parser recognizes. |
protected LexicalHandler |
getLexicalHandler()
Returns the lexical handler. |
protected boolean |
getNamespacePrefixes()
Returns the http://xml.org/features/namespace-prefixes value. |
java.lang.String[] |
getPropertiesRecognized()
Returns a list of properties that this parser recognizes. |
java.lang.Object |
getProperty(java.lang.String propertyId)
Query the value of a property. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Ignorable whitespace. |
void |
ignorableWhitespace(int dataIndex)
Not called. |
void |
internalEntityDecl(int entityName,
int entityValue)
Report an internal general entity declaration. |
void |
internalPEDecl(int entityName,
int entityValue)
Report an internal parameter entity declaration. |
void |
internalSubset(int internalSubset)
New callback from DOM Level 2. |
void |
notationDecl(int notationName,
int publicId,
int systemId)
Receive notification of a notation declaration event. |
void |
processingInstruction(int piTarget,
int piData)
Processing instruction. |
void |
setContentHandler(ContentHandler handler)
Allow an application to register a content event handler. |
protected void |
setDeclHandler(DeclHandler handler)
Set the DTD declaration event handler. |
void |
setDocumentHandler(DocumentHandler handler)
Sets the document handler. |
void |
setDTDHandler(DTDHandler handler)
Allow an application to register a DTD event handler. |
void |
setFeature(java.lang.String featureId,
boolean state)
Set the state of any feature in a SAX2 parser. |
protected void |
setLexicalHandler(LexicalHandler handler)
Set the lexical event handler. |
protected void |
setNamespacePrefixes(boolean process)
Sets how the parser reports raw prefixed names, and whether xmlns attributes are reported. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Set the value of any property in a SAX2 parser. |
void |
startCDATA()
Start CDATA section. |
void |
startDocument()
Start document. |
void |
startDTD(org.apache.xerces.utils.QName rootElement,
int publicId,
int systemId)
This function will be called when a <! |
void |
startElement(org.apache.xerces.utils.QName element,
XMLAttrList attrList,
int attrListIndex)
Start element |
void |
startEntityReference(int entityName,
int entityType,
int entityContext)
Start entity reference. |
void |
startNamespaceDeclScope(int prefix,
int uri)
Report the start of the scope of a namespace declaration. |
void |
textDecl(int versionIndex,
int encodingIndex)
Text declaration. |
void |
unparsedEntityDecl(int entityName,
int publicId,
int systemId,
int notationName)
Receive notification of an unparsed entity declaration event. |
void |
xmlDecl(int versionIndex,
int encodingIndex,
int standaloneIndex)
XML declaration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.Parser |
parse, parse, setEntityResolver, setErrorHandler, setLocale |
Methods inherited from interface org.xml.sax.XMLReader |
getEntityResolver, getErrorHandler, parse, parse, setEntityResolver, setErrorHandler |
Constructor Detail |
public SAXParser()
protected SAXParser(org.apache.xerces.utils.StringPool stringPool)
Method Detail |
public java.lang.String[] getFeaturesRecognized()
getFeaturesRecognized
in class XMLParser
XMLParser.isFeatureRecognized(java.lang.String)
,
setFeature(java.lang.String, boolean)
,
getFeature(java.lang.String)
public java.lang.String[] getPropertiesRecognized()
getPropertiesRecognized
in class XMLParser
XMLParser.isPropertyRecognized(java.lang.String)
,
setProperty(java.lang.String, java.lang.Object)
,
getProperty(java.lang.String)
protected void setDeclHandler(DeclHandler handler) throws SAXNotRecognizedException, SAXNotSupportedException
This method is the equivalent to the property:
http://xml.org/sax/properties/declaration-handler
handler
- The new handler.
SAXNotRecognizedException
SAXNotSupportedException
getDeclHandler()
,
setProperty(java.lang.String, java.lang.Object)
protected DeclHandler getDeclHandler() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setDeclHandler(org.xml.sax.ext.DeclHandler)
protected void setLexicalHandler(LexicalHandler handler) throws SAXNotRecognizedException, SAXNotSupportedException
This method is the equivalent to the property:
http://xml.org/sax/properties/lexical-handler
handler
- lexical event handler
SAXNotRecognizedException
SAXNotSupportedException
getLexicalHandler()
,
setProperty(java.lang.String, java.lang.Object)
protected LexicalHandler getLexicalHandler() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setLexicalHandler(org.xml.sax.ext.LexicalHandler)
public void setDocumentHandler(DocumentHandler handler)
setDocumentHandler
in interface Parser
handler
- The document handler.DocumentHandler
,
HandlerBase
public void setDTDHandler(DTDHandler handler)
If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
setDTDHandler
in interface Parser
handler
- The DTD handler.
java.lang.NullPointerException
- If the handler
argument is null.getDTDHandler()
public DTDHandler getDTDHandler()
getDTDHandler
in interface XMLReader
setDTDHandler(org.xml.sax.DTDHandler)
protected void setNamespacePrefixes(boolean process) throws SAXNotRecognizedException, SAXNotSupportedException
This method is the equivalent to the feature:
http://xml.org/sax/features/namespaces-prefixes
process
- True to process namespaces; false to not process.
SAXNotRecognizedException
SAXNotSupportedException
XMLParser.getNamespaces()
,
setFeature(java.lang.String, boolean)
protected boolean getNamespacePrefixes() throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
setNamespacePrefixes(boolean)
public void setFeature(java.lang.String featureId, boolean state) throws SAXNotRecognizedException, SAXNotSupportedException
setFeature
in interface XMLReader
setFeature
in class XMLParser
featureId
- The unique identifier (URI) of the feature.state
- The requested state of the feature (true or false).
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
- If the
requested feature is known, but the requested
state is not supported.
SAXNotSupportedException
- When the
XMLReader recognizes the feature name but
cannot set the requested value.
SAXNotRecognizedException
- When the
XMLReader does not recognize the feature name.XMLReader.getFeature(java.lang.String)
public boolean getFeature(java.lang.String featureId) throws SAXNotRecognizedException, SAXNotSupportedException
getFeature
in interface XMLReader
getFeature
in class XMLParser
featureId
- The unique identifier (URI) of the feature
being set.
SAXNotRecognizedException
- If the
requested feature is not known.
SAXNotSupportedException
- If the
requested feature is known but not supported.
SAXNotSupportedException
- When the
XMLReader recognizes the feature name but
cannot determine its value at this time.XMLReader.setFeature(java.lang.String, boolean)
public void setProperty(java.lang.String propertyId, java.lang.Object value) throws SAXNotRecognizedException, SAXNotSupportedException
setProperty
in interface XMLReader
setProperty
in class XMLParser
propertyId
- The unique identifier (URI) of the property
being set.
SAXNotRecognizedException
- If the
requested property is not known.
SAXNotSupportedException
- If the
requested property is known, but the requested
value is not supported.
SAXNotSupportedException
- When the
XMLReader recognizes the property name but
cannot set the requested value.
SAXNotRecognizedException
- When the
XMLReader does not recognize the property name.public java.lang.Object getProperty(java.lang.String propertyId) throws SAXNotRecognizedException, SAXNotSupportedException
getProperty
in interface XMLReader
getProperty
in class XMLParser
propertyId
- The unique identifier (URI) of the property
being set.
SAXNotRecognizedException
- If the
requested property is not known.
SAXNotSupportedException
- If the
requested property is known but not supported.
SAXNotSupportedException
- When the
XMLReader recognizes the property name but
cannot determine its value at this time.XMLReader.setProperty(java.lang.String, java.lang.Object)
public void setContentHandler(ContentHandler handler)
If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
setContentHandler
in interface XMLReader
handler
- The content handler.
java.lang.NullPointerException
- If the handler
argument is null.getContentHandler()
public ContentHandler getContentHandler()
getContentHandler
in interface XMLReader
setContentHandler(org.xml.sax.ContentHandler)
public void startDTD(org.apache.xerces.utils.QName rootElement, int publicId, int systemId) throws java.lang.Exception
startDTD
in interface XMLDocumentHandler.DTDHandler
publicId
- string pool index of the DTD's public IDsystemId
- string pool index of the DTD's system ID
java.lang.Exception
public void endDTD() throws java.lang.Exception
endDTD
in interface XMLDocumentHandler.DTDHandler
java.lang.Exception
public void elementDecl(org.apache.xerces.utils.QName elementDecl, int contentSpecType, int contentSpecIndex, XMLContentSpec.Provider contentSpecProvider) throws java.lang.Exception
elementDecl
in interface XMLDocumentHandler.DTDHandler
SAXException
- The application may raise an exception.
java.lang.Exception
XMLContentSpec
public void attlistDecl(org.apache.xerces.utils.QName elementDecl, org.apache.xerces.utils.QName attributeDecl, int attType, boolean attList, java.lang.String enumString, int attDefaultType, int attDefaultValue) throws java.lang.Exception
attlistDecl
in interface XMLDocumentHandler.DTDHandler
attType
- type of attributeenumString
- String representing the values of the enumeration,
if the attribute is of enumerated type, or null if it is not.attDefaultType
- an integer value denoting the DefaultDecl valueattDefaultValue
- string pool index of this attribute's default value
or -1 if there is no defaultvalue
SAXException
- The application may raise an exception.
java.lang.Exception
public void internalPEDecl(int entityName, int entityValue) throws java.lang.Exception
internalPEDecl
in interface XMLDocumentHandler.DTDHandler
entityName
- string pool index of the entity nameentityValue
- string pool index of the entity replacement text
java.lang.Exception
public void externalPEDecl(int entityName, int publicId, int systemId) throws java.lang.Exception
externalPEDecl
in interface XMLDocumentHandler.DTDHandler
entityName
- string pool index of the entity namepublicId
- string pool index of the entity's public id.systemId
- string pool index of the entity's system id.
java.lang.Exception
public void internalEntityDecl(int entityName, int entityValue) throws java.lang.Exception
internalEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityName
- string pool index of the entity nameentityValue
- string pool index of the entity replacement text
java.lang.Exception
public void externalEntityDecl(int entityName, int publicId, int systemId) throws java.lang.Exception
externalEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityName
- string pool index of the entity namepublicId
- string pool index of the entity's public id.systemId
- string pool index of the entity's system id.
java.lang.Exception
public void unparsedEntityDecl(int entityName, int publicId, int systemId, int notationName) throws java.lang.Exception
unparsedEntityDecl
in interface XMLDocumentHandler.DTDHandler
entityName
- string pool index of the entity namepublicId
- string pool index of the entity's public id.systemId
- string pool index of the entity's system id.notationName
- string pool index of the notation name.
java.lang.Exception
public void notationDecl(int notationName, int publicId, int systemId) throws java.lang.Exception
notationDecl
in interface XMLDocumentHandler.DTDHandler
notationName
- string pool index of the notation namepublicId
- string pool index of the notation's public id.systemId
- string pool index of the notation's system id.
java.lang.Exception
public void startDocument() throws java.lang.Exception
startDocument
in interface XMLDocumentHandler
java.lang.Exception
public void endDocument() throws java.lang.Exception
endDocument
in interface XMLDocumentHandler
java.lang.Exception
public void xmlDecl(int versionIndex, int encodingIndex, int standaloneIndex) throws java.lang.Exception
xmlDecl
in interface XMLDocumentHandler
versionIndex
- the handle in the string pool for the version numberencodingIndex
- the handle in the string pool for the encoding
java.lang.Exception
public void textDecl(int versionIndex, int encodingIndex) throws java.lang.Exception
textDecl
in interface XMLDocumentHandler
java.lang.Exception
public void startNamespaceDeclScope(int prefix, int uri) throws java.lang.Exception
startNamespaceDeclScope
in interface XMLDocumentHandler
prefix
- string pool index of the namespace prefix being declareduri
- string pool index of the namespace uri begin bound
java.lang.Exception
public void endNamespaceDeclScope(int prefix) throws java.lang.Exception
endNamespaceDeclScope
in interface XMLDocumentHandler
prefix
- string pool index of the namespace prefix being declared
java.lang.Exception
public void internalSubset(int internalSubset)
internalSubset
in interface XMLDocumentHandler.DTDHandler
public void startElement(org.apache.xerces.utils.QName element, XMLAttrList attrList, int attrListIndex) throws java.lang.Exception
startElement
in interface XMLDocumentHandler
attrList
- attrList containing the attributes of the elementattrListIndex
- handle into attrList. Allows attributes to be retreived.
java.lang.Exception
public void endElement(org.apache.xerces.utils.QName element) throws java.lang.Exception
endElement
in interface XMLDocumentHandler
java.lang.Exception
public void startEntityReference(int entityName, int entityType, int entityContext) throws java.lang.Exception
startEntityReference
in interface XMLDocumentHandler
entityName
- string pool index of the entity nameentityType
- the XMLEntityHandler.ENTITYTYPE_* typeentityContext
- the XMLEntityHandler.ENTITYREF_* type for where
the entity reference appears
java.lang.Exception
XMLEntityHandler
,
XMLEntityHandler
public void endEntityReference(int entityName, int entityType, int entityContext) throws java.lang.Exception
endEntityReference
in interface XMLDocumentHandler
entityName
- string pool index of the entity anementityType
- the XMLEntityHandler.ENTITYTYPE_* typeentityContext
- the XMLEntityHandler.ENTITYREF_* type for where
the entity reference appears
java.lang.Exception
XMLEntityHandler
,
XMLEntityHandler
public void startCDATA() throws java.lang.Exception
startCDATA
in interface XMLDocumentHandler
java.lang.Exception
public void endCDATA() throws java.lang.Exception
endCDATA
in interface XMLDocumentHandler
java.lang.Exception
public void characters(int dataIndex) throws java.lang.Exception
characters
in interface XMLDocumentHandler
dataIndex
- string pool index of the characters that were scanned
java.lang.Exception
public void ignorableWhitespace(int dataIndex) throws java.lang.Exception
ignorableWhitespace
in interface XMLDocumentHandler
dataIndex
- string pool index of ignorable whitespace
java.lang.Exception
public void processingInstruction(int piTarget, int piData) throws java.lang.Exception
processingInstruction
in interface XMLDocumentHandler
piTarget
- string pool index of the PI targetpiData
- string pool index of the PI data
java.lang.Exception
public void comment(int dataIndex) throws java.lang.Exception
comment
in interface XMLDocumentHandler
dataIndex
- string pool index of the comment text
java.lang.Exception
public void characters(char[] ch, int start, int length) throws java.lang.Exception
characters
in interface XMLDocumentHandler
ch
- character array containing the characters that were scannedstart
- offset in ch where scanned characters beginlength
- length of scanned characters in ch
java.lang.Exception
public void ignorableWhitespace(char[] ch, int start, int length) throws java.lang.Exception
ignorableWhitespace
in interface XMLDocumentHandler
ch
- character array containing the whitespace that was scannedstart
- offset in ch where scanned whitespace beginslength
- length of scanned whitespace in ch
java.lang.Exception
|
Xerces 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |