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


java.lang.Object
   com.sun.xml.stream.buffer.XMLStreamBuffer

All known Subclasses:   com.sun.xml.stream.buffer.XMLStreamBufferMark,  com.sun.xml.stream.buffer.MutableXMLStreamBuffer,
XMLStreamBuffer
abstract public class XMLStreamBuffer (Code)
An immutable stream-based buffer of an XML infoset.

A XMLStreamBuffer is an abstract class. It is immutable with respect to the methods on the class, which are non-modifying in terms of state.

A XMLStreamBuffer can be processed using specific SAX and StAX-based processors. Utility methods on XMLStreamBuffer are provided for such functionality that utilize SAX and StAX-based processors. The same instance of a XMLStreamBuffer may be processed multiple times and concurrently by more than one processor.

There are two concrete implementations of XMLStreamBuffer. The first, MutableXMLStreamBuffer , can be instantiated for the creation of a buffer using SAX and StAX-based creators, and from which may be processed as an XMLStreamBuffer. The second, XMLStreamBufferMark , can be instantiated to mark into an existing buffer that is being created or processed. This allows a subtree of XMLStreamBuffer to be treated as its own XMLStreamBuffer .

A XMLStreamBuffer can represent a complete XML infoset or a subtree of an XML infoset. It is also capable of representing a "forest", where the buffer represents multiple adjacent XML elements, although in this mode there are restrictions about how you can consume such forest, because not all XML APIs handle forests very well.



Field Summary
protected  FragmentedArray<char[]>_contentCharactersBuffer
    
protected  int_contentCharactersBufferPtr
    
protected  FragmentedArray<Object[]>_contentObjects
    
protected  int_contentObjectsPtr
    
protected  boolean_hasInternedStrings
    
protected  Map<String, String>_inscopeNamespaces
    
protected  FragmentedArray<byte[]>_structure
    
protected  int_structurePtr
    
protected  FragmentedArray<String[]>_structureStrings
    
protected  int_structureStringsPtr
    
protected  StringsystemId
    
protected  inttreeCount
     Number of trees in this stream buffer.

1 if there's only one, which is the normal case.



Method Summary
public static  XMLStreamBuffercreateNewBufferFromXMLReader(XMLReader reader, InputStream in)
     Create a new buffer from a XMLReader and InputStream .
Parameters:
  reader - The XMLReader to use for parsing.
Parameters:
  in - The InputStream to be parsed.
public static  XMLStreamBuffercreateNewBufferFromXMLReader(XMLReader reader, InputStream in, String systemId)
     Create a new buffer from a XMLReader and InputStream .
Parameters:
  reader - The XMLReader to use for parsing.
Parameters:
  in - The InputStream to be parsed.
Parameters:
  systemId - The system ID of the input stream.
public static  XMLStreamBuffercreateNewBufferFromXMLStreamReader(XMLStreamReader reader)
     Create a new buffer from a XMLStreamReader.
Parameters:
  reader - A XMLStreamReader to read from to create.
final protected  FragmentedArray<char[]>getContentCharactersBuffer()
    
final protected  intgetContentCharactersBufferPtr()
    
final protected  FragmentedArray<Object[]>getContentObjects()
    
final protected  intgetContentObjectsPtr()
    
final public  Map<String, String>getInscopeNamespaces()
     Get the in-scope namespaces.

The in-scope namespaces will be empty if the buffer is not a fragment ( XMLStreamBuffer.isFragment returns false). The in-scope namespace will correspond to the in-scope namespaces of the fragment if the buffer is a fragment ( XMLStreamBuffer.isFragment returns false).

final protected  FragmentedArray<byte[]>getStructure()
    
final protected  intgetStructurePtr()
    
final protected  FragmentedArray<String[]>getStructureStrings()
    
final protected  intgetStructureStringsPtr()
    
final public  StringgetSystemId()
     Get the system identifier associated with the buffer.
final public  booleanhasInternedStrings()
     Has the buffer been created using Strings that have been interned for certain properties of information items.
final public  booleanisCreated()
     Is the buffer created by creator.
final public  booleanisElementFragment()
     Is the buffer a representation of a fragment of an XML infoset that is an element (and its contents).
final public  booleanisForest()
     Returns ture if this buffer represents a forest, which is are more than one adjacent XML elements.
final public  booleanisFragment()
     Is the buffer a representation of a fragment of an XML infoset.
final public  SAXBufferProcessorreadAsXMLReader()
     Reads the contents of the buffer from a XMLReader .
final public  SAXBufferProcessorreadAsXMLReader(boolean produceFragmentEvent)
     Reads the contents of the buffer from a XMLReader .
final public  StreamReaderBufferProcessorreadAsXMLStreamReader()
     Read the contents of the buffer as a XMLStreamReader . A an instance of a StreamReaderBufferProcessor.
final public  voidwriteTo(ContentHandler handler, boolean produceFragmentEvent)
     Write the contents of the buffer to a ContentHandler .
final public  voidwriteTo(ContentHandler handler)
    
