Java Doc for XMLReaderImpl.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.XMLReaderImpl

XMLReaderImpl
public class XMLReaderImpl implements javax.xml.stream.XMLStreamReader(Code)
This class implements javax.xml.stream.XMLStreamReader. It makes use of XML*Scanner classes to derive most of its functionality. If desired, Application can reuse this instance by calling reset() and setInputSource().
author:
   Neeraj Bajaj Sun Microsystems,Inc.
author:
   K.Venugopal Sun Microsystems,Inc.


Field Summary
final static  booleanDEBUG
    
final protected static  StringENTITY_MANAGER
     Property identifier: entity manager.
final protected static  StringERROR_REPORTER
     Property identifier: Error Reporter.
final protected static  StringSYMBOL_TABLE
     Property identifier: Symbol table.
protected  XMLEntityManagerfEntityManager
    
protected  XMLEntityReaderImplfEntityScanner
     Entity scanner, this alwasy works on last entity that was opened.
protected  StaxErrorReporterfErrorReporter
    
protected  XMLInputSourcefInputSource
    
protected  NamespaceContextWrapperfNamespaceContextWrapper
    
protected  PropertyManagerfPropertyManager
    
protected  XMLNSDocumentScannerImplfScanner
     Document scanner.

Constructor Summary
public  XMLReaderImpl(InputStream inputStream, PropertyManager props)
    
public  XMLReaderImpl(String systemid, PropertyManager props)
    
public  XMLReaderImpl(InputStream inputStream, String encoding, PropertyManager props)
    
public  XMLReaderImpl(Reader reader, PropertyManager props)
    
public  XMLReaderImpl(XMLInputSource inputSource, PropertyManager props)
    

Method Summary
public  booleancanReuse()
     This function tells if this instances is available for reuse.
public  voidclose()
     Frees any resources associated with this Reader.
 XMLInputSourceconvertSAXInputSource2XMLInputSource(InputSource inputSource)
     Convert SAX InputSource to XMLInputSource.
public  javax.xml.namespace.QNameconvertXNIQNametoJavaxQName(com.sun.xml.stream.xerces.xni.QName qname)
    
public  intgetAttributeCount()
     Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE.
public  StringgetAttributeLocalName(int index)
    
public  QNamegetAttributeName(int index)
    
public  StringgetAttributeNamespace(int index)
    
public  StringgetAttributePrefix(int index)
    
public  javax.xml.namespace.QNamegetAttributeQName(int index)
    
public  StringgetAttributeType(int index)
    
public  StringgetAttributeValue(int index)
    
public  StringgetAttributeValue(String namespaceURI, String localName)
    
public  StringgetCharacterEncodingScheme()
    
public  intgetColumnNumber()
    
public  StringgetElementText()
     Reads the content of a text-only element.
public  StringgetEncoding()
     Return input encoding if known or null if unknown.
protected  ListgetEntityDecls()
    
public  intgetEventType()
     Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD.
final static  StringgetEventTypeString(int eventType)
    
public  intgetLineNumber()
    
public  StringgetLocalName()
    
public  LocationgetLocation()
     Return the current location of the processor.
public  javax.xml.namespace.QNamegetName()
    
public  NamespaceContextgetNamespaceContext()
     Returns a read only namespace context for the current position.
public  intgetNamespaceCount()
     Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE.
public  StringgetNamespacePrefix(int index)
     Returns the prefix for the namespace declared at the index.
public  StringgetNamespaceURI()
    
public  StringgetNamespaceURI(int index)
     Returns the uri for the namespace declared at the index.
public  StringgetNamespaceURI(String prefix)
     Return the uri for the given prefix.
protected  ListgetNotationDecls()
    
public  StringgetPIData()
    
public  StringgetPITarget()
    
public  StringgetPrefix()
     Returns the prefix of the current event, or null if the event does not have a prefix.
public  ObjectgetProperty(java.lang.String name)
    
protected  PropertyManagergetPropertyManager()
    
public  StringgetText()
    
public  char[]getTextCharacters()
    
public  intgetTextCharacters(int sourceStart, char[] target, int targetStart, int length)
     Gets the the text associated with a CHARACTERS, SPACE or CDATA event. Text starting a "sourceStart" is copied into "destination" starting at "targetStart". Up to "length" characters are copied.
public  intgetTextLength()
    
public  intgetTextStart()
    
public  StringgetValue()
    
public  StringgetVersion()
    
public  booleanhasAttributes()
    
public  booleanhasName()
    
public  booleanhasNext()
    
public  booleanhasText()
    
public  booleanhasValue()
    
 voidinit(PropertyManager propertyManager)
    
public  booleanisAttributeSpecified(int index)
    
public  booleanisCharacters()
    
public  booleanisEndElement()
    
public  booleanisStandalone()
    
public  booleanisStartElement()
    
public  booleanisWhiteSpace()
     Returns true if the cursor points to a character data event that consists of all whitespace Application calling this method needs to cache the value and avoid calling this method again for the same event.
public  intnext()
    
public  intnextTag()
     Skips any insignificant events (COMMENT and PROCESSING_INSTRUCTION) until a START_ELEMENT or END_ELEMENT is reached.
static  voidpr(String str)
    
public  voidrequire(int type, String namespaceURI, String localName)
     Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event.
public  voidreset()
     Resets this instance so that this instance is ready for reuse.
public  voidsetInputSource(XMLInputSource inputSource)
    
public  voidsetInputSource(InputSource inputSource)
     Set the InputSource on this instance.
protected  voidsetPropertyManager(PropertyManager propertyManager)
    
public  booleanstandaloneSet()
    

Field Detail
DEBUG
final static boolean DEBUG(Code)
debug flag



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.



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



fEntityManager
protected XMLEntityManager fEntityManager(Code)



fEntityScanner
protected XMLEntityReaderImpl fEntityScanner(Code)
Entity scanner, this alwasy works on last entity that was opened.



fErrorReporter
protected StaxErrorReporter fErrorReporter(Code)



fInputSource
protected XMLInputSource fInputSource(Code)
Input Source



fNamespaceContextWrapper
protected NamespaceContextWrapper fNamespaceContextWrapper(Code)



fPropertyManager
protected PropertyManager fPropertyManager(Code)
Store properties



fScanner
protected XMLNSDocumentScannerImpl fScanner(Code)
Document scanner.




Constructor Detail
XMLReaderImpl
public XMLReaderImpl(InputStream inputStream, PropertyManager props) throws XMLStreamException(Code)

Parameters:
  inputStream -
Parameters:
  props -
throws:
  XMLStreamException -



XMLReaderImpl
public XMLReaderImpl(String systemid, PropertyManager props) throws XMLStreamException(Code)

Parameters:
  systemid -
Parameters:
  props -
throws:
  XMLStreamException -



XMLReaderImpl
public XMLReaderImpl(InputStream inputStream, String encoding, PropertyManager props) throws XMLStreamException(Code)

Parameters:
  inputStream -
Parameters:
  encoding -
Parameters:
  props -
throws:
  XMLStreamException -



XMLReaderImpl
public XMLReaderImpl(Reader reader, PropertyManager props) throws XMLStreamException(Code)

Parameters:
  reader -
Parameters:
  props -
throws:
  XMLStreamException -



XMLReaderImpl
public XMLReaderImpl(XMLInputSource inputSource, PropertyManager props) throws XMLStreamException(Code)

Parameters:
  inputSource -
Parameters:
  props -
throws:
  XMLStreamException -




Method Detail
canReuse
public boolean canReuse()(Code)
This function tells if this instances is available for reuse. One must call reset() and setInputSource() to be able to reuse this instance.



close
public void close() throws XMLStreamException(Code)
Frees any resources associated with this Reader. This method does not close the underlying input source.
throws:
  XMLStreamException - if there are errors freeing associated resources



convertSAXInputSource2XMLInputSource
XMLInputSource convertSAXInputSource2XMLInputSource(InputSource inputSource)(Code)
Convert SAX InputSource to XMLInputSource. XMLInputSource XNI XMLInputSource.



convertXNIQNametoJavaxQName
public javax.xml.namespace.QName convertXNIQNametoJavaxQName(com.sun.xml.stream.xerces.xni.QName qname)(Code)

Parameters:
  qname -



getAttributeCount
public int getAttributeCount()(Code)
Returns the count of attributes on this START_ELEMENT, this method is only valid on a START_ELEMENT or ATTRIBUTE. This count excludes namespace definitions. Attribute indices are zero-based. returns the number of attributes
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeLocalName
public String getAttributeLocalName(int index)(Code)

Parameters:
  index -



getAttributeName
public QName getAttributeName(int index)(Code)
Returns the localName of the attribute at the provided index
Parameters:
  index - the position of the attribute the localName of the attribute
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeNamespace
public String getAttributeNamespace(int index)(Code)
Returns the namespace of the attribute at the provided index
Parameters:
  index - the position of the attribute the namespace URI (can be null)
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributePrefix
public String getAttributePrefix(int index)(Code)
Returns the prefix of this attribute at the provided index
Parameters:
  index - the position of the attribute the prefix of the attribute
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeQName
public javax.xml.namespace.QName getAttributeQName(int index)(Code)
Returns the qname of the attribute at the provided index
Parameters:
  index - the position of the attribute the QName of the attribute
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeType
public String getAttributeType(int index)(Code)
Returns the XML type of the attribute at the provided index
Parameters:
  index - the position of the attribute the XML type of the attribute
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeValue
public String getAttributeValue(int index)(Code)
Returns the value of the attribute at the index
Parameters:
  index - the position of the attribute the attribute value
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



getAttributeValue
public String getAttributeValue(String namespaceURI, String localName)(Code)

Parameters:
  namespaceURI -
Parameters:
  localName -



getCharacterEncodingScheme
public String getCharacterEncodingScheme()(Code)
Returns the character encoding declared on the xml declaration Returns null if none was declared the encoding declared in the document or null



getColumnNumber
public int getColumnNumber()(Code)



getElementText
public String getElementText() throws XMLStreamException(Code)
Reads the content of a text-only element. Precondition: the current event is START_ELEMENT. Postcondition: The current event is the corresponding END_ELEMENT.
throws:
  XMLStreamException - if the current event is not a START_ELEMENT or ifa non text element is encountered



getEncoding
public String getEncoding()(Code)
Return input encoding if known or null if unknown. the encoding of this instance or null



getEntityDecls
protected List getEntityDecls()(Code)



getEventType
public int getEventType()(Code)
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events. the current text or null



getEventTypeString
final static String getEventTypeString(int eventType)(Code)



getLineNumber
public int getLineNumber()(Code)



getLocalName
public String getLocalName()(Code)



getLocation
public Location getLocation()(Code)
Return the current location of the processor. If the Location is unknown the processor should return an implementation of Location that returns -1 for the location and null for the publicId and systemId. The location information is only valid until next() is called.



getName
public javax.xml.namespace.QName getName()(Code)
Returns a QName for the current START_ELEMENT or END_ELEMENT event the QName for the current START_ELEMENT or END_ELEMENT event



getNamespaceContext
public NamespaceContext getNamespaceContext()(Code)
Returns a read only namespace context for the current position. The context is transient and only valid until a call to next() changes the state of the reader. return a namespace context



getNamespaceCount
public int getNamespaceCount()(Code)
Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT, this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On an END_ELEMENT the count is of the namespaces that are about to go out of scope. This is the equivalent of the information reported by SAX callback for an end element event. returns the number of namespace declarations on this specific element
throws:
  IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE



getNamespacePrefix
public String getNamespacePrefix(int index)(Code)
Returns the prefix for the namespace declared at the index. Returns null if this is the default namespace declaration
Parameters:
  index - the position of the namespace declaration returns the namespace prefix
throws:
  IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE



getNamespaceURI
public String getNamespaceURI()(Code)



getNamespaceURI
public String getNamespaceURI(int index)(Code)
Returns the uri for the namespace declared at the index.
Parameters:
  index - the position of the namespace declaration returns the namespace uri
throws:
  IllegalStateException - if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE



getNamespaceURI
public String getNamespaceURI(String prefix)(Code)
Return the uri for the given prefix. The uri returned depends on the current state of the processor.

NOTE:The 'xml' prefix is bound as defined in Namespaces in XML specification to "http://www.w3.org/XML/1998/namespace".

NOTE: The 'xmlns' prefix must be resolved to following namespace http://www.w3.org/2000/xmlns/ the uri bound to the given prefix or null if it is not bound
Parameters:
  prefix - The prefix to lookup, may not be null
throws:
  IllegalStateException - if the prefix is null




getNotationDecls
protected List getNotationDecls()(Code)



getPIData
public String getPIData()(Code)
Get the data section of a processing instruction the data or null



getPITarget
public String getPITarget()(Code)
Get the target of a processing instruction the target or null



getPrefix
public String getPrefix()(Code)
Returns the prefix of the current event, or null if the event does not have a prefix. For START_ELEMENT and END_ELEMENT, return XMLConstants.DEFAULT_NS_PREFIX when no prefix is available.



getProperty
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException(Code)
Get the value of a feature/property from the underlying implementation
Parameters:
  name - The name of the property, may not be null The value of the property
throws:
  IllegalArgumentException - if name is null



getPropertyManager
protected PropertyManager getPropertyManager()(Code)
returns the reference to property manager.



getText
public String getText()(Code)
Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, or the String value of the DTD the current text or null
throws:
  java.lang.IllegalStateException - if this state is nota valid text state.



getTextCharacters
public char[] getTextCharacters()(Code)



