Java Doc for XMLScanner.java in  » XML » xerces-2_9_1 » org » apache » xerces » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xerces 2_9_1 » org.apache.xerces.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xerces.impl.XMLScanner

All known Subclasses:   org.apache.xerces.impl.XMLDTDScannerImpl,  org.apache.xerces.impl.XMLDocumentFragmentScannerImpl,
XMLScanner
abstract public class XMLScanner implements XMLComponent(Code)
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:

  • http://xml.org/sax/features/validation
  • http://xml.org/sax/features/namespaces
  • http://apache.org/xml/features/scanner/notify-char-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:
   Andy Clark, IBM
author:
   Arnaud Le Hors, IBM
author:
   Eric Ye, IBM
version:
   $Id: XMLScanner.java 572055 2007-09-02 17:55:43Z mrglavas $


Field Summary
final protected static  booleanDEBUG_ATTR_NORMALIZATION
     Debug attribute normalization.
final protected static  StringENTITY_MANAGER
     Property identifier: entity manager.
final protected static  StringERROR_REPORTER
     Property identifier: error reporter.
final protected static  StringNAMESPACES
     Feature identifier: namespaces.
final protected static  StringNOTIFY_CHAR_REFS
     Feature identifier: notify character references.
final protected static  StringPARSER_SETTINGS
    
final protected static  StringSYMBOL_TABLE
     Property identifier: symbol table.
final protected static  StringVALIDATION
     Feature identifier: validation.
final protected static  StringfAmpSymbol
     Symbol: "amp".
final protected static  StringfAposSymbol
     Symbol: "apos".
protected  StringfCharRefLiteral
     Literal value of the last character refence scanned.
final protected static  StringfEncodingSymbol
     Symbol: "encoding".
protected  intfEntityDepth
     Entity depth.
protected  XMLEntityManagerfEntityManager
     Entity manager.
protected  XMLEntityScannerfEntityScanner
     Entity scanner.
protected  XMLErrorReporterfErrorReporter
     Error reporter.
final protected static  StringfGtSymbol
     Symbol: "gt".
final protected static  StringfLtSymbol
     Symbol: "lt".
protected  booleanfNamespaces
     Namespaces.
protected  booleanfNotifyCharRefs
     Character references notification.
protected  booleanfParserSettings
    
final protected static  StringfQuotSymbol
     Symbol: "quot".
protected  booleanfReportEntity
     Report entity boundary.
final protected  XMLResourceIdentifierImplfResourceIdentifier
    
protected  booleanfScanningAttribute
     Scanning attribute.
final protected static  StringfStandaloneSymbol
     Symbol: "standalone".
protected  SymbolTablefSymbolTable
     Symbol table.
protected  booleanfValidation
     Validation.
final protected static  StringfVersionSymbol
     Symbol: "version".


Method Summary
public  voidendEntity(String name, Augmentations augs)
     This method notifies the end of an entity.
public  booleangetFeature(String featureId)
    
protected  StringgetVersionNotSupportedKey()
    
protected  booleanisInvalid(int value)
    
protected  booleanisInvalidLiteral(int value)
    
protected  intisUnchangedByNormalization(XMLString value)
     Checks whether this string would be unchanged by normalization.
protected  booleanisValidNCName(int value)
    
protected  booleanisValidNameChar(int value)
    
protected  booleanisValidNameStartChar(int value)
    
protected  booleanisValidNameStartHighSurrogate(int value)
    
protected  voidnormalizeWhitespace(XMLString value)
     Normalize whitespace in an XMLString converting all whitespace characters to space characters.
protected  voidnormalizeWhitespace(XMLString value, int fromIndex)
     Normalize whitespace in an XMLString converting all whitespace characters to space characters.
protected  voidreportFatalError(String msgId, Object[] args)
     Convenience function used in all XML scanners.
public  voidreset(XMLComponentManager componentManager)
    
protected  voidreset()
    
protected  booleanscanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName)
     Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
Parameters:
  value - The XMLString to fill in with the value.
Parameters:
  nonNormalizedValue - The XMLString to fill in with the non-normalized value.
Parameters:
  atName - The name of the attribute being parsed (for error msgs).
Parameters:
  checkEntities - true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation.
Parameters:
  eleName - The name of element to which this attribute belongs.
protected  intscanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2)
     Scans a character reference and append the corresponding chars to the specified buffer.
