|
Xerces 3.1.1 API: Class XMLParser
org.apache.xerces.framework
|
Field Summary | |
protected org.apache.xerces.readers.DefaultEntityHandler |
fEntityHandler
|
protected XMLErrorReporter |
fErrorReporter
|
protected org.apache.xerces.validators.common.GrammarResolver |
fGrammarResolver
|
protected boolean |
fParseInProgress
|
protected XMLDocumentScanner |
fScanner
|
protected org.apache.xerces.utils.StringPool |
fStringPool
|
protected org.apache.xerces.validators.common.XMLValidator |
fValidator
|
protected static java.lang.String |
SAX2_FEATURES_PREFIX
|
protected static java.lang.String |
SAX2_PROPERTIES_PREFIX
|
protected static java.lang.String |
XERCES_FEATURES_PREFIX
|
protected static java.lang.String |
XERCES_PROPERTIES_PREFIX
|
Fields inherited from interface org.apache.xerces.framework.XMLErrorReporter |
ERRORTYPE_FATAL_ERROR,
ERRORTYPE_RECOVERABLE_ERROR,
ERRORTYPE_WARNING |
Constructor Summary | |
protected |
XMLParser()
Constructor |
Method Summary | |
void |
addRecognizer(org.apache.xerces.readers.XMLDeclRecognizer recognizer)
Adds a recognizer. |
protected boolean |
getAllowJavaEncodings()
Returns true if Java encoding names are allowed in the XML document. |
protected boolean |
getContinueAfterFatalError()
Returns true if the parser continues after a fatal error. |
getEntityResolver()
Return the current entity resolver. |
|
getErrorHandler()
Return the current error handler. |
|
protected boolean |
getExternalGeneralEntities()
Note: This feature is always true. |
protected boolean |
getExternalParameterEntities()
Note: This feature is always true. |
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 boolean |
getLoadDTDGrammar()
Returns true if load DTD grammar is turned on in the XMLValiator. |
getLocator()
return the locator being used by the parser |
|
protected boolean |
getNamespaces()
Returns true if the parser preprocesses namespaces. |
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. |
protected boolean |
getValidation()
Returns true if validation is turned on. |
protected boolean |
getValidationDynamic()
Returns true if validation is based on whether a document contains a grammar. |
protected boolean |
getValidationSchema()
Returns true if Schema support is turned on. |
protected boolean |
getValidationWarnOnDuplicateAttdef()
Returns true if an error is emitted when an attribute is redefined in the grammar. |
protected boolean |
getValidationWarnOnUndeclaredElemdef()
Returns true if the parser emits an error when an undeclared element is referenced in the grammar. |
protected java.lang.String |
getXMLString()
This method is the equivalent to the property: |
protected void |
initHandlers(boolean sendCharDataAsCharArray,
XMLDocumentHandler docHandler,
XMLDocumentHandler.DTDHandler dtdHandler)
Set char data processing preference and handlers. |
boolean |
isFeatureRecognized(java.lang.String featureId)
Returns true if the specified feature is recognized. |
boolean |
isPropertyRecognized(java.lang.String propertyId)
Returns true if the specified property is recognized. |
void |
|
void |
parse(java.lang.String systemId)
Parses the input source specified by the given system identifier. |
boolean |
parseSome()
Application-driven parsing. |
boolean |
|
void |
java.lang.String errorDomain,
int majorCode,
int minorCode,
java.lang.Object[] args,
int errorType)
|
void |
reset()
Reset parser instance so that it can be reused. |
protected void |
resetOrCopy()
Reset or copy parser Allows parser instance reuse |
protected void |
setAllowJavaEncodings(boolean allow)
Allows the use of Java encoding names in the XMLDecl and TextDecl lines in an XML document. |
protected void |
setContinueAfterFatalError(boolean continueAfterFatalError)
Allows the parser to continue after a fatal error. |
void |
|
void |
|
protected void |
setExternalGeneralEntities(boolean expand)
Note: Currently, this parser always expands external general entities. Setting this feature to false will throw a SAXNotSupportedException. |
protected void |
setExternalParameterEntities(boolean expand)
Note: Currently, this parser always expands external parameter entities. Setting this feature to false will throw a SAXNotSupportedException. |
void |
setFeature(java.lang.String featureId,
boolean state)
Set the state of a feature. |
protected void |
setLoadDTDGrammar(boolean loadDTDGrammar)
Allows the parser to have the choice to load DTD grammar when validation is off. |
void |
setLocale(java.util.Locale locale)
Set the locale to use for messages. |
protected void |
setNamespaces(boolean process)
Sets whether the parser preprocesses namespaces. |
protected void |
setNormalizeAttributeValues(boolean normalize)
|
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Set the value of a property. |
void |
setReaderFactory(org.apache.xerces.readers.XMLEntityReaderFactory readerFactory)
Set the reader factory. |
protected void |
setValidation(boolean validate)
Sets whether the parser validates. |
protected void |
setValidationDynamic(boolean dynamic)
Allows the parser to validate a document only when it contains a grammar. |
protected void |
setValidationSchema(boolean schema)
Allows the user to turn Schema support on/off. |
protected void |
setValidationWarnOnDuplicateAttdef(boolean warn)
Sets whether an error is emitted when an attribute is redefined in the grammar. |
protected void |
setValidationWarnOnUndeclaredElemdef(boolean warn)
Sets whether the parser emits an error when an element's content model references an element by name that is not declared in the grammar. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final java.lang.String SAX2_FEATURES_PREFIX
protected static final java.lang.String SAX2_PROPERTIES_PREFIX
protected static final java.lang.String XERCES_FEATURES_PREFIX
protected static final java.lang.String XERCES_PROPERTIES_PREFIX
protected org.apache.xerces.validators.common.GrammarResolver fGrammarResolver
protected boolean fParseInProgress
protected org.apache.xerces.utils.StringPool fStringPool
protected XMLErrorReporter fErrorReporter
protected org.apache.xerces.readers.DefaultEntityHandler fEntityHandler
protected XMLDocumentScanner fScanner
protected org.apache.xerces.validators.common.XMLValidator fValidator
Constructor Detail |
protected XMLParser()
Method Detail |
protected void initHandlers(boolean sendCharDataAsCharArray, XMLDocumentHandler docHandler, XMLDocumentHandler.DTDHandler dtdHandler)
public java.lang.String[] getFeaturesRecognized()
public boolean isFeatureRecognized(java.lang.String featureId)
public java.lang.String[] getPropertiesRecognized()
public boolean isPropertyRecognized(java.lang.String propertyId)
throws java.lang.Exception
source
- the input source to be parsed.parseSome()
public boolean parseSome() throws java.lang.Exception
public void reset() throws java.lang.Exception
public void setReaderFactory(org.apache.xerces.readers.XMLEntityReaderFactory readerFactory)
public void addRecognizer(org.apache.xerces.readers.XMLDeclRecognizer recognizer)
recognizer
- The XML recognizer to add.protected void setValidation(boolean validate)
This method is the equivalent to the feature:
validate
- True to validate; false to not validate.getValidation()
,
setFeature(java.lang.String, boolean)
protected boolean getValidation()
setValidation(boolean)
protected void setExternalGeneralEntities(boolean expand)
Sets whether external general entities are expanded.
This method is the equivalent to the feature:
expand
- True to expand external general entities; false
to not expand.getExternalGeneralEntities()
,
setFeature(java.lang.String, boolean)
protected boolean getExternalGeneralEntities()
Returns true if external general entities are expanded.
setExternalGeneralEntities(boolean)
protected void setExternalParameterEntities(boolean expand)
Sets whether external parameter entities are expanded.
This method is the equivalent to the feature:
expand
- True to expand external parameter entities; false
to not expand.getExternalParameterEntities()
,
setFeature(java.lang.String, boolean)
protected boolean getExternalParameterEntities()
Returns true if external parameter entities are expanded.
setExternalParameterEntities(boolean)
protected void setNamespaces(boolean process)
This method is the equivalent to the feature:
process
- True to process namespaces; false to not process.getNamespaces()
,
setFeature(java.lang.String, boolean)
protected boolean getNamespaces()
setNamespaces(boolean)
protected void setValidationSchema(boolean schema)
This method is equivalent to the feature:
schema
- True to turn on Schema support; false to turn it off.getValidationSchema()
,
setFeature(java.lang.String, boolean)
protected boolean getValidationSchema()
setValidationSchema(boolean)
protected void setValidationDynamic(boolean dynamic)
This method is the equivalent to the feature:
dynamic
- True to dynamically validate documents; false to
validate based on the validation feature.getValidationDynamic()
,
setFeature(java.lang.String, boolean)
protected boolean getValidationDynamic()
setValidationDynamic(boolean)
protected void setNormalizeAttributeValues(boolean normalize)
protected void setLoadDTDGrammar(boolean loadDTDGrammar)
This method is the equivalent to the feature:
loadDTDGrammar
- True to turn on the feature; false to
turn off the feature.getLoadDTDGrammar()
,
setFeature(java.lang.String, boolean)
protected boolean getLoadDTDGrammar()
setLoadDTDGrammar(boolean)
protected void setValidationWarnOnDuplicateAttdef(boolean warn)
This method is the equivalent to the feature:
warn
- True to warn; false to not warn.getValidationWarnOnDuplicateAttdef()
,
setFeature(java.lang.String, boolean)
protected boolean getValidationWarnOnDuplicateAttdef()
protected void setValidationWarnOnUndeclaredElemdef(boolean warn)
This method is the equivalent to the feature:
warn
- True to warn; false to not warn.getValidationWarnOnUndeclaredElemdef()
,
setFeature(java.lang.String, boolean)
protected boolean getValidationWarnOnUndeclaredElemdef()
protected void setAllowJavaEncodings(boolean allow)
This method is the equivalent to the feature:
allow
- True to allow Java encoding names; false to disallow.getAllowJavaEncodings()
,
setFeature(java.lang.String, boolean)
protected boolean getAllowJavaEncodings()
setAllowJavaEncodings(boolean)
protected void setContinueAfterFatalError(boolean continueAfterFatalError)
This method is the equivalent to the feature:
continueAfterFatalError
- True to continue; false to stop on
fatal error.getContinueAfterFatalError()
,
setFeature(java.lang.String, boolean)
protected boolean getContinueAfterFatalError()
setContinueAfterFatalError(boolean)
protected java.lang.String getXMLString()
getProperty(java.lang.String)
protected void resetOrCopy() throws java.lang.Exception
resolver
- The new entity resolver. Passing a null value will
uninstall the currently installed resolver.handler
- The new error handler.java.io.IOException
public void parse(java.lang.String systemId) java.io.IOException
This method is equivalent to the following:
parse(new InputSource(systemId));
public void setLocale(java.util.Locale locale)
java.lang.String errorDomain, int majorCode, int minorCode, java.lang.Object[] args, int errorType) throws java.lang.Exception
locator
- Location of error.errorDomain
- The error domain.majorCode
- The major code of the error.minorCode
- The minor code of the error.args
- Arguments for replacement text.errorType
- The type of the error.XMLErrorReporter.ERRORTYPE_WARNING
,
XMLErrorReporter.ERRORTYPE_FATAL_ERROR
public void setFeature(java.lang.String featureId, boolean state)
public boolean getFeature(java.lang.String featureId)
featureId
- The unique identifier (URI) of the feature
problem fulfilling the request.public void setProperty(java.lang.String propertyId, java.lang.Object value)
propertyId
- The unique identifier (URI) of the property
requested property is known, but the requested
problem fulfilling the request.public java.lang.Object getProperty(java.lang.String propertyId)
propertyId
- The unique identifier (URI) of the property
|
Xerces 3.1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |