📄 xmlwriter.html
字号:
<PRE>
public void <B>enablePrettyPrint</B>(boolean enable)</PRE>
<DL>
<DD>Turn pretty printing on or off. Pretty printing is enabled by default, but it can be turned off to generate more compact XML.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>enable</CODE> - true to enable, false to disable pretty printing.</DL>
</DD>
</DL>
<HR>
<A NAME="setIndent(java.lang.String)"><!-- --></A><H3>
setIndent</H3>
<PRE>
public void <B>setIndent</B>(java.lang.String indent)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>indent</CODE> - representing one level of indentation while pretty printing.</DL>
</DD>
</DL>
<HR>
<A NAME="setNewline(java.lang.String)"><!-- --></A><H3>
setNewline</H3>
<PRE>
public void <B>setNewline</B>(java.lang.String newline)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newline</CODE> - representing the newline sequence when pretty printing.</DL>
</DD>
</DL>
<HR>
<A NAME="writeElementWithText(java.lang.String, java.lang.String)"><!-- --></A><H3>
writeElementWithText</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeElementWithText</B>(java.lang.String name, java.lang.String text) throws java.io.IOException</PRE>
<DL>
<DD>A helper method. It writes out an element which contains only text.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - String name of tag<DD><CODE>text</CODE> - String of text to go inside the tag<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeEmptyElement(java.lang.String)"><!-- --></A><H3>
writeEmptyElement</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeEmptyElement</B>(java.lang.String name) throws java.io.IOException</PRE>
<DL>
<DD>A helper method. It writes out empty entities.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - String name of tag<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeElement(java.lang.String)"><!-- --></A><H3>
writeElement</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeElement</B>(java.lang.String name) throws java.io.IOException</PRE>
<DL>
<DD>Begin to write out an element. Unlike the helper tags, this tag will need to be ended with the endElement method.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - String name of tag<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeAttribute(java.lang.String, java.lang.String)"><!-- --></A><H3>
writeAttribute</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeAttribute</B>(java.lang.String attr, java.lang.String value) throws java.io.IOException</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>attr</CODE> - name of attribute.<DD><CODE>value</CODE> - value of attribute.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="endElement()"><!-- --></A><H3>
endElement</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>endElement</B>() throws java.io.IOException</PRE>
<DL>
<DD>End the current element. This will throw an exception if it is called when there is not a currently open element.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>() throws java.io.IOException</PRE>
<DL>
<DD>Close this writer. It does not close the underlying writer, but does throw an exception if there are as yet unclosed tags.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeText(java.lang.String)"><!-- --></A><H3>
writeText</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeText</B>(java.lang.String text) throws java.io.IOException</PRE>
<DL>
<DD>Output body text. Any xml characters are escaped.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeCData(java.lang.String)"><!-- --></A><H3>
writeCData</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeCData</B>(java.lang.String cdata) throws java.io.IOException</PRE>
<DL>
<DD>Write out a chunk of CDATA. This helper method surrounds the passed in data with the CDATA tag.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cdata</CODE> - of CDATA text.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeComment(java.lang.String)"><!-- --></A><H3>
writeComment</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeComment</B>(java.lang.String comment) throws java.io.IOException</PRE>
<DL>
<DD>Write out a chunk of comment. This helper method surrounds the passed in data with the xml comment tag.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>comment</CODE> - of text to comment.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[] args) throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="test1()"><!-- --></A><H3>
test1</H3>
<PRE>
public static void <B>test1</B>() throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="test2()"><!-- --></A><H3>
test2</H3>
<PRE>
public static void <B>test2</B>() throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="setWriter(java.io.Writer, java.lang.String)"><!-- --></A><H3>
setWriter</H3>
<PRE>
public final void <B>setWriter</B>(java.io.Writer writer, java.lang.String encoding)</PRE>
<DL>
<DD>Resets the handler to write a new text document.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>writer</CODE> - XML text is written to this writer.<DD><CODE>encoding</CODE> - if non-null, and an XML declaration is written, this is the name that will be used for the character encoding.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if the current document hasn't yet ended (with <CODE>#endDocument</CODE>)</DL>
</DD>
</DL>
<HR>
<A NAME="writeDeclaration()"><!-- --></A><H3>
writeDeclaration</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeDeclaration</B>() throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="writeDoctype(java.lang.String, java.lang.String)"><!-- --></A><H3>
writeDoctype</H3>
<PRE>
public <A HREF="../../../../org/dbunit/util/xml/XmlWriter.html" title="class in org.dbunit.util.xml">XmlWriter</A> <B>writeDoctype</B>(java.lang.String systemId, java.lang.String publicId) throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XmlWriter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="XmlWriter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2002-2004 DbUnit.org. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -