Java Doc for XmlWriter.java in  » Testing » DbUnit » org » dbunit » util » 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 » Testing » DbUnit » org.dbunit.util.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.dbunit.util.xml.XmlWriter

XmlWriter
public class XmlWriter (Code)
Makes writing XML much much easier. Improved from article
author:
   Henri Yandell
author:
   Peter Cassetta
version:
   1.0



Constructor Summary
public  XmlWriter(Writer writer)
     Create an XmlWriter on top of an existing java.io.Writer.
public  XmlWriter(Writer writer, String encoding)
     Create an XmlWriter on top of an existing java.io.Writer.

Method Summary
public  voidclose()
     Close this writer.
public  voidenablePrettyPrint(boolean enable)
     Turn pretty printing on or off.
public  XmlWriterendElement()
     End the current element.
public static  voidmain(String[] args)
    
public  voidsetIndent(String indent)
     Specify the string to prepend to a line for each level of indent. It is 2 spaces (" ") by default.
public  voidsetNewline(String newline)
     Specify the string used to terminate each line when pretty printing. It is a single newline ("\n") by default.
final public  voidsetWriter(Writer writer, String encoding)
     Resets the handler to write a new text document.
public static  voidtest1()
    
public static  voidtest2()
    
public  XmlWriterwriteAttribute(String attr, String value)
     Write an attribute out for the current element.
public  XmlWriterwriteCData(String cdata)
     Write out a chunk of CDATA.
public  XmlWriterwriteComment(String comment)
     Write out a chunk of comment.
public  XmlWriterwriteDeclaration()
    
public  XmlWriterwriteDoctype(String systemId, String publicId)
    
public  XmlWriterwriteElement(String name)
     Begin to write out an element.
public  XmlWriterwriteElementWithText(String name, String text)
     A helper method.
public  XmlWriterwriteEmptyElement(String name)
     A helper method.
public  XmlWriterwriteText(String text)
     Output body text.


Constructor Detail
XmlWriter
public XmlWriter(Writer writer)(Code)
Create an XmlWriter on top of an existing java.io.Writer.



XmlWriter
public XmlWriter(Writer writer, String encoding)(Code)
Create an XmlWriter on top of an existing java.io.Writer.




Method Detail
close
public void close() throws IOException(Code)
Close this writer. It does not close the underlying writer, but does throw an exception if there are as yet unclosed tags.



enablePrettyPrint
public void enablePrettyPrint(boolean enable)(Code)
Turn pretty printing on or off. Pretty printing is enabled by default, but it can be turned off to generate more compact XML.
Parameters:
  enable - true to enable, false to disable pretty printing.



endElement
public XmlWriter endElement() throws IOException(Code)
End the current element. This will throw an exception if it is called when there is not a currently open element.



main
public static void main(String[] args) throws IOException(Code)



setIndent
public void setIndent(String indent)(Code)
Specify the string to prepend to a line for each level of indent. It is 2 spaces (" ") by default. Some may prefer a single tab ("\t") or a different number of spaces. Specifying an empty string will turn off indentation when pretty printing.
Parameters:
  indent - representing one level of indentation while pretty printing.



setNewline
public void setNewline(String newline)(Code)
Specify the string used to terminate each line when pretty printing. It is a single newline ("\n") by default. Users who need to read generated XML documents in Windows editors like Notepad may wish to set this to a carriage return/newline sequence ("\r\n"). Specifying an empty string will turn off generation of line breaks when pretty printing.
Parameters:
  newline - representing the newline sequence when pretty printing.



setWriter
final public void setWriter(Writer writer, String encoding)(Code)
Resets the handler to write a new text document.
Parameters:
  writer - XML text is written to this writer.
Parameters:
  encoding - if non-null, and an XML declaration is written,this is the name that will be used for the character encoding.
exception:
  IllegalStateException - if the currentdocument hasn't yet ended (with XmlWriter.endDocument)



test1
public static void test1() throws IOException(Code)



test2
public static void test2() throws IOException(Code)



writeAttribute
public XmlWriter writeAttribute(String attr, String value) throws IOException(Code)
Write an attribute out for the current element. Any xml characters in the value are escaped. Currently it does not actually throw the exception, but the api is set that way for future changes.
Parameters:
  attr - name of attribute.
Parameters:
  value - value of attribute.



writeCData
public XmlWriter writeCData(String cdata) throws IOException(Code)
Write out a chunk of CDATA. This helper method surrounds the passed in data with the CDATA tag.
Parameters:
  cdata - of CDATA text.



writeComment
public XmlWriter writeComment(String comment) throws IOException(Code)
Write out a chunk of comment. This helper method surrounds the passed in data with the xml comment tag.
Parameters:
  comment - of text to comment.



writeDeclaration
public XmlWriter writeDeclaration() throws IOException(Code)



writeDoctype
public XmlWriter writeDoctype(String systemId, String publicId) throws IOException(Code)



writeElement
public XmlWriter writeElement(String name) throws IOException(Code)
Begin to write out an element. Unlike the helper tags, this tag will need to be ended with the endElement method.
Parameters:
  name - String name of tag



writeElementWithText
public XmlWriter writeElementWithText(String name, String text) throws IOException(Code)
A helper method. It writes out an element which contains only text.
Parameters:
  name - String name of tag
Parameters:
  text - String of text to go inside the tag



writeEmptyElement
public XmlWriter writeEmptyElement(String name) throws IOException(Code)
A helper method. It writes out empty entities.
Parameters:
  name - String name of tag



writeText
public XmlWriter writeText(String text) throws IOException(Code)
Output body text. Any xml characters are escaped.



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.