Save This Page
Home » openjdk-7 » com.sun.org.apache.xerces.internal » impl » [javadoc | source]
com.sun.org.apache.xerces.internal.impl
abstract public class: XMLScanner [javadoc | source]
java.lang.Object
   com.sun.org.apache.xerces.internal.impl.XMLScanner

All Implemented Interfaces:
    XMLComponent

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

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 NAMESPACES    Feature identifier: namespaces. 
protected static final  String VALIDATION    Feature identifier: validation. 
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  ArrayList attributeValueCache     
protected  ArrayList stringBufferCache     
protected  int fStringBufferIndex     
protected  boolean fAttributeCacheInitDone     
protected  int fAttributeCacheUsedCount     
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  PropertyManager fPropertyManager     
protected  SymbolTable fSymbolTable    Symbol table. 
protected  XMLErrorReporter fErrorReporter    Error reporter. 
protected  XMLEntityManager fEntityManager    Entity manager. 
protected  XMLEntityStorage fEntityStore    xxx this should be available from EntityManager Entity storage 
protected  XMLEvent fEvent    event type 
protected  XMLEntityScanner fEntityScanner    Entity scanner, this alwasy works on last entity that was opened. 
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  XMLResourceIdentifierImpl fResourceIdentifier     
 int initialCacheCount     
Method from com.sun.org.apache.xerces.internal.impl.XMLScanner Summary:
endEntity,   getFeature,   getStringBuffer,   isInvalid,   isInvalidLiteral,   isValidNCName,   isValidNameChar,   isValidNameStartChar,   normalizeWhitespace,   reportFatalError,   reset,   reset,   reset,   scanAttributeValue,   scanCharReferenceValue,   scanComment,   scanExternalID,   scanPI,   scanPIData,   scanPseudoAttribute,   scanPubidLiteral,   scanSurrogates,   scanXMLDeclOrTextDecl,   setFeature,   setProperty,   setPropertyManager,   startEntity,   versionSupported
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.org.apache.xerces.internal.impl.XMLScanner Detail:
 public  void endEntity(String name,
    Augmentations augs) throws IOException, 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 
 XMLStringBuffer getStringBuffer() 
 protected boolean isInvalid(int value) 
 protected boolean isInvalidLiteral(int value) 
 protected boolean isValidNCName(int value) 
 protected boolean isValidNameChar(int value) 
 protected boolean isValidNameStartChar(int value) 
 protected  void normalizeWhitespace(XMLString value) 
    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 
 public  void reset(PropertyManager propertyManager) 
 protected  void scanAttributeValue(XMLString value,
    XMLString nonNormalizedValue,
    String atName,
    XMLAttributes attributes,
    int attrIndex,
    boolean checkEntities) 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(XMLStringBuffer data) throws IOException, XNIException 
    Scans a processing instruction.

    [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
    [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
    
 protected  void scanPIData(String target,
    XMLStringBuffer 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) This method would always read the whole data. We have while loop and data is buffered until delimeter is encountered.
 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.
 protected  void setPropertyManager(PropertyManager propertyManager) 
 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)