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


java.lang.Object
   java.util.AbstractMap
      com.sun.xml.stream.writers.XMLStreamWriterImpl

XMLStreamWriterImpl
final public class XMLStreamWriterImpl extends AbstractMap implements XMLStreamWriter(Code)
This class implements a StAX XMLStreamWriter. It extends AbstractMap in order to support a getter for implementation-specific properties. For example, you can get the underlying OutputStream by casting an instance of this class to Map and calling getProperty(OUTPUTSTREAM_PROPERTY).
author:
   Neeraj Bajaj
author:
   K.Venugopal
author:
   Santiago.Pericas-Geertsen@sun.com
author:
   Sunitha.Reddy@sun.com

Inner Class :protected class ElementStack
Inner Class :class ElementState extends QName
Inner Class :class Attribute extends QName
Inner Class :class NamespaceContextImpl implements NamespaceContext

Field Summary
final public static  StringCLOSE_EMPTY_ELEMENT
    
final public static  charCLOSE_END_TAG
    
final public static  charCLOSE_START_TAG
    
final public static  StringDEFAULT_ENCODING
    
final public static  StringDEFAULT_XMLDECL
    
final public static  StringDEFAULT_XML_VERSION
    
final public static  StringEND_CDATA
    
final public static  StringEND_COMMENT
    
final public static  StringOPEN_END_TAG
    
final public static  charOPEN_START_TAG
    
final public static  StringOUTPUTSTREAM_PROPERTY
    
final public static  StringSPACE
    
final public static  StringSTART_CDATA
    
final public static  StringSTART_COMMENT
    
final public static  StringUTF_8
    
 booleanfEscapeCharacters
     This flag can be used to turn escaping off for content.

Constructor Summary
public  XMLStreamWriterImpl(OutputStream outputStream, PropertyManager props)
     Creates a new instance of XMLStreamWriterImpl.
public  XMLStreamWriterImpl(OutputStream outputStream, String encoding, PropertyManager props)
     Creates a new instance of XMLStreamWriterImpl.
public  XMLStreamWriterImpl(Writer writer, PropertyManager props)
     Creates a new instance of XMLStreamWriterImpl using a Writer.
public  XMLStreamWriterImpl(StreamResult sr, String encoding, PropertyManager props)
     Creates a new instance of XMLStreamWriterImpl using a StreamResult.

Method Summary
public  booleancanReuse()
    
 voidcheckForNull(QName attr)
    
public  voidclose()
     Close this XMLStreamWriter by closing underlying writer.
public  booleancontainsKey(Object key)
    
 voidcorrectPrefix(QName attr1, QName attr2)
    
public  java.util.SetentrySet()
    
public  voidflush()
     Flush this XMLStreamWriter by flushin underlying writer.
public  Objectget(Object key)
     Returns the value associated to an implementation-specific property.
public  booleangetEscapeCharacters()
    
public  NamespaceContextgetNamespaceContext()
     Return NamespaceContext being used by the writer.
public  StringgetPrefix(String uri)
     Return a prefix associated with specified uri, or null if the uri is unknown.
public  ObjectgetProperty(String str)
     Returns value associated with the specified property name.
 booleanisDeclared(QName attr)
    
public  booleanisEmpty()
    
 voidremoveDuplicateDecls()
    
protected  voidrepair()
     Correct's namespaces as per requirements of isReparisingNamespace property.
 voidrepairNamespaceDecl(QName attr)
    
public  voidreset()
     Reset this instance so that it can be re-used.
 voidreset(boolean resetProperties)
     Reset this instance so that it can be re-used.
public  voidsetDefaultNamespace(String uri)
     Set the specified URI as default namespace in the current namespace context.
public  voidsetEscapeCharacters(boolean escape)
    
public  voidsetNamespaceContext(NamespaceContext namespaceContext)
     Sets the current NamespaceContext for prefix and uri bindings. This context becomes the root namespace context for writing and will replace the current root namespace context.
public  voidsetOutput(StreamResult sr, String encoding)
     Use a StreamResult to initialize the output for this XMLStreamWriter.
public  voidsetPrefix(String prefix, String uri)
     Sets the prefix the uri is bound to.
public  intsize()
    
public  voidwriteAttribute(String localName, String value)
    
public  voidwriteAttribute(String namespaceURI, String localName, String value)
    
public  voidwriteAttribute(String prefix, String namespaceURI, String localName, String value)
    
public  voidwriteCData(String cdata)
    
public  voidwriteCharacters(String data)
    
public  voidwriteCharacters(char[] data, int start, int len)
    
public  voidwriteComment(String comment)
    
public  voidwriteDTD(String dtd)
    
public  voidwriteDefaultNamespace(String namespaceURI)
    
public  voidwriteEmptyElement(String localName)
    
public  voidwriteEmptyElement(String namespaceURI, String localName)
    
public  voidwriteEmptyElement(String prefix, String localName, String namespaceURI)
    
public  voidwriteEndDocument()
    
public  voidwriteEndElement()
    
public  voidwriteEntityRef(String refName)
    
public  voidwriteNamespace(String prefix, String namespaceURI)
     Write a Namespace declaration. If namespaceURI == null, then it is assumed to be equivilent to XMLConstants.NULL_NS_URI , i.e.
public  voidwriteProcessingInstruction(String target)
    
public  voidwriteProcessingInstruction(String target, String data)
    
public  voidwriteStartDocument()
    
public  voidwriteStartDocument(String version)
    
public  voidwriteStartDocument(String encoding, String version)
    
public  voidwriteStartElement(String localName)
    
public  voidwriteStartElement(String namespaceURI, String localName)
    
public  voidwriteStartElement(String prefix, String localName, String namespaceURI)
    

Field Detail
CLOSE_EMPTY_ELEMENT
final public static String CLOSE_EMPTY_ELEMENT(Code)



CLOSE_END_TAG
final public static char CLOSE_END_TAG(Code)



CLOSE_START_TAG
final public static char CLOSE_START_TAG(Code)



DEFAULT_ENCODING
final public static String DEFAULT_ENCODING(Code)



DEFAULT_XMLDECL
final public static String DEFAULT_XMLDECL(Code)



DEFAULT_XML_VERSION
final public static String DEFAULT_XML_VERSION(Code)



END_CDATA
final public static String END_CDATA(Code)



END_COMMENT
final public static String END_COMMENT(Code)



OPEN_END_TAG
final public static String OPEN_END_TAG(Code)



OPEN_START_TAG
final public static char OPEN_START_TAG(Code)



OUTPUTSTREAM_PROPERTY
final public static String OUTPUTSTREAM_PROPERTY(Code)



SPACE
final public static String SPACE(Code)



START_CDATA
final public static String START_CDATA(Code)



START_COMMENT
final public static String START_COMMENT(Code)



UTF_8
final public static String UTF_8(Code)



fEscapeCharacters
boolean fEscapeCharacters(Code)
This flag can be used to turn escaping off for content. It does not apply to attribute content.




Constructor Detail
XMLStreamWriterImpl
public XMLStreamWriterImpl(OutputStream outputStream, PropertyManager props) throws IOException(Code)
Creates a new instance of XMLStreamWriterImpl. Uses platform's default encoding.
Parameters:
  outputStream - Underlying stream to write the bytes to
Parameters:
  props - Properties used by this writer



XMLStreamWriterImpl
public XMLStreamWriterImpl(OutputStream outputStream, String encoding, PropertyManager props) throws java.io.IOException(Code)
Creates a new instance of XMLStreamWriterImpl.
Parameters:
  outputStream - Underlying stream to write the bytes
Parameters:
  encoding - Encoding used to convert chars into bytes
Parameters:
  props - Properties used by this writer



XMLStreamWriterImpl
public XMLStreamWriterImpl(Writer writer, PropertyManager props) throws java.io.IOException(Code)
Creates a new instance of XMLStreamWriterImpl using a Writer.
Parameters:
  writer - Underlying writer to which chars are written
Parameters:
  props - Properties used by this writer



XMLStreamWriterImpl
public XMLStreamWriterImpl(StreamResult sr, String encoding, PropertyManager props) throws java.io.IOException(Code)
Creates a new instance of XMLStreamWriterImpl using a StreamResult. A StreamResult encasupates an OutputStream, a Writer or a SystemId.
Parameters:
  writer - Underlying writer to which chars are written
Parameters:
  props - Properties used by this writer




Method Detail
canReuse
public boolean canReuse()(Code)
Can this instance be reused boolean boolean value to indicate if this instance can be reused or not



checkForNull
void checkForNull(QName attr)(Code)



close
public void close() throws XMLStreamException(Code)
Close this XMLStreamWriter by closing underlying writer.



containsKey
public boolean containsKey(Object key)(Code)



correctPrefix
void correctPrefix(QName attr1, QName attr2)(Code)



entrySet
public java.util.Set entrySet()(Code)



flush
public void flush() throws XMLStreamException(Code)
Flush this XMLStreamWriter by flushin underlying writer.



get
public Object get(Object key)(Code)
Returns the value associated to an implementation-specific property.



getEscapeCharacters
public boolean getEscapeCharacters()(Code)



getNamespaceContext
public NamespaceContext getNamespaceContext()(Code)
Return NamespaceContext being used by the writer. NamespaceContext



getPrefix
public String getPrefix(String uri) throws XMLStreamException(Code)
Return a prefix associated with specified uri, or null if the uri is unknown.
Parameters:
  uri - The namespace uri
throws:
  XMLStreamException - if uri specified is "" or null



getProperty
public Object getProperty(String str) throws IllegalArgumentException(Code)
Returns value associated with the specified property name.
Parameters:
  str - Property name
throws:
  IllegalArgumentException - if the specified property is not supported value associated with the specified property.



isDeclared
boolean isDeclared(QName attr)(Code)



isEmpty
public boolean isEmpty()(Code)



removeDuplicateDecls
void removeDuplicateDecls()(Code)



repair
protected void repair()(Code)
Correct's namespaces as per requirements of isReparisingNamespace property.



repairNamespaceDecl
void repairNamespaceDecl(QName attr)(Code)



