Save This Page
Home » Xerces-J-src.2.9.1 » org.apache.xerces » impl » [javadoc | source]
org.apache.xerces.impl
abstract public class: XMLScanner [javadoc | source]
java.lang.Object
   org.apache.xerces.impl.XMLScanner

All Implemented Interfaces:
    XMLComponent

Direct Known Subclasses:
    XMLNSDocumentScannerImpl, XMLDTDScannerImpl, XML11NSDocumentScannerImpl, XML11DocumentScannerImpl, XML11DTDScannerImpl, XMLDocumentScannerImpl, XMLDocumentFragmentScannerImpl

This class is responsible for holding scanning methods common to scanning the XML document structure and content as well as the DTD structure and content. Both XMLDocumentScanner and XMLDTDScanner inherit from this base class.

This component requires the following features and properties from the component manager that uses it:

Field Summary
protected static final  String VALIDATION    Feature identifier: validation. 
protected static final  String NAMESPACES    Feature identifier: namespaces. 
protected static final  String NOTIFY_CHAR_REFS    Feature identifier: notify character references. 
protected static final  String PARSER_SETTINGS     
protected static final  String SYMBOL_TABLE    Property identifier: symbol table. 
protected static final  String ERROR_REPORTER    Property identifier: error reporter. 
protected static final  String ENTITY_MANAGER    Property identifier: entity manager. 
protected static final  boolean DEBUG_ATTR_NORMALIZATION    Debug attribute normalization. 
protected  boolean fValidation    Validation. This feature identifier is: http://xml.org/sax/features/validation 
protected  boolean fNamespaces    Namespaces. 
protected  boolean fNotifyCharRefs    Character references notification. 
protected  boolean fParserSettings    Internal parser-settings feature 
protected  SymbolTable fSymbolTable    Symbol table. 
protected  XMLErrorReporter fErrorReporter    Error reporter. 
protected  XMLEntityManager fEntityManager    Entity manager. 
protected  XMLEntityScanner fEntityScanner    Entity scanner. 
protected  int fEntityDepth    Entity depth. 
protected  String fCharRefLiteral    Literal value of the last character refence scanned. 
protected  boolean fScanningAttribute    Scanning attribute. 
protected  boolean fReportEntity    Report entity boundary. 
protected static final  String fVersionSymbol    Symbol: "version". 
protected static final  String fEncodingSymbol    Symbol: "encoding". 
protected static final  String fStandaloneSymbol    Symbol: "standalone". 
protected static final  String fAmpSymbol    Symbol: "amp". 
protected static final  String fLtSymbol    Symbol: "lt". 
protected static final  String fGtSymbol    Symbol: "gt". 
protected static final  String fQuotSymbol    Symbol: "quot". 
protected static final  String fAposSymbol    Symbol: "apos". 
protected final  XMLResourceIdentifierImpl fResourceIdentifier     
Method from org.apache.xerces.impl.XMLScanner Summary:
endEntity,   getFeature,   getVersionNotSupportedKey,   isInvalid,   isInvalidLiteral,   isUnchangedByNormalization,   isValidNCName,   isValidNameChar,   isValidNameStartChar,   isValidNameStartHighSurrogate,   normalizeWhitespace,   normalizeWhitespace,   reportFatalError,   reset,   reset,   scanAttributeValue,   scanCharReferenceValue,   scanComment,   scanExternalID,   scanPI,   scanPIData,   scanPseudoAttribute,   scanPubidLiteral,   scanSurrogates,   scanXMLDeclOrTextDecl,   setFeature,   setProperty,   startEntity,   versionSupported
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xerces.impl.XMLScanner Detail:
 public  void endEntity(String name,
    Augmentations augs) throws XNIException 
    This method notifies the end of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.
 public boolean getFeature(String featureId) throws XMLConfigurationException 
 protected String getVersionNotSupportedKey() 
 protected boolean isInvalid(int value) 
 protected boolean isInvalidLiteral(int value) 
 protected int isUnchangedByNormalization(XMLString value) 
    Checks whether this string would be unchanged by normalization.
 protected boolean isValidNCName(int value) 
 protected boolean isValidNameChar(int value) 
 protected boolean isValidNameStartChar(int value) 
 protected boolean isValidNameStartHighSurrogate(int value) 
 protected  void normalizeWhitespace(XMLString value) 
    Normalize whitespace in an XMLString converting all whitespace characters to space characters.
 protected  void normalizeWhitespace(XMLString value,
    int fromIndex) 
    Normalize whitespace in an XMLString converting all whitespace characters to space characters.
 protected  void reportFatalError(String msgId,
    Object[] args) throws XNIException 
    Convenience function used in all XML scanners.
 protected  void reset() 
 public  void reset(XMLComponentManager componentManager) throws XMLConfigurationException 
 protected boolean scanAttributeValue(XMLString value,
    XMLString nonNormalizedValue,
    String atName,
    boolean checkEntities,
    String eleName) throws IOException, XNIException 
    Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
 protected int scanCharReferenceValue(XMLStringBuffer buf,
    XMLStringBuffer buf2) throws IOException, XNIException 
    Scans a character reference and append the corresponding chars to the specified buffer.

    [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
    
    Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
 protected  void scanComment(XMLStringBuffer text) throws IOException, XNIException 
    Scans a comment.

    [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
    

    Note: Called after scanning past '<!--' Note: This method uses fString, anything in it at the time of calling is lost.

 protected  void scanExternalID(String[] identifiers,
    boolean optionalSystemId) throws IOException, XNIException 
    Scans External ID and return the public and system IDs.
 protected  void scanPI() throws IOException, XNIException 
    Scans a processing instruction.

    [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
    [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
    
    Note: This method uses fString, anything in it at the time of calling is lost.
 protected  void scanPIData(String target,
    XMLString data) throws IOException, XNIException 
    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) Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
 public String scanPseudoAttribute(boolean scanningTextDecl,
    XMLString value) throws IOException, XNIException 
    Scans a pseudo attribute.
 protected boolean scanPubidLiteral(XMLString literal) throws IOException, XNIException 
    Scans public ID literal. [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] The returned string is normalized according to the following rule, from http://www.w3.org/TR/REC-xml#dt-pubid: Before a match is attempted, all strings of white space in the public identifier must be normalized to single space characters (#x20), and leading and trailing white space must be removed.
 protected boolean scanSurrogates(XMLStringBuffer buf) throws IOException, XNIException 
    Scans surrogates and append them to the specified buffer.

    Note: This assumes the current char has already been identified as a high surrogate.

 protected  void scanXMLDeclOrTextDecl(boolean scanningTextDecl,
    String[] pseudoAttributeValues) throws IOException, XNIException 
    Scans an XML or text declaration.

    [23] XMLDecl ::= ''
    [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 ::= ''
    
 public  void setFeature(String featureId,
    boolean value) throws XMLConfigurationException 
 public  void setProperty(String propertyId,
    Object value) throws XMLConfigurationException 
    Sets the value of a property during parsing.
 public  void startEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    This method notifies of the start of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.
 protected boolean versionSupported(String version)