getTextCharacters
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException(Code)
Gets the the text associated with a CHARACTERS, SPACE or CDATA event. Text starting a "sourceStart" is copied into "destination" starting at "targetStart". Up to "length" characters are copied. The number of characters actually copied is returned. The "sourceStart" argument must be greater or equal to 0 and less than or equal to the number of characters associated with the event. Usually, one requests text starting at a "sourceStart" of 0. If the number of characters actually copied is less than the "length", then there is no more text. Otherwise, subsequent calls need to be made until all text has been retrieved. For example: int length = 1024; char[] myBuffer = new char[ length ]; for ( int sourceStart = 0 ; ; sourceStart += length ) { int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length ); if (nCopied < length) break; } XMLStreamException may be thrown if there are any XML errors in the underlying source. The "targetStart" argument must be greater than or equal to 0 and less than the length of "target", Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".
Parameters:
  sourceStart - the index of the first character in the source array to copy
Parameters:
  target - the destination array
Parameters:
  targetStart - the start offset in the target array
Parameters:
  length - the number of characters to copy the number of characters actually copied
throws:
  XMLStreamException - if the underlying XML source is not well-formed
throws:
  IndexOutOfBoundsException - if targetStart < 0 or > than the length of target
throws:
  IndexOutOfBoundwhile - (isCharacters()) ;sException if length < 0 or targetStart + length > length of target
throws:
  UnsupportedOperationException - if this method is not supported
throws:
  NullPointerException - is if target is null



getTextLength
public int getTextLength()(Code)



getTextStart
public int getTextStart()(Code)



getValue
public String getValue()(Code)



getVersion
public String getVersion()(Code)
Get the XML language version of the current document being parsed



hasAttributes
public boolean hasAttributes()(Code)



hasName
public boolean hasName()(Code)
this Funtion returns true if the current event has name



hasNext
public boolean hasNext() throws XMLStreamException(Code)

throws:
  XMLStreamException -



hasText
public boolean hasText()(Code)
Return true if the current event has text, false otherwise The following events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT



hasValue
public boolean hasValue()(Code)



init
void init(PropertyManager propertyManager) throws XMLStreamException(Code)



isAttributeSpecified
public boolean isAttributeSpecified(int index)(Code)
Returns a boolean which indicates if this attribute was created by default
Parameters:
  index - the position of the attribute true if this is a default attribute
throws:
  IllegalStateException - if this is not a START_ELEMENT or ATTRIBUTE



isCharacters
public boolean isCharacters()(Code)
Returns true if the cursor points to a character data event true if the cursor points to character data, false otherwise



isEndElement
public boolean isEndElement()(Code)



isStandalone
public boolean isStandalone()(Code)



isStartElement
public boolean isStartElement()(Code)



isWhiteSpace
public boolean isWhiteSpace()(Code)
Returns true if the cursor points to a character data event that consists of all whitespace Application calling this method needs to cache the value and avoid calling this method again for the same event.



next
public int next() throws XMLStreamException(Code)

throws:
  XMLStreamException -



nextTag
public int nextTag() throws XMLStreamException(Code)
Skips any insignificant events (COMMENT and PROCESSING_INSTRUCTION) until a START_ELEMENT or END_ELEMENT is reached. If other than space characters are encountered, an exception is thrown. This method should be used when processing element-only content because the parser is not able to recognize ignorable whitespace if then DTD is missing or not interpreted. the event type of the element read
throws:
  XMLStreamException - if the current event is not white space



pr
static void pr(String str)(Code)



require
public void require(int type, String namespaceURI, String localName) throws XMLStreamException(Code)
Test if the current event is of the given type and if the namespace and name match the current namespace and name of the current event. If the namespaceURI is null it is not checked for equality, if the localName is null it is not checked for equality.
Parameters:
  type - the event type
Parameters:
  namespaceURI - the uri of the event, may be null
Parameters:
  localName - the localName of the event, may be null
throws:
  XMLStreamException - if the required values are not matched.



reset
public void reset()(Code)
Resets this instance so that this instance is ready for reuse.



setInputSource
public void setInputSource(XMLInputSource inputSource) throws XMLStreamException(Code)

Parameters:
  inputSource -
throws:
  XMLStreamException -



setInputSource
public void setInputSource(InputSource inputSource) throws XMLStreamException(Code)
Set the InputSource on this instance.
Parameters:
  InputSource - InputSource encapsulating information about XML Source.
throws:
  XMLStreamException - Throws XMLStreamException if there is a problem setting InputSource



setPropertyManager
protected void setPropertyManager(PropertyManager propertyManager)(Code)



standaloneSet
public boolean standaloneSet()(Code)
Checks if standalone was set in the document true if standalone was set in the document, or false otherwise



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.