reset
public void reset()(Code)
Reset this instance so that it can be re-used. Do not read properties again. The method setOutput(StreamResult, encoding) must be called after this one.



reset
void reset(boolean resetProperties)(Code)
Reset this instance so that it can be re-used. Clears but does not re-allocate internal data structures.
Parameters:
  resetProperties - Indicates if properties should be read again



setDefaultNamespace
public void setDefaultNamespace(String uri) throws XMLStreamException(Code)
Set the specified URI as default namespace in the current namespace context.
Parameters:
  uri - Namespace URI



setEscapeCharacters
public void setEscapeCharacters(boolean escape)(Code)



setNamespaceContext
public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException(Code)
Sets the current NamespaceContext for prefix and uri bindings. This context becomes the root namespace context for writing and will replace the current root namespace context. Subsequent calls to setPrefix and setDefaultNamespace will bind namespaces using the context passed to the method as the root context for resolving namespaces. This method may only be called once at the start of the document. It does not cause the namespaces to be declared. If a namespace URI to prefix mapping is found in the namespace context it is treated as declared and the prefix may be used by the XMLStreamWriter.
Parameters:
  namespaceContext - the namespace context to use for this writer, may not be null
throws:
  XMLStreamException -



setOutput
public void setOutput(StreamResult sr, String encoding) throws IOException(Code)
Use a StreamResult to initialize the output for this XMLStreamWriter. Check for OutputStream, Writer and then systemId, in that order.
Parameters:
  sr - StreamResult encapsulating output information
Parameters:
  encoding - Encoding to be used except when a Writer is available



setPrefix
public void setPrefix(String prefix, String uri) throws XMLStreamException(Code)
Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.
Parameters:
  prefix -
Parameters:
  uri -
throws:
  XMLStreamException -



size
public int size()(Code)



writeAttribute
public void writeAttribute(String localName, String value) throws XMLStreamException(Code)



writeAttribute
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException(Code)



writeAttribute
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException(Code)



writeCData
public void writeCData(String cdata) throws XMLStreamException(Code)



writeCharacters
public void writeCharacters(String data) throws XMLStreamException(Code)



writeCharacters
public void writeCharacters(char[] data, int start, int len) throws XMLStreamException(Code)



writeComment
public void writeComment(String comment) throws XMLStreamException(Code)



writeDTD
public void writeDTD(String dtd) throws XMLStreamException(Code)



writeDefaultNamespace
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException(Code)



writeEmptyElement
public void writeEmptyElement(String localName) throws XMLStreamException(Code)



writeEmptyElement
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException(Code)



writeEmptyElement
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException(Code)



writeEndDocument
public void writeEndDocument() throws XMLStreamException(Code)



writeEndElement
public void writeEndElement() throws XMLStreamException(Code)



writeEntityRef
public void writeEntityRef(String refName) throws XMLStreamException(Code)



writeNamespace
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException(Code)
Write a Namespace declaration. If namespaceURI == null, then it is assumed to be equivilent to XMLConstants.NULL_NS_URI , i.e. there is no Namespace.
Parameters:
  prefix - Prefix to bind.
Parameters:
  namespaceURI - NamespaceURI to declare.
throws:
  XMLStreamException -
See Also:    * Namespaces in XML, 5.2 Namespace Defaulting



writeProcessingInstruction
public void writeProcessingInstruction(String target) throws XMLStreamException(Code)



writeProcessingInstruction
public void writeProcessingInstruction(String target, String data) throws XMLStreamException(Code)

Parameters:
  target -
Parameters:
  data -
throws:
  XMLStreamException -



writeStartDocument
public void writeStartDocument() throws XMLStreamException(Code)

throws:
  XMLStreamException -



writeStartDocument
public void writeStartDocument(String version) throws XMLStreamException(Code)

Parameters:
  version -
throws:
  XMLStreamException -



writeStartDocument
public void writeStartDocument(String encoding, String version) throws XMLStreamException(Code)

Parameters:
  encoding -
Parameters:
  version -
throws:
  XMLStreamException -



writeStartElement
public void writeStartElement(String localName) throws XMLStreamException(Code)

Parameters:
  localName -
throws:
  XMLStreamException -



writeStartElement
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException(Code)

Parameters:
  namespaceURI -
Parameters:
  localName -
throws:
  XMLStreamException -



writeStartElement
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException(Code)

Parameters:
  prefix -
Parameters:
  localName -
Parameters:
  namespaceURI -
throws:
  XMLStreamException -



Methods inherited from java.util.AbstractMap
public void clear()(Code)(Java Doc)
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean containsKey(Object key)(Code)(Java Doc)
public boolean containsValue(Object value)(Code)(Java Doc)
abstract public Set<Entry<K, V>> entrySet()(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
public V get(Object key)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public Set<K> keySet()(Code)(Java Doc)
public V put(K key, V value)(Code)(Java Doc)
public void putAll(Map<? extends K, ? extends V> m)(Code)(Java Doc)
public V remove(Object key)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Collection<V> values()(Code)(Java Doc)

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.