Java Doc for XMLWriter.java in  » Web-Framework » RSF » uk » org » ponder » xml » 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 » Web Framework » RSF » uk.org.ponder.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   uk.org.ponder.xml.XMLWriter

XMLWriter
public class XMLWriter (Code)
A utility class to write XML data either raw or with XML/HTML entity escaping. An XMLWriter wraps either an OutputStream or a Writer, and supplies methods with similar names to Writer which escape all mandatory XML/HTML entities, and methods named with suffix Raw which write the data without transformation.


Field Summary
final public static  StringDEFAULT_ENCODING
    
final public static  intINDENT_WIDTH
     The number of characters to indent by for each nesting level of a tag to be written.
public static  String[]entitytable
    

Constructor Summary
public  XMLWriter(OutputStream os)
     Creates an XMLWriter wrapping the supplied OutputStream.
public  XMLWriter(Writer internalwriter)
     Creates an XMLWriter wrapping the supplied Writer.
public  XMLWriter(PrintOutputStream pos)
    

Method Summary
public  voidclose()
     Closes this XMLWriter object, in effect flushing it and making it unusable for any further write operations.
public  voidcloseTag(String tag, int nestinglevel, boolean writtenchildren)
    
public  voidflush()
     Flushes the wrapped stream.
public static  StringgetDefaultDeclaration()
     Returns the default declaration that will be written by the writeDeclaration method.
public  PrintOutputStreamgetInternalWriter()
    
public static  voidindent(int nestinglevel, PrintOutputStream writer)
    
final public  voidwrite(char[] towrite, int start, int length)
     Writes the supplied data to the wrapped stream, escaping all mandatory XML entities, being &, <, >, ". NB apostrophe is no longer encoded, since this seems to give a measurable Increase in speed.
public  voidwrite(String towrite)
     Writes the supplied data to the wrapped stream, escaping all mandatory XML/HTML entities, being &, <, >, " and '.
public  voidwriteDeclaration()
     Writes a default declaration to the wrapped stream.
final public static  voidwriteEntity(char c, PrintOutputStream pos)
    
public  voidwriteRaw(char[] towrite, int start, int length)
     Writes the supplied data to the wrapped stream without conversion.
public  XMLWriterwriteRaw(String tag)
     Writes the supplied string to the wrapped stream without conversion.
public  voidwriteRaw(String tag, int nestinglevel)
     Writes the supplied string to the wrapped stream with the specified indent level.
final public  voidwriteSlow(char[] towrite, int start, int length)
    

Field Detail
DEFAULT_ENCODING
final public static String DEFAULT_ENCODING(Code)
The default encoding to be used when writing byte streams - currently the UTF-8 encoding



INDENT_WIDTH
final public static int INDENT_WIDTH(Code)
The number of characters to indent by for each nesting level of a tag to be written. Some writeRaw methods accept a nesting level used as a multiplier for this factor.



entitytable
public static String[] entitytable(Code)




Constructor Detail
XMLWriter
public XMLWriter(OutputStream os)(Code)
Creates an XMLWriter wrapping the supplied OutputStream. Character data is converted using the default encoding scheme above
Parameters:
  os - The output stream to be wrapped.



XMLWriter
public XMLWriter(Writer internalwriter)(Code)
Creates an XMLWriter wrapping the supplied Writer.
Parameters:
  internalwriter - The writer to be wrapped.



XMLWriter
public XMLWriter(PrintOutputStream pos)(Code)




Method Detail
close
public void close()(Code)
Closes this XMLWriter object, in effect flushing it and making it unusable for any further write operations.

Closing this does not close the underlying input stream!
exception:
  IOException - If an I/O error occurs while closing the stream.




closeTag
public void closeTag(String tag, int nestinglevel, boolean writtenchildren)(Code)



flush
public void flush()(Code)
Flushes the wrapped stream.
exception:
  IOException - If an I/O error occurs while flushing the stream.



getDefaultDeclaration
public static String getDefaultDeclaration()(Code)
Returns the default declaration that will be written by the writeDeclaration method. The required default declaration.



getInternalWriter
public PrintOutputStream getInternalWriter()(Code)



indent
public static void indent(int nestinglevel, PrintOutputStream writer)(Code)



write
final public void write(char[] towrite, int start, int length)(Code)
Writes the supplied data to the wrapped stream, escaping all mandatory XML entities, being &, <, >, ". NB apostrophe is no longer encoded, since this seems to give a measurable Increase in speed. (' is escaped to &#39; since HTML 4.0 does not define the &apos; entity and does not plan to)
Parameters:
  towrite - A character array holding the data to be written.
Parameters:
  start - The offset of the data to be written within the array.
Parameters:
  length - The length of the data to be written.



write
public void write(String towrite)(Code)
Writes the supplied data to the wrapped stream, escaping all mandatory XML/HTML entities, being &, <, >, " and '. ' is escaped to &#39; since HTML 4.0 does not define the &apos; entity and does not plan to.
Parameters:
  towrite - The string to be written.
exception:
  IOException - If an I/O error occurs while writing the string.



writeDeclaration
public void writeDeclaration()(Code)
Writes a default declaration to the wrapped stream.
exception:
  IOException - If an I/O error occurs while writing the declaration.



writeEntity
final public static void writeEntity(char c, PrintOutputStream pos)(Code)



writeRaw
public void writeRaw(char[] towrite, int start, int length)(Code)
Writes the supplied data to the wrapped stream without conversion.
Parameters:
  towrite - A character array holding the data to be written.
Parameters:
  start - The offset of the data to be written within the array.
Parameters:
  length - The length of the data to be written.
exception:
  IOException - If an I/O error occurs while writing the data.



writeRaw
public XMLWriter writeRaw(String tag)(Code)
Writes the supplied string to the wrapped stream without conversion.
Parameters:
  tag - The string to be written.
exception:
  IOException - If an I/O error occurs while writing the string.



writeRaw
public void writeRaw(String tag, int nestinglevel)(Code)
Writes the supplied string to the wrapped stream with the specified indent level.
Parameters:
  tag - The string to be written.
Parameters:
  nestinglevel - The multiplier for the INDENT_WIDTH, giving thenumber of spaces to be written before the supplied string.
exception:
  IOException - If an I/O error occurs while writing the string.



writeSlow
final public void writeSlow(char[] towrite, int start, int length)(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.