blob: 9de48dec464ec3cebbb997519d6fcdcabfecc8fd [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_13) on Sat Nov 06 11:09:28 CDT 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
XML (Apache Wink 1.1.2-incubating API)
</TITLE>
<META NAME="date" CONTENT="2010-11-06">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="XML (Apache Wink 1.1.2-incubating API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XML.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/wink/json4j/utils/XML.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XML.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.wink.json4j.utils</FONT>
<BR>
Class XML</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.wink.json4j.utils.XML</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>XML</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
This class is a static helper for various ways of converting an XML document/InputStream
into a JSON stream or String and vice-versa.
For example, the XML document:<br>
<xmp>
<getValuesReturn return="true">
<attribute attrValue="value"/>
<String>First item</String>
<String>Second item</String>
<String>Third item</String>
<TextTag>Text!</TextTag>
<EmptyTag/>
<TagWithAttrs attr1="value1" attr2="value2" attr3="value3"/>
<TagWithAttrsAndText attr1="value1" attr2="value2" attr3="value3">Text!</TagWithAttrsAndText>
</getValuesReturn>
</xmp>
<br>
in JSON (in non-compact form) becomes<br>
<xmp>
{
"getValuesReturn" : {
"return" : "true",
"TextTag" : "Text!",
"String" : [
"First item",
"Second item",
"Third item"
],
"TagWithAttrsAndText" : {
"content" : "Text!",
"attr3" : "value3",
"attr2" : "value2",
"attr1" : "value1"
}
,
"EmptyTag" : true,
"attribute" : {
"attrValue" : "value"
}
,
"TagWithAttrs" : {
"attr3" : "value3",
"attr2" : "value2",
"attr1" : "value1"
}
}
}
</xmp>
<P>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#XML()">XML</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.File)">toJson</A></B>(java.io.File&nbsp;xmlFile)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an XML file and return a String of the JSON format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.File, boolean)">toJson</A></B>(java.io.File&nbsp;xmlFile,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an XML file and return a String of the JSON format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.InputStream)">toJson</A></B>(java.io.InputStream&nbsp;xmlStream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an input stream to an XML document and return a String of the JSON format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.InputStream, boolean)">toJson</A></B>(java.io.InputStream&nbsp;xmlStream,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an input stream to an XML document and return a String of the JSON format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.InputStream, java.io.OutputStream)">toJson</A></B>(java.io.InputStream&nbsp;XMLStream,
java.io.OutputStream&nbsp;JSONStream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to do the transform from an XML input stream to a JSON stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toJson(java.io.InputStream, java.io.OutputStream, boolean)">toJson</A></B>(java.io.InputStream&nbsp;XMLStream,
java.io.OutputStream&nbsp;JSONStream,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to do the transform from an XML input stream to a JSON stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.File)">toXml</A></B>(java.io.File&nbsp;jsonFile)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an JSON file and return a String of the XML format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.File, boolean)">toXml</A></B>(java.io.File&nbsp;jsonFile,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take a JSON file and return a String of the XML format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.InputStream)">toXml</A></B>(java.io.InputStream&nbsp;JSONStream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an input stream to an JSON document and return a String of the XML format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.InputStream, boolean)">toXml</A></B>(java.io.InputStream&nbsp;JSONStream,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to take an input stream to an JSON document and return a String of the XML format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.InputStream, java.io.OutputStream)">toXml</A></B>(java.io.InputStream&nbsp;JSONStream,
java.io.OutputStream&nbsp;XMLStream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to do the transform from an JSON input stream to a XML stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/wink/json4j/utils/XML.html#toXml(java.io.InputStream, java.io.OutputStream, boolean)">toXml</A></B>(java.io.InputStream&nbsp;JSONStream,
java.io.OutputStream&nbsp;XMLStream,
boolean&nbsp;verbose)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method to do the transform from an JSON input stream to a XML stream.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="XML()"><!-- --></A><H3>
XML</H3>
<PRE>
public <B>XML</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="toJson(java.io.InputStream, java.io.OutputStream)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static void <B>toJson</B>(java.io.InputStream&nbsp;XMLStream,
java.io.OutputStream&nbsp;JSONStream)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to do the transform from an XML input stream to a JSON stream.
Neither input nor output streams are closed. Closure is left up to the caller. Same as calling toJson(inStream, outStream, false); (Default is compact form)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>XMLStream</CODE> - The XML stream to convert to JSON<DD><CODE>JSONStream</CODE> - The stream to write out JSON to. The contents written to this stream are always in UTF-8 format.
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown is a parse error occurs.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IO error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toJson(java.io.InputStream, java.io.OutputStream, boolean)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static void <B>toJson</B>(java.io.InputStream&nbsp;XMLStream,
java.io.OutputStream&nbsp;JSONStream,
boolean&nbsp;verbose)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to do the transform from an XML input stream to a JSON stream.
Neither input nor output streams are closed. Closure is left up to the caller.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>XMLStream</CODE> - The XML stream to convert to JSON<DD><CODE>JSONStream</CODE> - The stream to write out JSON to. The contents written to this stream are always in UTF-8 format.<DD><CODE>verbose</CODE> - Flag to denote whether or not to render the JSON text in verbose (indented easy to read), or compact (not so easy to read, but smaller), format.
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown if a parse error occurs.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IO error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toJson(java.io.InputStream)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static java.lang.String <B>toJson</B>(java.io.InputStream&nbsp;xmlStream)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to take an input stream to an XML document and return a String of the JSON format.
Note that the xmlStream is not closed when read is complete. This is left up to the caller, who may wish to do more with it.
This is the same as toJson(xmlStream,false)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlStream</CODE> - The InputStream to an XML document to transform to JSON.
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown if an error occurs during parse.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toJson(java.io.InputStream, boolean)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static java.lang.String <B>toJson</B>(java.io.InputStream&nbsp;xmlStream,
boolean&nbsp;verbose)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to take an input stream to an XML document and return a String of the JSON format. Note that the xmlStream is not closed when read is complete. This is left up to the caller, who may wish to do more with it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlStream</CODE> - The InputStream to an XML document to transform to JSON.<DD><CODE>verbose</CODE> - Boolean flag denoting whther or not to write the JSON in verbose (formatted), or compact form (no whitespace)
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown if an error occurs during parse.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toJson(java.io.File, boolean)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static java.lang.String <B>toJson</B>(java.io.File&nbsp;xmlFile,
boolean&nbsp;verbose)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to take an XML file and return a String of the JSON format.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlFile</CODE> - The XML file to transform to JSON.<DD><CODE>verbose</CODE> - Boolean flag denoting whther or not to write the JSON in verbose (formatted), or compact form (no whitespace)
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown if an error occurs during parse.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toJson(java.io.File)"><!-- --></A><H3>
toJson</H3>
<PRE>
public static java.lang.String <B>toJson</B>(java.io.File&nbsp;xmlFile)
throws org.xml.sax.SAXException,
java.io.IOException</PRE>
<DL>
<DD>Method to take an XML file and return a String of the JSON format.
This is the same as toJson(xmlStream,false)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlFile</CODE> - The XML file to convert to JSON.
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>org.xml.sax.SAXException</CODE> - Thrown if an error occurs during parse.
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.InputStream, java.io.OutputStream)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static void <B>toXml</B>(java.io.InputStream&nbsp;JSONStream,
java.io.OutputStream&nbsp;XMLStream)
throws java.io.IOException</PRE>
<DL>
<DD>Method to do the transform from an JSON input stream to a XML stream.
Neither input nor output streams are closed. Closure is left up to the caller. Same as calling toXml(inStream, outStream, false); (Default is compact form)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>JSONStream</CODE> - The JSON stream to convert to XML<DD><CODE>XMLStream</CODE> - The stream to write out XML to. The contents written to this stream are always in UTF-8 format.
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IO error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.InputStream, java.io.OutputStream, boolean)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static void <B>toXml</B>(java.io.InputStream&nbsp;JSONStream,
java.io.OutputStream&nbsp;XMLStream,
boolean&nbsp;verbose)
throws java.io.IOException</PRE>
<DL>
<DD>Method to do the transform from an JSON input stream to a XML stream.
Neither input nor output streams are closed. Closure is left up to the caller.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>JSONStream</CODE> - The XML stream to convert to JSON<DD><CODE>XMLStream</CODE> - The stream to write out JSON to. The contents written to this stream are always in UTF-8 format.<DD><CODE>verbose</CODE> - Flag to denote whether or not to render the XML text in verbose (indented easy to read), or compact (not so easy to read, but smaller), format.
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IO error occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.InputStream)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static java.lang.String <B>toXml</B>(java.io.InputStream&nbsp;JSONStream)
throws java.io.IOException</PRE>
<DL>
<DD>Method to take an input stream to an JSON document and return a String of the XML format.
Note that the JSONStream is not closed when read is complete. This is left up to the caller, who may wish to do more with it.
This is the same as toXml(JSONStream,false)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>JSONStream</CODE> - The InputStream to an JSON document to transform to XML.
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.InputStream, boolean)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static java.lang.String <B>toXml</B>(java.io.InputStream&nbsp;JSONStream,
boolean&nbsp;verbose)
throws java.io.IOException</PRE>
<DL>
<DD>Method to take an input stream to an JSON document and return a String of the XML format. Note that the JSONStream is not closed when read is complete. This is left up to the caller, who may wish to do more with it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlStream</CODE> - The InputStream to an JSON document to transform to XML.<DD><CODE>verbose</CODE> - Boolean flag denoting whther or not to write the XML in verbose (formatted), or compact form (no whitespace)
<DT><B>Returns:</B><DD>A string of the JSON representation of the XML file
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.File, boolean)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static java.lang.String <B>toXml</B>(java.io.File&nbsp;jsonFile,
boolean&nbsp;verbose)
throws java.io.IOException</PRE>
<DL>
<DD>Method to take a JSON file and return a String of the XML format.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xmlFile</CODE> - The JSON file to transform to XML.<DD><CODE>verbose</CODE> - Boolean flag denoting whther or not to write the XML in verbose (formatted), or compact form (no whitespace)
<DT><B>Returns:</B><DD>A string of the XML representation of the JSON file
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</DL>
</DD>
</DL>
<HR>
<A NAME="toXml(java.io.File)"><!-- --></A><H3>
toXml</H3>
<PRE>
public static java.lang.String <B>toXml</B>(java.io.File&nbsp;jsonFile)
throws java.io.IOException</PRE>
<DL>
<DD>Method to take an JSON file and return a String of the XML format.
This is the same as toXml(jsonStream,false)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>jsonFile</CODE> - The XML file to convert to XML.
<DT><B>Returns:</B><DD>A string of the XML representation of the JSON file
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Thrown if an IOError occurs.</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=2 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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XML.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/wink/json4j/utils/XML.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XML.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2009-2010 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>