Java Doc for XMLScanner.java in  » 6.0-JDK-Modules » sjsxp » com » sun » xml » stream » 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 » 6.0 JDK Modules » sjsxp » com.sun.xml.stream 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.xml.stream.XMLScanner

All known Subclasses:   com.sun.xml.stream.XMLDTDScannerImpl,  com.sun.xml.stream.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://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
author:
   K.Venugopal SUN Microsystems
version:
   $Id: XMLScanner.java,v 1.5 2006/11/29 22:01:32 spericas Exp $


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  StringNOTIFY_CHAR_REFS
     Feature identifier: notify character references.
final protected static  StringSYMBOL_TABLE
     Property identifier: symbol table.
final protected static  StringVALIDATION
     Feature identifier: validation.
protected  ArrayListattributeValueCache
    
final protected static  StringfAmpSymbol
     Symbol: "amp".
final protected static  StringfAposSymbol
     Symbol: "apos".
protected  booleanfAttributeCacheInitDone
    
protected  intfAttributeCacheUsedCount
    
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  XMLEntityReaderImplfEntityScanner
     Entity scanner, this alwasy works on last entity that was opened.
protected  XMLEntityStoragefEntityStore
    
protected  XMLErrorReporterfErrorReporter
     Error reporter.
protected  XMLEventfEvent
    
final protected static  StringfGtSymbol
     Symbol: "gt".
final protected static  StringfLtSymbol
     Symbol: "lt".
protected  booleanfNotifyCharRefs
     Character references notification.
protected  PropertyManagerfPropertyManager
    
final protected static  StringfQuotSymbol
     Symbol: "quot".
protected  booleanfReportEntity
     Report entity boundary.
protected  XMLResourceIdentifierImplfResourceIdentifier
    
protected  booleanfScanningAttribute
     Scanning attribute.
final protected static  StringfStandaloneSymbol
     Symbol: "standalone".
protected  intfStringBufferIndex
    
protected  SymbolTablefSymbolTable
     Symbol table.
protected  booleanfValidation
     Validation.
final protected static  StringfVersionSymbol
     Symbol: "version".
 intinitialCacheCount
    
protected  ArrayListstringBufferCache
    


Method Summary
public  voidendEntity(String name)
     This method notifies the end of an entity.
public  booleangetFeature(String featureId)
    
 XMLStringBuffergetStringBuffer()
    
protected static  booleanisInvalid(int value)
    
protected static  booleanisInvalidLiteral(int value)
    
protected static  booleanisValidNCName(int value)
    
protected static  booleanisValidNameChar(int value)
    
protected static  booleanisValidNameStartChar(int value)
    
protected  voidnormalizeWhitespace(XMLString value)
     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)
    
public  voidreset(PropertyManager propertyManager)
    
protected  voidscanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, XMLAttributes attributes, int attrIndex, boolean checkEntities)
     Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters.
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(XMLStringBuffer data)
     Scans a processing instruction.
protected  voidscanPIData(String target, XMLStringBuffer 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.
protected  voidsetPropertyManager(PropertyManager propertyManager)
    
public  voidstartEntity(String name, XMLResourceIdentifier identifier, String encoding)
     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.



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



SYMBOL_TABLE
final protected static String SYMBOL_TABLE(Code)
Property identifier: symbol table.



VALIDATION
final protected static String VALIDATION(Code)
Feature identifier: validation.



attributeValueCache
protected ArrayList attributeValueCache(Code)



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



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



fAttributeCacheInitDone
protected boolean fAttributeCacheInitDone(Code)



fAttributeCacheUsedCount
protected int fAttributeCacheUsedCount(Code)



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 XMLEntityReaderImpl fEntityScanner(Code)
Entity scanner, this alwasy works on last entity that was opened.



fEntityStore
protected XMLEntityStorage fEntityStore(Code)
xxx this should be available from EntityManager Entity storage



fErrorReporter
protected XMLErrorReporter fErrorReporter(Code)
Error reporter.



fEvent
protected XMLEvent fEvent(Code)
event type



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



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



fNotifyCharRefs
protected boolean fNotifyCharRefs(Code)
Character references notification.



fPropertyManager
protected PropertyManager fPropertyManager(Code)



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



fReportEntity
protected boolean fReportEntity(Code)
Report entity boundary.



fResourceIdentifier
protected XMLResourceIdentifierImpl fResourceIdentifier(Code)



fScanningAttribute
protected boolean fScanningAttribute(Code)
Scanning attribute.



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



fStringBufferIndex
protected int fStringBufferIndex(Code)



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



initialCacheCount
int initialCacheCount(Code)



stringBufferCache
protected ArrayList stringBufferCache(Code)





Method Detail
endEntity
public void endEntity(String name) throws IOException, 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.
throws:
  XNIException - Thrown by handler to signal an error.



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



getStringBuffer
XMLStringBuffer getStringBuffer()(Code)



isInvalid
protected static boolean isInvalid(int value)(Code)



isInvalidLiteral
protected static boolean isInvalidLiteral(int value)(Code)



isValidNCName
protected static boolean isValidNCName(int value)(Code)



isValidNameChar
protected static boolean isValidNameChar(int value)(Code)



isValidNameStartChar
protected static boolean isValidNameStartChar(int value)(Code)



normalizeWhitespace
protected void normalizeWhitespace(XMLString value)(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
public void reset(PropertyManager propertyManager)(Code)



scanAttributeValue
protected void scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, XMLAttributes attributes, int attrIndex, boolean checkEntities) 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 thenon-normalized value.
Parameters:
  atName - The name of the attribute being parsed (for error msgs).
Parameters:
  attributes - The attributes list for the scanned attribute.
Parameters:
  attrIndex - The index of the attribute to use from the list.
Parameters:
  checkEntities - true if undeclared entities should be reported as VC violation,false if undeclared entities should be reported as WFC violation.Note: 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(XMLStringBuffer data) throws IOException, XNIException(Code)
Scans a processing instruction.

 [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
 [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
 



scanPIData
protected void scanPIData(String target, XMLStringBuffer 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) This method would always read the whole data. We have while loop and data is buffered until delimeter is encountered.
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. Thisflag is needed to report the correct type oferror.
Parameters:
  value - The string to fill in with the attributevalue. 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 -



setPropertyManager
protected void setPropertyManager(PropertyManager propertyManager)(Code)



startEntity
public void startEntity(String name, XMLResourceIdentifier identifier, String encoding) 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).
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.