protected  voidscanComment(XMLStringBuffer text)
     Scans a comment.
protected  voidscanExternalID(String[] identifiers, boolean optionalSystemId)
     Scans External ID and return the public and system IDs.
protected  voidscanPI()
     Scans a processing instruction.
protected  voidscanPIData(String target, XMLString data)
     Scans a processing data.
public  StringscanPseudoAttribute(boolean scanningTextDecl, XMLString value)
     Scans a pseudo attribute.
Parameters:
  scanningTextDecl - True if scanning this pseudo-attribute for aTextDecl; false if scanning XMLDecl.
protected  booleanscanPubidLiteral(XMLString literal)
     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.
Parameters:
  literal - The string to fill in with the public ID literal.
protected  booleanscanSurrogates(XMLStringBuffer buf)
     Scans surrogates and append them to the specified buffer.

Note: This assumes the current char has already been identified as a high surrogate.
Parameters:
  buf - The StringBuffer to append the read surrogates to.

protected  voidscanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues)
     Scans an XML or text declaration.
public  voidsetFeature(String featureId, boolean value)
    
public  voidsetProperty(String propertyId, Object value)
     Sets the value of a property during parsing.
public  voidstartEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
     This method notifies of the start of an entity.
protected  booleanversionSupported(String version)
    

Field Detail
DEBUG_ATTR_NORMALIZATION
final protected static boolean DEBUG_ATTR_NORMALIZATION(Code)
Debug attribute normalization.



ENTITY_MANAGER
final protected static String ENTITY_MANAGER(Code)
Property identifier: entity manager.



ERROR_REPORTER
final protected static String ERROR_REPORTER(Code)
Property identifier: error reporter.



NAMESPACES
final protected static String NAMESPACES(Code)
Feature identifier: namespaces.



NOTIFY_CHAR_REFS
final protected static String NOTIFY_CHAR_REFS(Code)
Feature identifier: notify character references.



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.



fAmpSymbol
final protected static String fAmpSymbol(Code)
Symbol: "amp".



fAposSymbol
final protected static String fAposSymbol(Code)
Symbol: "apos".



fCharRefLiteral
protected String fCharRefLiteral(Code)
Literal value of the last character refence scanned.



fEncodingSymbol
final protected static String fEncodingSymbol(Code)
Symbol: "encoding".



fEntityDepth
protected int fEntityDepth(Code)
Entity depth.



fEntityManager
protected XMLEntityManager fEntityManager(Code)
Entity manager.



fEntityScanner
protected XMLEntityScanner fEntityScanner(Code)
Entity scanner.



fErrorReporter
protected XMLErrorReporter fErrorReporter(Code)
Error reporter.



fGtSymbol
final protected static String fGtSymbol(Code)
Symbol: "gt".



fLtSymbol
final protected static String fLtSymbol(Code)
Symbol: "lt".



fNamespaces
protected boolean fNamespaces(Code)
Namespaces.



fNotifyCharRefs
protected boolean fNotifyCharRefs(Code)
Character references notification.



fParserSettings
protected boolean fParserSettings(Code)
Internal parser-settings feature



fQuotSymbol
final protected static String fQuotSymbol(Code)
Symbol: "quot".



fReportEntity
protected boolean fReportEntity(Code)
Report entity boundary.



fResourceIdentifier
final protected XMLResourceIdentifierImpl fResourceIdentifier(Code)



fScanningAttribute
protected boolean fScanningAttribute(Code)
Scanning attribute.



fStandaloneSymbol
final protected static String fStandaloneSymbol(Code)
Symbol: "standalone".



fSymbolTable
protected SymbolTable fSymbolTable(Code)
Symbol table.



fValidation
protected boolean fValidation(Code)
Validation. This feature identifier is: http://xml.org/sax/features/validation



fVersionSymbol
final protected static String fVersionSymbol(Code)
Symbol: "version".





Method Detail
endEntity
public void endEntity(String name, Augmentations augs) throws XNIException(Code)
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.
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.



getFeature
public boolean getFeature(String featureId) throws XMLConfigurationException(Code)



getVersionNotSupportedKey
protected String getVersionNotSupportedKey()(Code)



isInvalid
protected boolean isInvalid(int value)(Code)



isInvalidLiteral
protected boolean isInvalidLiteral(int value)(Code)



