| java.lang.Object org.apache.xerces.impl.dtd.XMLDTDValidator
All known Subclasses: org.apache.xerces.impl.dtd.XMLNSDTDValidator, org.apache.xerces.impl.dtd.XML11DTDValidator,
XMLDTDValidator | public class XMLDTDValidator implements XMLComponent,XMLDocumentFilter,XMLDTDValidatorFilter,RevalidationHandler(Code) | | The DTD validator. The validator implements a document
filter: receiving document events from the scanner; validating
the content and structure; augmenting the InfoSet, if applicable;
and notifying the parser of the information resulting from the
validation process.
Formerly, this component also handled DTD events and grammar construction.
To facilitate the development of a meaningful DTD grammar caching/preparsing
framework, this functionality has been moved into the XMLDTDLoader
class. Therefore, this class no longer implements the DTDFilter
or DTDContentModelFilter interfaces.
This component requires the following features and properties from the
component manager that uses it:
- http://xml.org/sax/features/namespaces
- http://xml.org/sax/features/validation
- http://apache.org/xml/features/validation/dynamic
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/grammar-pool
- http://apache.org/xml/properties/internal/datatype-validator-factory
author: Eric Ye, IBM author: Andy Clark, IBM author: Jeffrey Rodriguez IBM author: Neil Graham, IBM version: $Id: XMLDTDValidator.java 572055 2007-09-02 17:55:43Z mrglavas $ |
Method Summary | |
protected void | addDTDDefaultAttrsAndValidate(QName elementName, int elementIndex, XMLAttributes attributes) Add default attributes and validate. | public boolean | characterData(String data, Augmentations augs) | public void | characters(XMLString text, Augmentations augs) Character content. | public void | comment(XMLString text, Augmentations augs) A comment. | public void | doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) Notifies of the presence of the DOCTYPE line in the document.
Parameters: rootElement - The name of the root element. Parameters: publicId - The public identifier if an external DTD or nullif the external DTD is specified using SYSTEM. Parameters: systemId - The system identifier if an external DTD, nullotherwise. | public void | emptyElement(QName element, XMLAttributes attributes, Augmentations augs) An empty element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. | public void | endCDATA(Augmentations augs) The end of a CDATA section. | public void | endDocument(Augmentations augs) The end of the document. | public void | endElement(QName element, Augmentations augs) The end of an element. | public void | endGeneralEntity(String name, Augmentations augs) This method notifies the end of a general entity. | protected void | endNamespaceScope(QName element, Augmentations augs, boolean isEmpty) | public XMLDocumentHandler | getDocumentHandler() | public XMLDocumentSource | getDocumentSource() | protected String | getExternalEntityRefInAttrValue(String nonNormalizedValue) Checks entities in attribute values for standalone VC. | public Boolean | getFeatureDefault(String featureId) Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature. | DTDGrammarBucket | getGrammarBucket() | public Object | getPropertyDefault(String propertyId) Returns the default state for a property, or null if this
component does not want to report a default value for this
property. | public String[] | getRecognizedFeatures() Returns a list of feature identifiers that are recognized by
this component. | public String[] | getRecognizedProperties() Returns a list of property identifiers that are recognized by
this component. | protected void | handleEndElement(QName element, Augmentations augs, boolean isEmpty) Handle end element. | protected boolean | handleStartElement(QName element, XMLAttributes attributes, Augmentations augs) | final public boolean | hasGrammar() | public void | ignorableWhitespace(XMLString text, Augmentations augs) Ignorable whitespace. | protected void | init() | protected boolean | invalidStandaloneAttDef(QName element, QName attribute) Returns true if invalid standalone attribute definition. | protected boolean | isSpace(int c) | public void | processingInstruction(String target, XMLString data, Augmentations augs) A processing instruction. | public void | reset(XMLComponentManager componentManager) | public void | setDocumentHandler(XMLDocumentHandler documentHandler) Sets the document handler to receive information about the document. | public void | setDocumentSource(XMLDocumentSource source) | public void | setFeature(String featureId, boolean state) Sets the state of a feature. | public void | setProperty(String propertyId, Object value) Sets the value of a property. | public void | startCDATA(Augmentations augs) The start of a CDATA section. | public void | startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) The start of the document.
Parameters: locator - The system identifier of the entity if the entityis external, null otherwise. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. | public void | startElement(QName element, XMLAttributes attributes, Augmentations augs) The start of an element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. | public void | startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) This method notifies the start of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the general entity. Parameters: identifier - The resource identifier. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. | protected void | startNamespaceScope(QName element, XMLAttributes attributes, Augmentations augs) | public void | textDecl(String version, String encoding, Augmentations augs) Notifies of the presence of a TextDecl line in an entity. | final public boolean | validate() | protected void | validateDTDattribute(QName element, String attValue, XMLAttributeDecl attributeDecl) Validate attributes in DTD fashion. | public void | xmlDecl(String version, String encoding, String standalone, Augmentations augs) Notifies of the presence of an XMLDecl line in the document. |
BALANCE_SYNTAX_TREES | final protected static String BALANCE_SYNTAX_TREES(Code) | | Feature identifier: balance syntax trees.
|
DATATYPE_VALIDATOR_FACTORY | final protected static String DATATYPE_VALIDATOR_FACTORY(Code) | | Property identifier: datatype validator factory.
|
DYNAMIC_VALIDATION | final protected static String DYNAMIC_VALIDATION(Code) | | Feature identifier: dynamic validation.
|
ERROR_REPORTER | final protected static String ERROR_REPORTER(Code) | | Property identifier: error reporter.
|
GRAMMAR_POOL | final protected static String GRAMMAR_POOL(Code) | | Property identifier: grammar pool.
|
NAMESPACES | final protected static String NAMESPACES(Code) | | Feature identifier: namespaces.
|
PARSER_SETTINGS | final protected static String PARSER_SETTINGS(Code) | | |
SYMBOL_TABLE | final protected static String SYMBOL_TABLE(Code) | | Property identifier: symbol table.
|
VALIDATION | final protected static String VALIDATION(Code) | | Feature identifier: validation.
|
VALIDATION_MANAGER | final protected static String VALIDATION_MANAGER(Code) | | |
WARN_ON_DUPLICATE_ATTDEF | final protected static String WARN_ON_DUPLICATE_ATTDEF(Code) | | Feature identifier: warn on duplicate attdef
|
fBalanceSyntaxTrees | protected boolean fBalanceSyntaxTrees(Code) | | Controls whether the DTD grammar produces balanced syntax trees.
|
fDTDValidation | protected boolean fDTDValidation(Code) | | Validation against only DTD
|
fDatatypeValidatorFactory | protected DTDDVFactory fDatatypeValidatorFactory(Code) | | Datatype validator factory.
|
fDynamicValidation | protected boolean fDynamicValidation(Code) | | Dynamic validation. This state of this feature is only useful when
the validation feature is set to true .
|
fNamespaces | protected boolean fNamespaces(Code) | | Namespaces.
|
fSeenDoctypeDecl | protected boolean fSeenDoctypeDecl(Code) | | True if seen DOCTYPE declaration.
|
fValidation | protected boolean fValidation(Code) | | Validation.
|
fWarnDuplicateAttdef | protected boolean fWarnDuplicateAttdef(Code) | | warn on duplicate attribute definition, this feature works only when validation is true
|
XMLDTDValidator | public XMLDTDValidator()(Code) | | Default constructor.
|
addDTDDefaultAttrsAndValidate | protected void addDTDDefaultAttrsAndValidate(QName elementName, int elementIndex, XMLAttributes attributes) throws XNIException(Code) | | Add default attributes and validate.
|
characters | public void characters(XMLString text, Augmentations augs) throws XNIException(Code) | | Character content.
Parameters: text - The content. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
comment | public void comment(XMLString text, Augmentations augs) throws XNIException(Code) | | A comment.
Parameters: text - The text in the comment. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by application to signal an error. |
doctypeDecl | public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) throws XNIException(Code) | | Notifies of the presence of the DOCTYPE line in the document.
Parameters: rootElement - The name of the root element. Parameters: publicId - The public identifier if an external DTD or nullif the external DTD is specified using SYSTEM. Parameters: systemId - The system identifier if an external DTD, nullotherwise. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
emptyElement | public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | An empty element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endCDATA | public void endCDATA(Augmentations augs) throws XNIException(Code) | | The end of a CDATA section.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endDocument | public void endDocument(Augmentations augs) throws XNIException(Code) | | The end of the document.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endElement | public void endElement(QName element, Augmentations augs) throws XNIException(Code) | | The end of an element.
Parameters: element - The name of the element. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
endGeneralEntity | public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code) | | This method notifies the end of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the entity. Parameters: augs - Additional information that may include infoset augmentations exception: XNIException - Thrown by handler to signal an error. |
getExternalEntityRefInAttrValue | protected String getExternalEntityRefInAttrValue(String nonNormalizedValue)(Code) | | Checks entities in attribute values for standalone VC.
|
getFeatureDefault | public Boolean getFeatureDefault(String featureId)(Code) | | Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
Parameters: featureId - The feature identifier. since: Xerces 2.2.0 |
getPropertyDefault | public Object getPropertyDefault(String propertyId)(Code) | | Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
Parameters: propertyId - The property identifier. since: Xerces 2.2.0 |
getRecognizedFeatures | public String[] getRecognizedFeatures()(Code) | | Returns a list of feature identifiers that are recognized by
this component. This method may return null if no features
are recognized by this component.
|
getRecognizedProperties | public String[] getRecognizedProperties()(Code) | | Returns a list of property identifiers that are recognized by
this component. This method may return null if no properties
are recognized by this component.
|
hasGrammar | final public boolean hasGrammar()(Code) | | |
ignorableWhitespace | public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code) | | Ignorable whitespace. For this method to be called, the document
source must have some way of determining that the text containing
only whitespace characters should be considered ignorable. For
example, the validator can determine if a length of whitespace
characters in the document are ignorable based on the element
content model.
Parameters: text - The ignorable whitespace. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
init | protected void init()(Code) | | initialization
|
invalidStandaloneAttDef | protected boolean invalidStandaloneAttDef(QName element, QName attribute)(Code) | | Returns true if invalid standalone attribute definition.
|
isSpace | protected boolean isSpace(int c)(Code) | | |
processingInstruction | public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code) | | A processing instruction. Processing instructions consist of a
target name and, optionally, text data. The data is only meaningful
to the application.
Typically, a processing instruction's data will contain a series
of pseudo-attributes. These pseudo-attributes follow the form of
element attributes but are not parsed or presented
to the application as anything other than text. The application is
responsible for parsing the data.
Parameters: target - The target. Parameters: data - The data or null if none specified. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
setDocumentHandler | public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code) | | Sets the document handler to receive information about the document.
|
setFeature | public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code) | | Sets the state of a feature. This method is called by the component
manager any time after reset when a feature changes state.
Note: Components should silently ignore features
that do not affect the operation of the component.
Parameters: featureId - The feature identifier. Parameters: state - The state of the feature. throws: SAXNotRecognizedException - The component should not throwthis exception. throws: SAXNotSupportedException - The component should not throwthis exception. |
setProperty | public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code) | | Sets the value of a property. This method is called by the component
manager any time after reset when a property changes value.
Note: Components should silently ignore properties
that do not affect the operation of the component.
Parameters: propertyId - The property identifier. Parameters: value - The value of the property. throws: SAXNotRecognizedException - The component should not throwthis exception. throws: SAXNotSupportedException - The component should not throwthis exception. |
startCDATA | public void startCDATA(Augmentations augs) throws XNIException(Code) | | The start of a CDATA section.
Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startDocument | public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException(Code) | | The start of the document.
Parameters: locator - The system identifier of the entity if the entityis external, null otherwise. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader). Parameters: namespaceContext - The namespace context in effect at thestart of this document.This object represents the current context.Implementors of this class are responsiblefor copying the namespace bindings from thethe current context (and its parent contexts)if that information is important. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startElement | public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code) | | The start of an element.
Parameters: element - The name of the element. Parameters: attributes - The element attributes. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startGeneralEntity | public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code) | | This method notifies the start of a general entity.
Note: This method is not called for entity references
appearing as part of attribute values.
Parameters: name - The name of the general entity. Parameters: identifier - The resource identifier. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader). Parameters: augs - Additional information that may include infoset augmentations exception: XNIException - Thrown by handler to signal an error. |
textDecl | public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code) | | Notifies of the presence of a TextDecl line in an entity. If present,
this method will be called immediately following the startParameterEntity call.
Note: This method is only called for external
parameter entities referenced in the DTD.
Parameters: version - The XML version, or null if not specified. Parameters: encoding - The IANA encoding name of the entity. Parameters: augs - Additional information that may include infosetaugmentations. throws: XNIException - Thrown by handler to signal an error. |
validate | final public boolean validate()(Code) | | |
xmlDecl | public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code) | | Notifies of the presence of an XMLDecl line in the document. If
present, this method will be called immediately following the
startDocument call.
Parameters: version - The XML version. Parameters: encoding - The IANA encoding name of the document, or null ifnot specified. Parameters: standalone - The standalone value, or null if not specified. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
|
|