org.apache.xerces.impl
public class XMLDocumentFragmentScannerImpl extends XMLScanner implements XMLDocumentScanner, XMLComponent, XMLEntityHandler
This component requires the following features and properties from the component manager that uses it:
Version: $Id: XMLDocumentFragmentScannerImpl.java,v 1.58 2004/10/04 21:45:49 mrglavas Exp $
UNKNOWN:
Nested Class Summary | |
---|---|
protected interface | XMLDocumentFragmentScannerImpl.Dispatcher
This interface defines an XML "event" dispatching model. |
protected static class | XMLDocumentFragmentScannerImpl.ElementStack
Element stack. |
protected class | XMLDocumentFragmentScannerImpl.FragmentContentDispatcher
Dispatcher to handle content scanning.
|
Field Summary | |
---|---|
protected static boolean | DEBUG_CONTENT_SCANNING Debug content dispatcher scanning. |
protected static String | ENTITY_RESOLVER Property identifier: entity resolver. |
protected QName | fAttributeQName Attribute QName. |
protected XMLAttributesImpl | fAttributes Element attributes. |
protected XMLDocumentFragmentScannerImpl.Dispatcher | fContentDispatcher Content dispatcher. |
protected QName | fCurrentElement Current element. |
protected XMLDocumentFragmentScannerImpl.Dispatcher | fDispatcher Active dispatcher. |
protected XMLDocumentHandler | fDocumentHandler Document handler. |
protected QName | fElementQName Element QName. |
protected XMLDocumentFragmentScannerImpl.ElementStack | fElementStack Element stack. |
protected int[] | fEntityStack Entity stack. |
protected ExternalSubsetResolver | fExternalSubsetResolver External subset resolver. |
protected boolean | fHasExternalDTD has external dtd |
protected boolean | fInScanContent SubScanner state: inside scanContent method. |
protected int | fMarkupDepth Markup depth. |
protected boolean | fNotifyBuiltInRefs Notify built-in references. |
protected int | fScannerState Scanner state. |
protected boolean | fStandalone Standalone. |
protected XMLString | fTempString String. |
protected XMLString | fTempString2 String. |
protected static String | NAMESPACES Feature identifier: namespaces. |
protected static String | NOTIFY_BUILTIN_REFS Feature identifier: notify built-in refereces. |
protected static int | SCANNER_STATE_CDATA Scanner state: CDATA section. |
protected static int | SCANNER_STATE_COMMENT Scanner state: comment. |
protected static int | SCANNER_STATE_CONTENT Scanner state: content. |
protected static int | SCANNER_STATE_DOCTYPE Scanner state: DOCTYPE. |
protected static int | SCANNER_STATE_END_OF_INPUT Scanner state: end of input. |
protected static int | SCANNER_STATE_PI Scanner state: processing instruction. |
protected static int | SCANNER_STATE_REFERENCE Scanner state: reference. |
protected static int | SCANNER_STATE_ROOT_ELEMENT Scanner state: root element. |
protected static int | SCANNER_STATE_START_OF_MARKUP Scanner state: start of markup. |
protected static int | SCANNER_STATE_TERMINATED Scanner state: terminated. |
protected static int | SCANNER_STATE_TEXT_DECL Scanner state: Text declaration. |
Constructor Summary | |
---|---|
XMLDocumentFragmentScannerImpl() Default constructor. |
Method Summary | |
---|---|
protected XMLDocumentFragmentScannerImpl.Dispatcher | createContentDispatcher() Creates a content dispatcher. |
void | endEntity(String name, Augmentations augs)
This method notifies the end of an entity. |
String | getDispatcherName(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher) Returns the dispatcher name. |
XMLDocumentHandler | getDocumentHandler() Returns the document handler |
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.
|
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.
|
String[] | getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this component. |
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. |
void | reset(XMLComponentManager componentManager)
Resets the component. |
protected void | scanAttribute(XMLAttributes attributes)
Scans an attribute.
|
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.
|
boolean | scanDocument(boolean complete)
Scans a document.
|
protected int | scanEndElement()
Scans an end element.
|
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.
|
protected void | setDispatcher(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher)
Sets the dispatcher.
|
void | setDocumentHandler(XMLDocumentHandler documentHandler)
setDocumentHandler
|
void | setFeature(String featureId, boolean state)
Sets the state of a feature. |
void | setInputSource(XMLInputSource inputSource)
Sets the input source.
|
void | setProperty(String propertyId, Object value)
Sets the value of a property. |
protected void | setScannerState(int state)
Sets the scanner state.
|
void | startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
This method notifies of the start of an entity. |
Parameters: name The name of the entity. augs Additional information that may include infoset augmentations
Throws: XNIException Thrown by handler to signal an error.
Parameters: featureId The feature identifier.
Since: Xerces 2.2.0
Parameters: propertyId The property identifier.
Since: Xerces 2.2.0
Note: This method uses the fQName variable. The contents of this variable will be destroyed.
Parameters: element The element.
Returns: The element depth.
Throws: XNIException Thrown if the handler throws a SAX exception upon notification.
Parameters: componentManager The component manager.
Throws: SAXException Thrown by component on initialization error. For example, if a feature or property is required for the operation of the component, the component manager may throw a SAXNotRecognizedException or a SAXNotSupportedException.
[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.
Note: This method uses the fTempString and fStringBuffer variables.
Parameters: complete True if the CDATA section is to be scanned completely.
Returns: True if CDATA is completely scanned.
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
Returns: Returns the next character on the stream.
Parameters: complete True if the scanner should scan the document completely, pushing all events to the registered document handler. A value of false indicates that that the scanner should only scan the next portion of the document and return. A scanner instance is permitted to completely scan a document if it does not support this "pull" scanning model.
Returns: True if there is more to scan, false otherwise.
[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.
Returns: The element depth.
Throws: IOException Thrown if i/o error occurs. XNIException Thrown if handler throws exception upon notification.
Parameters: target The PI target data The string to fill in with the data
[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.
Returns: True if element is empty. (i.e. It matches production [44].
Returns: True if element is empty.
See Also: XMLDocumentFragmentScannerImpl
See Also: scanStartElement
[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 to be scanned instead of an XML declaration.
Parameters: dispatcher The new dispatcher.
Parameters: documentHandler
Note: Components should silently ignore features that do not affect the operation of the component.
Parameters: featureId The feature identifier. state The state of the feature.
Throws: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.
Parameters: inputSource The input source.
Throws: IOException Thrown on i/o error.
Note: Components should silently ignore properties that do not affect the operation of the component.
Parameters: propertyId The property identifier. value The value of the property.
Throws: SAXNotRecognizedException The component should not throw this exception. SAXNotSupportedException The component should not throw this exception.
Parameters: state The new scanner state.
Parameters: name The name of the entity. identifier The resource identifier. encoding The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader). augs Additional information that may include infoset augmentations
Throws: XNIException Thrown by handler to signal an error.