isUnchangedByNormalization
protected int isUnchangedByNormalization(XMLString value)(Code)
Checks whether this string would be unchanged by normalization. -1 if the value would be unchanged by normalization,otherwise the index of the first whitespace character whichwould be transformed.



isValidNCName
protected boolean isValidNCName(int value)(Code)



isValidNameChar
protected boolean isValidNameChar(int value)(Code)



isValidNameStartChar
protected boolean isValidNameStartChar(int value)(Code)



isValidNameStartHighSurrogate
protected boolean isValidNameStartHighSurrogate(int value)(Code)



normalizeWhitespace
protected void normalizeWhitespace(XMLString value)(Code)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.



normalizeWhitespace
protected void normalizeWhitespace(XMLString value, int fromIndex)(Code)
Normalize whitespace in an XMLString converting all whitespace characters to space characters.



reportFatalError
protected void reportFatalError(String msgId, Object[] args) throws XNIException(Code)
Convenience function used in all XML scanners.



reset
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)

Parameters:
  componentManager - The component manager.
throws:
  SAXException - Throws exception if required features andproperties cannot be found.



reset
protected void reset()(Code)



scanAttributeValue
protected boolean scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName) throws IOException, XNIException(Code)
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
Parameters:
  value - The XMLString to fill in with the value.
Parameters:
  nonNormalizedValue - The XMLString to fill in with the non-normalized value.
Parameters:
  atName - The name of the attribute being parsed (for error msgs).
Parameters:
  checkEntities - true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation.
Parameters:
  eleName - The name of element to which this attribute belongs. true if the non-normalized and normalized value are the sameNote: This method uses fStringBuffer2, anything in itat the time of calling is lost.



scanCharReferenceValue
protected int scanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2) throws IOException, XNIException(Code)
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.
Parameters:
  buf - the character buffer to append chars to
Parameters:
  buf2 - the character buffer to append non-normalized chars to the character value or (-1) on conversion failure



scanComment
protected void scanComment(XMLStringBuffer text) throws IOException, XNIException(Code)
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.
Parameters:
  text - The buffer to fill in with the text.




scanExternalID
protected void scanExternalID(String[] identifiers, boolean optionalSystemId) throws IOException, XNIException(Code)
Scans External ID and return the public and system IDs.
Parameters:
  identifiers - An array of size 2 to return the system id,and public id (in that order).
Parameters:
  optionalSystemId - Specifies whether the system id is optional.Note: This method uses fString and fStringBuffer,anything in them at the time of calling is lost.



scanPI
protected void scanPI() throws IOException, XNIException(Code)
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.



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) Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
Parameters:
  target - The PI target
Parameters:
  data - The string to fill in with the data



scanPseudoAttribute
public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) throws IOException, XNIException(Code)
Scans a pseudo attribute.
Parameters:
  scanningTextDecl - True if scanning this pseudo-attribute for aTextDecl; false if scanning XMLDecl. This flag is needed to report the correct type oferror.
Parameters:
  value - The string to fill in with the attribute value. The name of the attributeNote: This method uses fStringBuffer2, anything in itat the time of calling is lost.



scanPubidLiteral
protected boolean scanPubidLiteral(XMLString literal) throws IOException, XNIException(Code)
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.
Parameters:
  literal - The string to fill in with the public ID literal. True on success.Note: This method uses fStringBuffer, anything in it atthe time of calling is lost.



scanSurrogates
protected boolean scanSurrogates(XMLStringBuffer buf) throws IOException, XNIException(Code)
Scans surrogates and append them to the specified buffer.

Note: This assumes the current char has already been identified as a high surrogate.
Parameters:
  buf - The StringBuffer to append the read surrogates to. True if it succeeded.




scanXMLDeclOrTextDecl
protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues) throws IOException, XNIException(Code)
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 ::= ''
 

Parameters:
  scanningTextDecl - True if a text declaration is tobe scanned instead of an XMLdeclaration.
Parameters:
  pseudoAttributeValues - An array of size 3 to return the version,encoding and standalone pseudo attribute values(in that order).Note: This method uses fString, anything in itat the time of calling is lost.



setFeature
public void setFeature(String featureId, boolean value) throws XMLConfigurationException(Code)



setProperty
public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)
Sets the value of a property during parsing.
Parameters:
  propertyId -
Parameters:
  value -



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 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.
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.



versionSupported
protected boolean versionSupported(String version)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.