| java.lang.Object org.apache.xerces.impl.XMLScanner org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
All known Subclasses: org.apache.xerces.impl.XMLDocumentScannerImpl,
XMLDocumentFragmentScannerImpl | public class XMLDocumentFragmentScannerImpl extends XMLScanner implements XMLDocumentScanner,XMLComponent,XMLEntityHandler(Code) | | This class is responsible for scanning the structure and content
of document fragments. The scanner acts as the source for the
document information which is communicated to the document handler.
This component requires the following features and properties from the
component manager that uses it:
- http://xml.org/sax/features/validation
- http://apache.org/xml/features/scanner/notify-char-refs
- http://apache.org/xml/features/scanner/notify-builtin-refs
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/entity-manager
author: Glenn Marcy, IBM author: Andy Clark, IBM author: Arnaud Le Hors, IBM author: Eric Ye, IBM version: $Id: XMLDocumentFragmentScannerImpl.java 572055 2007-09-02 17:55:43Z mrglavas $ |
Inner Class :protected static class ElementStack | |
Inner Class :protected interface Dispatcher | |
Inner Class :protected class FragmentContentDispatcher implements Dispatcher | |
Method Summary | |
protected Dispatcher | createContentDispatcher() Creates a content dispatcher. | public void | endEntity(String name, Augmentations augs) This method notifies the end of an entity. | public String | getDispatcherName(Dispatcher dispatcher) Returns the dispatcher name. | public XMLDocumentHandler | getDocumentHandler() | 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. | 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 String | getScannerStateName(int state) Returns the scanner state name. | protected int | handleEndElement(QName element, boolean isEmpty) Handles the end element. | public void | reset(XMLComponentManager componentManager) Resets the component. | protected void | scanAttribute(XMLAttributes attributes) Scans an attribute.
[41] Attribute ::= Name Eq AttValue
Note: This method assumes that the next
character on the stream is the first character of the attribute
name.
Note: This method uses the fAttributeQName and
fQName variables. | protected boolean | scanCDATASection(boolean complete) Scans a CDATA section. | protected void | scanCharReference() Scans a character reference. | protected void | scanComment() Scans a comment. | protected int | scanContent() Scans element content. | public boolean | scanDocument(boolean complete) Scans a document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. | protected int | scanEndElement() Scans an end element.
[42] ETag ::= '</' Name S? '>'
Note: This method uses the fElementQName variable.
The contents of this variable will be destroyed. | protected void | scanEntityReference() Scans an entity reference. | protected void | scanPIData(String target, XMLString data) Scans a processing data. | protected boolean | scanStartElement() Scans a start element. | protected boolean | scanStartElementAfterName() Scans the remainder of a start or empty tag after the element name. | protected void | scanStartElementName() Scans the name of an element in a start or empty tag. | protected void | scanXMLDeclOrTextDecl(boolean scanningTextDecl) Scans an XML or text declaration. | final protected void | setDispatcher(Dispatcher dispatcher) Sets the dispatcher. | public void | setDocumentHandler(XMLDocumentHandler documentHandler) | public void | setFeature(String featureId, boolean state) Sets the state of a feature. | public void | setInputSource(XMLInputSource inputSource) Sets the input source. | public void | setProperty(String propertyId, Object value) Sets the value of a property. | final protected void | setScannerState(int state) Sets the scanner state. | public void | startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) This method notifies of the start of an entity. |
DEBUG_CONTENT_SCANNING | final protected static boolean DEBUG_CONTENT_SCANNING(Code) | | Debug content dispatcher scanning.
|
ENTITY_RESOLVER | final protected static String ENTITY_RESOLVER(Code) | | Property identifier: entity resolver.
|
NAMESPACES | final protected static String NAMESPACES(Code) | | Feature identifier: namespaces.
|
NOTIFY_BUILTIN_REFS | final protected static String NOTIFY_BUILTIN_REFS(Code) | | Feature identifier: notify built-in refereces.
|
SCANNER_STATE_CDATA | final protected static int SCANNER_STATE_CDATA(Code) | | Scanner state: CDATA section.
|
SCANNER_STATE_COMMENT | final protected static int SCANNER_STATE_COMMENT(Code) | | Scanner state: comment.
|
SCANNER_STATE_CONTENT | final protected static int SCANNER_STATE_CONTENT(Code) | | Scanner state: content.
|
SCANNER_STATE_DOCTYPE | final protected static int SCANNER_STATE_DOCTYPE(Code) | | Scanner state: DOCTYPE.
|
SCANNER_STATE_END_OF_INPUT | final protected static int SCANNER_STATE_END_OF_INPUT(Code) | | Scanner state: end of input.
|
SCANNER_STATE_PI | final protected static int SCANNER_STATE_PI(Code) | | Scanner state: processing instruction.
|
SCANNER_STATE_REFERENCE | final protected static int SCANNER_STATE_REFERENCE(Code) | | Scanner state: reference.
|
SCANNER_STATE_ROOT_ELEMENT | final protected static int SCANNER_STATE_ROOT_ELEMENT(Code) | | Scanner state: root element.
|
SCANNER_STATE_START_OF_MARKUP | final protected static int SCANNER_STATE_START_OF_MARKUP(Code) | | Scanner state: start of markup.
|
SCANNER_STATE_TERMINATED | final protected static int SCANNER_STATE_TERMINATED(Code) | | Scanner state: terminated.
|
SCANNER_STATE_TEXT_DECL | final protected static int SCANNER_STATE_TEXT_DECL(Code) | | Scanner state: Text declaration.
|
fAttributeQName | final protected QName fAttributeQName(Code) | | Attribute QName.
|
fContentDispatcher | final protected Dispatcher fContentDispatcher(Code) | | Content dispatcher.
|
fCurrentElement | protected QName fCurrentElement(Code) | | Current element.
|
fDispatcher | protected Dispatcher fDispatcher(Code) | | Active dispatcher.
|
fElementQName | final protected QName fElementQName(Code) | | Element QName.
|
fElementStack | final protected ElementStack fElementStack(Code) | | Element stack.
|
fEntityStack | protected int[] fEntityStack(Code) | | Entity stack.
|
fHasExternalDTD | protected boolean fHasExternalDTD(Code) | | has external dtd
|
fInScanContent | protected boolean fInScanContent(Code) | | SubScanner state: inside scanContent method.
|
fIsEntityDeclaredVC | protected boolean fIsEntityDeclaredVC(Code) | | True if [Entity Declared] is a VC; false if it is a WFC.
|
fMarkupDepth | protected int fMarkupDepth(Code) | | Markup depth.
|
fNotifyBuiltInRefs | protected boolean fNotifyBuiltInRefs(Code) | | Notify built-in references.
|
fScannerState | protected int fScannerState(Code) | | Scanner state.
|
fStandalone | protected boolean fStandalone(Code) | | Standalone.
|
XMLDocumentFragmentScannerImpl | public XMLDocumentFragmentScannerImpl()(Code) | | Default constructor.
|
createContentDispatcher | protected Dispatcher createContentDispatcher()(Code) | | Creates a content dispatcher.
|
endEntity | public void endEntity(String name, Augmentations augs) throws XNIException(Code) | | This method notifies the end of an entity. The DTD has the pseudo-name
of "[dtd]" parameter entity names start with '%'; and general entities
are just specified by their name.
Parameters: name - The name of the entity. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
getDispatcherName | public String getDispatcherName(Dispatcher dispatcher)(Code) | | Returns the dispatcher name.
|
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.
|
getScannerStateName | protected String getScannerStateName(int state)(Code) | | Returns the scanner state name.
|
handleEndElement | protected int handleEndElement(QName element, boolean isEmpty) throws XNIException(Code) | | Handles the end element. This method will make sure that
the end element name matches the current element and notify
the handler about the end of the element and the end of any
relevent prefix mappings.
Note: This method uses the fQName variable.
The contents of this variable will be destroyed.
Parameters: element - The element. The element depth. throws: XNIException - Thrown if the handler throws a SAX exceptionupon notification. |
reset | public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code) | | Resets the component. The component can query the component manager
about any features and properties that affect the operation of the
component.
Parameters: componentManager - The component manager. throws: SAXException - Thrown by component on initialization error.For example, if a feature or property isrequired for the operation of the component, thecomponent manager may throw a SAXNotRecognizedException or aSAXNotSupportedException. |
scanAttribute | protected void scanAttribute(XMLAttributes attributes) throws IOException, XNIException(Code) | | Scans an attribute.
[41] Attribute ::= Name Eq AttValue
Note: This method assumes that the next
character on the stream is the first character of the attribute
name.
Note: This method uses the fAttributeQName and
fQName variables. The contents of these variables will be
destroyed.
Parameters: attributes - The attributes list for the scanned attribute. |
scanCDATASection | protected boolean scanCDATASection(boolean complete) throws IOException, XNIException(Code) | | Scans a CDATA section.
Note: This method uses the fTempString and
fStringBuffer variables.
Parameters: complete - True if the CDATA section is to be scannedcompletely. True if CDATA is completely scanned. |
scanCharReference | protected void scanCharReference() throws IOException, XNIException(Code) | | Scans a character reference.
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'
|
scanComment | protected void scanComment() throws IOException, XNIException(Code) | | Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
|
scanDocument | public boolean scanDocument(boolean complete) throws IOException, XNIException(Code) | | Scans a document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. A value of false indicates thatthat the scanner should only scan the next portionof the document and return. A scanner instance ispermitted to completely scan a document if it doesnot support this "pull" scanning model. True if there is more to scan, false otherwise. |
scanEndElement | protected int scanEndElement() throws IOException, XNIException(Code) | | Scans an end element.
[42] ETag ::= '</' Name S? '>'
Note: This method uses the fElementQName variable.
The contents of this variable will be destroyed. The caller should
copy the needed information out of this variable before calling
this method.
The element depth. |
scanPIData | protected void scanPIData(String target, XMLString data) throws IOException, XNIException(Code) | | Scans a processing data. This is needed to handle the situation
where a document starts with a processing instruction whose
target name starts with "xml". (e.g. xmlfoo)
Parameters: target - The PI target Parameters: data - The string to fill in with the data |
scanStartElement | protected boolean scanStartElement() throws IOException, XNIException(Code) | | Scans a start element. This method will handle the binding of
namespace information and notifying the handler of the start
of the element.
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
[40] STag ::= '<' Name (S Attribute)* S? '>'
Note: This method assumes that the leading
'<' character has been consumed.
Note: This method uses the fElementQName and
fAttributes variables. The contents of these variables will be
destroyed. The caller should copy important information out of
these variables before calling this method.
True if element is empty. (i.e. It matchesproduction [44]. |
scanXMLDeclOrTextDecl | protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl) throws IOException, XNIException(Code) | | Scans an XML or text declaration.
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
[24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
[32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
| ('"' ('yes' | 'no') '"'))
[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
Parameters: scanningTextDecl - True if a text declaration is tobe scanned instead of an XMLdeclaration. |
setDispatcher | final protected void setDispatcher(Dispatcher dispatcher)(Code) | | Sets the dispatcher.
Parameters: dispatcher - The new dispatcher. |
setDocumentHandler | public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code) | | setDocumentHandler
Parameters: documentHandler - |
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. |
setScannerState | final protected void setScannerState(int state)(Code) | | Sets the scanner state.
Parameters: state - The new scanner state. |
startEntity | public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code) | | This method notifies of the start of an entity. The DTD has the
pseudo-name of "[dtd]" parameter entity names start with '%'; and
general entities are just specified by their name.
Parameters: name - The name of the 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 throws: XNIException - Thrown by handler to signal an error. |
Methods inherited from org.apache.xerces.impl.XMLScanner | public void endEntity(String name, Augmentations augs) throws XNIException(Code)(Java Doc) public boolean getFeature(String featureId) throws XMLConfigurationException(Code)(Java Doc) protected String getVersionNotSupportedKey()(Code)(Java Doc) protected boolean isInvalid(int value)(Code)(Java Doc) protected boolean isInvalidLiteral(int value)(Code)(Java Doc) protected int isUnchangedByNormalization(XMLString value)(Code)(Java Doc) protected boolean isValidNCName(int value)(Code)(Java Doc) protected boolean isValidNameChar(int value)(Code)(Java Doc) protected boolean isValidNameStartChar(int value)(Code)(Java Doc) protected boolean isValidNameStartHighSurrogate(int value)(Code)(Java Doc) protected void normalizeWhitespace(XMLString value)(Code)(Java Doc) protected void normalizeWhitespace(XMLString value, int fromIndex)(Code)(Java Doc) protected void reportFatalError(String msgId, Object[] args) throws XNIException(Code)(Java Doc) public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)(Java Doc) protected void reset()(Code)(Java Doc) protected boolean scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName) throws IOException, XNIException(Code)(Java Doc) protected int scanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2) throws IOException, XNIException(Code)(Java Doc) protected void scanComment(XMLStringBuffer text) throws IOException, XNIException(Code)(Java Doc) protected void scanExternalID(String[] identifiers, boolean optionalSystemId) throws IOException, XNIException(Code)(Java Doc) protected void scanPI() throws IOException, XNIException(Code)(Java Doc) protected void scanPIData(String target, XMLString data) throws IOException, XNIException(Code)(Java Doc) public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) throws IOException, XNIException(Code)(Java Doc) protected boolean scanPubidLiteral(XMLString literal) throws IOException, XNIException(Code)(Java Doc) protected boolean scanSurrogates(XMLStringBuffer buf) throws IOException, XNIException(Code)(Java Doc) protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues) throws IOException, XNIException(Code)(Java Doc) public void setFeature(String featureId, boolean value) throws XMLConfigurationException(Code)(Java Doc) public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc) public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) protected boolean versionSupported(String version)(Code)(Java Doc)
|
|
|