final public  voidwriteTo(ContentHandler handler, ErrorHandler errorHandler, boolean produceFragmentEvent)
     Write the contents of the buffer to a ContentHandler with errors report to a ErrorHandler .
final public  voidwriteTo(ContentHandler handler, ErrorHandler errorHandler)
    
final public  NodewriteTo(Node n)
     Writes out the contents of this buffer as DOM node and append that to the given node.
final public  voidwriteToXMLStreamWriter(XMLStreamWriter writer, boolean writeAsFragment)
     Write the contents of the buffer to an XMLStreamWriter.

The XMLStreamBuffer will be written out to the XMLStreamWriter using an instance of StreamWriterBufferProcessor .
Parameters:
  writer - A XMLStreamWriter to write to.
Parameters:
  writeAsFragment - If true, XMLStreamWriter will not receive XMLStreamWriter.writeStartDocumentnor XMLStreamWriter.writeEndDocument.

final public  voidwriteToXMLStreamWriter(XMLStreamWriter writer)
    

Field Detail
_contentCharactersBuffer
protected FragmentedArray<char[]> _contentCharactersBuffer(Code)
Fragmented array to hold content information in a shared char[]



_contentCharactersBufferPtr
protected int _contentCharactersBufferPtr(Code)



_contentObjects
protected FragmentedArray<Object[]> _contentObjects(Code)
Fragmented array to hold content information as objects



_contentObjectsPtr
protected int _contentObjectsPtr(Code)



_hasInternedStrings
protected boolean _hasInternedStrings(Code)
True if the buffer was created from a parser that interns Strings as specified by the SAX interning features



_inscopeNamespaces
protected Map<String, String> _inscopeNamespaces(Code)
In scope namespaces on a fragment



_structure
protected FragmentedArray<byte[]> _structure(Code)
Fragmented array to hold structural information



_structurePtr
protected int _structurePtr(Code)



_structureStrings
protected FragmentedArray<String[]> _structureStrings(Code)
Fragmented array to hold structural information as strings



_structureStringsPtr
protected int _structureStringsPtr(Code)



systemId
protected String systemId(Code)
The system identifier associated with the buffer



treeCount
protected int treeCount(Code)
Number of trees in this stream buffer.

1 if there's only one, which is the normal case. When the buffer holds a forest, this value is greater than 1. If the buffer is empty, then 0.

Notice that we cannot infer this value by looking at the FragmentedArray s, because this XMLStreamBuffer maybe a view of a portion of another bigger XMLStreamBuffer .






Method Detail
createNewBufferFromXMLReader
public static XMLStreamBuffer createNewBufferFromXMLReader(XMLReader reader, InputStream in) throws SAXException, IOException(Code)
Create a new buffer from a XMLReader and InputStream .
Parameters:
  reader - The XMLReader to use for parsing.
Parameters:
  in - The InputStream to be parsed. XMLStreamBuffer the created buffer
See Also:   MutableXMLStreamBuffer.createFromXMLReader(XMLReaderInputStream)



createNewBufferFromXMLReader
public static XMLStreamBuffer createNewBufferFromXMLReader(XMLReader reader, InputStream in, String systemId) throws SAXException, IOException(Code)
Create a new buffer from a XMLReader and InputStream .
Parameters:
  reader - The XMLReader to use for parsing.
Parameters:
  in - The InputStream to be parsed.
Parameters:
  systemId - The system ID of the input stream. XMLStreamBuffer the created buffer
See Also:   MutableXMLStreamBuffer.createFromXMLReader(XMLReaderInputStreamString)



createNewBufferFromXMLStreamReader
public static XMLStreamBuffer createNewBufferFromXMLStreamReader(XMLStreamReader reader) throws XMLStreamException(Code)
Create a new buffer from a XMLStreamReader.
Parameters:
  reader - A XMLStreamReader to read from to create. XMLStreamBuffer the created buffer
See Also:   MutableXMLStreamBuffer.createFromXMLStreamReader(XMLStreamReader)



getContentCharactersBuffer
final protected FragmentedArray<char[]> getContentCharactersBuffer()(Code)



getContentCharactersBufferPtr
final protected int getContentCharactersBufferPtr()(Code)



getContentObjects
final protected FragmentedArray<Object[]> getContentObjects()(Code)



getContentObjectsPtr
final protected int getContentObjectsPtr()(Code)



getInscopeNamespaces
final public Map<String, String> getInscopeNamespaces()(Code)
Get the in-scope namespaces.

The in-scope namespaces will be empty if the buffer is not a fragment ( XMLStreamBuffer.isFragment returns false). The in-scope namespace will correspond to the in-scope namespaces of the fragment if the buffer is a fragment ( XMLStreamBuffer.isFragment returns false). The in-scope namespaces will include any namespace delcarations on an element if the fragment correspond to that of an element ( XMLStreamBuffer.isElementFragment returns false). The in-scope namespaces of the XMLStreamBuffer.Prefix to namespace URI.




getStructure
final protected FragmentedArray<byte[]> getStructure()(Code)



getStructurePtr
final protected int getStructurePtr()(Code)



getStructureStrings
final protected FragmentedArray<String[]> getStructureStrings()(Code)



getStructureStringsPtr
final protected int getStructureStringsPtr()(Code)



getSystemId
final public String getSystemId()(Code)
Get the system identifier associated with the buffer. The system identifier.



hasInternedStrings
final public boolean hasInternedStrings()(Code)
Has the buffer been created using Strings that have been interned for certain properties of information items. The Strings that are interned are those that correspond to Strings that are specified by the SAX API "string-interning" property (see here).

An buffer may have been created, for example, from an XML document parsed using the Xerces SAX parser. The Xerces SAX parser will have interned certain Strings according to the SAX string interning property. This method enables processors to avoid the duplication of String interning if such a feature is required by a procesing application and the buffer being processed was created using Strings that have been interned. true if the buffer has been created using Strings thathave been interned.




isCreated
final public boolean isCreated()(Code)
Is the buffer created by creator. true if the buffer has been created.



isElementFragment
final public boolean isElementFragment()(Code)
Is the buffer a representation of a fragment of an XML infoset that is an element (and its contents). true if the buffer a representationof a fragment of an XML infoset that is an element (and its contents).



isForest
final public boolean isForest()(Code)
Returns ture if this buffer represents a forest, which is are more than one adjacent XML elements.



isFragment
final public boolean isFragment()(Code)
Is the buffer a representation of a fragment of an XML infoset. true if the buffer is a representation of a fragmentof an XML infoset.



readAsXMLReader
final public SAXBufferProcessor readAsXMLReader()(Code)
Reads the contents of the buffer from a XMLReader . A an instance of a SAXBufferProcessor.XMLStreamBuffer.readAsXMLReader(boolean)



readAsXMLReader
final public SAXBufferProcessor readAsXMLReader(boolean produceFragmentEvent)(Code)
Reads the contents of the buffer from a XMLReader .
Parameters:
  produceFragmentEvent - True to generate fragment SAX events without start/endDocument.False to generate a full document SAX events.A an instance of a SAXBufferProcessor.



readAsXMLStreamReader
final public StreamReaderBufferProcessor readAsXMLStreamReader() throws XMLStreamException(Code)
Read the contents of the buffer as a XMLStreamReader . A an instance of a StreamReaderBufferProcessor. Always non-null.



writeTo
final public void writeTo(ContentHandler handler, boolean produceFragmentEvent) throws SAXException(Code)
Write the contents of the buffer to a ContentHandler .

If the handler is also an instance of other SAX-based handlers, such as LexicalHandler , than corresponding SAX events will be reported to those handlers.
Parameters:
  handler - The ContentHandler to receive SAX events.
Parameters:
  produceFragmentEvent - True to generate fragment SAX events without start/endDocument.False to generate a full document SAX events.
throws:
  SAXException - if a parsing fails, or if ContentHandler throws a SAXException.




writeTo
final public void writeTo(ContentHandler handler) throws SAXException(Code)
XMLStreamBuffer.writeTo(ContentHandler,boolean)



writeTo
final public void writeTo(ContentHandler handler, ErrorHandler errorHandler, boolean produceFragmentEvent) throws SAXException(Code)
Write the contents of the buffer to a ContentHandler with errors report to a ErrorHandler .

If the handler is also an instance of other SAX-based handlers, such as LexicalHandler , than corresponding SAX events will be reported to those handlers.
Parameters:
  handler - The ContentHandler to receive SAX events.
Parameters:
  errorHandler - The ErrorHandler to receive error events.
throws:
  SAXException - if a parsing fails and ErrorHandler throws a SAXException,or if ContentHandler throws a SAXException.




writeTo
final public void writeTo(ContentHandler handler, ErrorHandler errorHandler) throws SAXException(Code)



writeTo
final public Node writeTo(Node n) throws XMLStreamBufferException(Code)
Writes out the contents of this buffer as DOM node and append that to the given node. Faster implementation would be desirable. The newly added child node.



writeToXMLStreamWriter
final public void writeToXMLStreamWriter(XMLStreamWriter writer, boolean writeAsFragment) throws XMLStreamException(Code)
Write the contents of the buffer to an XMLStreamWriter.

The XMLStreamBuffer will be written out to the XMLStreamWriter using an instance of StreamWriterBufferProcessor .
Parameters:
  writer - A XMLStreamWriter to write to.
Parameters:
  writeAsFragment - If true, XMLStreamWriter will not receive XMLStreamWriter.writeStartDocumentnor XMLStreamWriter.writeEndDocument. This is desirable behavior whenyou are writing the contents of a buffer into a bigger document.




writeToXMLStreamWriter
final public void writeToXMLStreamWriter(XMLStreamWriter writer) throws XMLStreamException(Code)
XMLStreamBuffer.writeToXMLStreamWriter(XMLStreamWriter,boolean)



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.