/Prototipo/Servlet/lib/xstream-distribution-1.4.1-bin/xstream-1.4.1/docs/javadoc/com/thoughtworks/xstream/io/json/AbstractJsonWriter.html
http://prototipomemoria.googlecode.com/ · HTML · 798 lines · 693 code · 81 blank · 24 comment · 0 complexity · 0428b873e26c7ec1fcd66c7a1e145101 MD5 · raw file
- <!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_26) on Thu Aug 11 04:40:24 CEST 2011 -->
- <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <TITLE>
- AbstractJsonWriter (XStream Core 1.4.1 API)
- </TITLE>
- <META NAME="date" CONTENT="2011-08-11">
- <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="AbstractJsonWriter (XStream Core 1.4.1 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> </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/AbstractJsonWriter.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
- <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.Type.html" title="class in com.thoughtworks.xstream.io.json"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../../index.html?com/thoughtworks/xstream/io/json/AbstractJsonWriter.html" target="_top"><B>FRAMES</B></A>
- <A HREF="AbstractJsonWriter.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: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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">
- com.thoughtworks.xstream.io.json</FONT>
- <BR>
- Class AbstractJsonWriter</H2>
- <PRE>
- <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
- <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html" title="class in com.thoughtworks.xstream.io">com.thoughtworks.xstream.io.AbstractWriter</A>
- <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.thoughtworks.xstream.io.json.AbstractJsonWriter</B>
- </PRE>
- <DL>
- <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../com/thoughtworks/xstream/io/ExtendedHierarchicalStreamWriter.html" title="interface in com.thoughtworks.xstream.io">ExtendedHierarchicalStreamWriter</A>, <A HREF="../../../../../com/thoughtworks/xstream/io/HierarchicalStreamWriter.html" title="interface in com.thoughtworks.xstream.io">HierarchicalStreamWriter</A></DD>
- </DL>
- <DL>
- <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../com/thoughtworks/xstream/io/json/JsonWriter.html" title="class in com.thoughtworks.xstream.io.json">JsonWriter</A></DD>
- </DL>
- <HR>
- <DL>
- <DT><PRE>public abstract class <B>AbstractJsonWriter</B><DT>extends <A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html" title="class in com.thoughtworks.xstream.io">AbstractWriter</A></DL>
- </PRE>
- <P>
- An abstract implementation of a writer that calls abstract methods to build JSON structures.
- Note, that XStream's implicit collection feature is only compatible with the syntax in
- <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#EXPLICIT_MODE"><CODE>EXPLICIT_MODE</CODE></A>.
- <P>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- <DT><B>Author:</B></DT>
- <DD>Jörg Schaible</DD>
- </DL>
- <HR>
- <P>
- <!-- ======== NESTED CLASS SUMMARY ======== -->
- <A NAME="nested_class_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>Nested Class Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static class</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.Type.html" title="class in com.thoughtworks.xstream.io.json">AbstractJsonWriter.Type</A></B></CODE>
- <BR>
- </TD>
- </TR>
- </TABLE>
- <!-- =========== FIELD SUMMARY =========== -->
- <A NAME="field_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>Field Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#DROP_ROOT_MODE">DROP_ROOT_MODE</A></B></CODE>
- <BR>
- DROP_ROOT_MODE drops the JSON root node.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#EXPLICIT_MODE">EXPLICIT_MODE</A></B></CODE>
- <BR>
- EXPLICIT_MODE assures that all data has its explicit equivalent in the resulting JSON.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#STRICT_MODE">STRICT_MODE</A></B></CODE>
- <BR>
- STRICT_MODE prevents invalid JSON for single value objects when dropping the root.</TD>
- </TR>
- </TABLE>
-
- <!-- ======== 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="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#AbstractJsonWriter()">AbstractJsonWriter</A></B>()</CODE>
- <BR>
- Construct a JSON writer.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#AbstractJsonWriter(int)">AbstractJsonWriter</A></B>(int mode)</CODE>
- <BR>
- Construct a JSON writer with a special mode.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#AbstractJsonWriter(int, com.thoughtworks.xstream.io.naming.NameCoder)">AbstractJsonWriter</A></B>(int mode,
- <A HREF="../../../../../com/thoughtworks/xstream/io/naming/NameCoder.html" title="interface in com.thoughtworks.xstream.io.naming">NameCoder</A> nameCoder)</CODE>
- <BR>
- Construct a JSON writer with a special mode and name coder.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#AbstractJsonWriter(com.thoughtworks.xstream.io.naming.NameCoder)">AbstractJsonWriter</A></B>(<A HREF="../../../../../com/thoughtworks/xstream/io/naming/NameCoder.html" title="interface in com.thoughtworks.xstream.io.naming">NameCoder</A> nameCoder)</CODE>
- <BR>
- Construct a JSON writer with a special name coder.</TD>
- </TR>
- </TABLE>
-
- <!-- ========== 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> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#addAttribute(java.lang.String, java.lang.String)">addAttribute</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name,
- <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#addLabel(java.lang.String)">addLabel</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</CODE>
- <BR>
- Add a label to a JSON object.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#addValue(java.lang.String, com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type)">addValue</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value,
- <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.Type.html" title="class in com.thoughtworks.xstream.io.json">AbstractJsonWriter.Type</A> type)</CODE>
- <BR>
- Add a value to a JSON object's label or to an array.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#endArray()">endArray</A></B>()</CODE>
- <BR>
- End the JSON array.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#endNode()">endNode</A></B>()</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#endObject()">endObject</A></B>()</CODE>
- <BR>
- End the JSON object.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#isArray(java.lang.Class)">isArray</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> clazz)</CODE>
- <BR>
- Method to declare various Java types to be handles as JSON array.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#nextElement()">nextElement</A></B>()</CODE>
- <BR>
- Prepare a JSON object or array for another element.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#setValue(java.lang.String)">setValue</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> text)</CODE>
- <BR>
- Write the value (text content) of the current node.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#startArray()">startArray</A></B>()</CODE>
- <BR>
- Start a JSON array.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#startNode(java.lang.String)">startNode</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#startNode(java.lang.String, java.lang.Class)">startNode</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name,
- <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> clazz)</CODE>
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected abstract void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#startObject()">startObject</A></B>()</CODE>
- <BR>
- Start a JSON object.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_com.thoughtworks.xstream.io.AbstractWriter"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class com.thoughtworks.xstream.io.<A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html" title="class in com.thoughtworks.xstream.io">AbstractWriter</A></B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html#encodeAttribute(java.lang.String)">encodeAttribute</A>, <A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html#encodeNode(java.lang.String)">encodeNode</A>, <A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html#underlyingWriter()">underlyingWriter</A></CODE></TD>
- </TR>
- </TABLE>
- <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.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_com.thoughtworks.xstream.io.HierarchicalStreamWriter"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from interface com.thoughtworks.xstream.io.<A HREF="../../../../../com/thoughtworks/xstream/io/HierarchicalStreamWriter.html" title="interface in com.thoughtworks.xstream.io">HierarchicalStreamWriter</A></B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="../../../../../com/thoughtworks/xstream/io/HierarchicalStreamWriter.html#close()">close</A>, <A HREF="../../../../../com/thoughtworks/xstream/io/HierarchicalStreamWriter.html#flush()">flush</A></CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ FIELD DETAIL =========== -->
- <A NAME="field_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>Field Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="DROP_ROOT_MODE"><!-- --></A><H3>
- DROP_ROOT_MODE</H3>
- <PRE>
- public static final int <B>DROP_ROOT_MODE</B></PRE>
- <DL>
- <DD>DROP_ROOT_MODE drops the JSON root node.
- <p>
- The root node is the first level of the JSON object i.e.
-
- <pre>
- { "person": {
- "name": "Joe"
- }}
- </pre>
-
- will be written without root simply as
-
- <pre>
- {
- "name": "Joe"
- }
- </pre>
-
- Without a root node, the top level element might now also be an array. However, it is
- possible to generate invalid JSON unless <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#STRICT_MODE"><CODE>STRICT_MODE</CODE></A> is also set.
- </p>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>1.3.1</DD>
- <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.thoughtworks.xstream.io.json.AbstractJsonWriter.DROP_ROOT_MODE">Constant Field Values</A></DL>
- </DL>
- <HR>
- <A NAME="STRICT_MODE"><!-- --></A><H3>
- STRICT_MODE</H3>
- <PRE>
- public static final int <B>STRICT_MODE</B></PRE>
- <DL>
- <DD>STRICT_MODE prevents invalid JSON for single value objects when dropping the root.
- <p>
- The mode is only useful in combination with the <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#DROP_ROOT_MODE"><CODE>DROP_ROOT_MODE</CODE></A>. An object with a
- single value as first node i.e.
-
- <pre>
- { "name": "Joe" }
- </pre>
-
- is simply written as
-
- <pre>
- "Joe"
- </pre>
-
- However, this is no longer valid JSON. Therefore you can activate <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.html#STRICT_MODE"><CODE>STRICT_MODE</CODE></A>
- and a <A HREF="../../../../../com/thoughtworks/xstream/converters/ConversionException.html" title="class in com.thoughtworks.xstream.converters"><CODE>ConversionException</CODE></A> is thrown instead.
- </p>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>1.3.1</DD>
- <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.thoughtworks.xstream.io.json.AbstractJsonWriter.STRICT_MODE">Constant Field Values</A></DL>
- </DL>
- <HR>
- <A NAME="EXPLICIT_MODE"><!-- --></A><H3>
- EXPLICIT_MODE</H3>
- <PRE>
- public static final int <B>EXPLICIT_MODE</B></PRE>
- <DL>
- <DD>EXPLICIT_MODE assures that all data has its explicit equivalent in the resulting JSON.
- <p>
- XStream is normally using attributes in XML that have no real equivalent in JSON.
- Additionally it is essential in XML that the individual child elements of a tag keep
- order and may have the same tag name. XStream's model relies on both characteristics.
- However, properties of a JSON object do not have a defined order, but their names have to
- be unique. Only a JSON array defines the order of its elements.
- </p>
- <p>
- Therefore XStream uses in explicit mode a JSON format that supports the original
- requirements at the expense of the simplicity of the JSON objects and arrays. Each Java
- object will be represented by a JSON object with a single property representing the name
- of the object and an array as value that contains two more arrays. The first one contains
- a JSON object with all attributes, the second one the value of the Java object which can
- be null, a string or integer value or again a new JSON object representing a Java object.
- Here an example of an string array with one member, where the array and the string has an
- additional attribute 'id':
-
- <pre>
- {"string-array":[[{"id":"1"}],[{"string":[[{"id":"2"}],["Joe"]]}]]}
- </pre>
-
- This format can be used to always deserialize into Java again.
- </p>
- <p>
- This mode cannot be combined with one of the other modes.
- </p>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.thoughtworks.xstream.io.json.AbstractJsonWriter.EXPLICIT_MODE">Constant Field Values</A></DL>
- </DL>
- <!-- ========= 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="AbstractJsonWriter()"><!-- --></A><H3>
- AbstractJsonWriter</H3>
- <PRE>
- public <B>AbstractJsonWriter</B>()</PRE>
- <DL>
- <DD>Construct a JSON writer.
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DL>
- <HR>
- <A NAME="AbstractJsonWriter(int)"><!-- --></A><H3>
- AbstractJsonWriter</H3>
- <PRE>
- public <B>AbstractJsonWriter</B>(int mode)</PRE>
- <DL>
- <DD>Construct a JSON writer with a special mode.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>mode</CODE> - a bit mask of the mode constants<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DL>
- <HR>
- <A NAME="AbstractJsonWriter(com.thoughtworks.xstream.io.naming.NameCoder)"><!-- --></A><H3>
- AbstractJsonWriter</H3>
- <PRE>
- public <B>AbstractJsonWriter</B>(<A HREF="../../../../../com/thoughtworks/xstream/io/naming/NameCoder.html" title="interface in com.thoughtworks.xstream.io.naming">NameCoder</A> nameCoder)</PRE>
- <DL>
- <DD>Construct a JSON writer with a special name coder.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>nameCoder</CODE> - the name coder to use<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DL>
- <HR>
- <A NAME="AbstractJsonWriter(int, com.thoughtworks.xstream.io.naming.NameCoder)"><!-- --></A><H3>
- AbstractJsonWriter</H3>
- <PRE>
- public <B>AbstractJsonWriter</B>(int mode,
- <A HREF="../../../../../com/thoughtworks/xstream/io/naming/NameCoder.html" title="interface in com.thoughtworks.xstream.io.naming">NameCoder</A> nameCoder)</PRE>
- <DL>
- <DD>Construct a JSON writer with a special mode and name coder.
- <P>
- <DL>
- <DT><B>Parameters:</B><DD><CODE>mode</CODE> - a bit mask of the mode constants<DD><CODE>nameCoder</CODE> - the name coder to use<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </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="startNode(java.lang.String, java.lang.Class)"><!-- --></A><H3>
- startNode</H3>
- <PRE>
- public void <B>startNode</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name,
- <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> clazz)</PRE>
- <DL>
- <DD><B>Description copied from class: <CODE><A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html#startNode(java.lang.String, java.lang.Class)">AbstractWriter</A></CODE></B></DD>
- <DD>
- <P>
- <DD><DL>
- <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/thoughtworks/xstream/io/ExtendedHierarchicalStreamWriter.html#startNode(java.lang.String, java.lang.Class)">startNode</A></CODE> in interface <CODE><A HREF="../../../../../com/thoughtworks/xstream/io/ExtendedHierarchicalStreamWriter.html" title="interface in com.thoughtworks.xstream.io">ExtendedHierarchicalStreamWriter</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html#startNode(java.lang.String, java.lang.Class)">startNode</A></CODE> in class <CODE><A HREF="../../../../../com/thoughtworks/xstream/io/AbstractWriter.html" title="class in com.thoughtworks.xstream.io">AbstractWriter</A></CODE></DL>
- </DD>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="startNode(java.lang.String)"><!-- --></A><H3>
- startNode</H3>
- <PRE>
- public void <B>startNode</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="addAttribute(java.lang.String, java.lang.String)"><!-- --></A><H3>
- addAttribute</H3>
- <PRE>
- public void <B>addAttribute</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name,
- <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="setValue(java.lang.String)"><!-- --></A><H3>
- setValue</H3>
- <PRE>
- public void <B>setValue</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> text)</PRE>
- <DL>
- <DD><B>Description copied from interface: <CODE><A HREF="../../../../../com/thoughtworks/xstream/io/HierarchicalStreamWriter.html#setValue(java.lang.String)">HierarchicalStreamWriter</A></CODE></B></DD>
- <DD>Write the value (text content) of the current node.
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="endNode()"><!-- --></A><H3>
- endNode</H3>
- <PRE>
- public void <B>endNode</B>()</PRE>
- <DL>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="isArray(java.lang.Class)"><!-- --></A><H3>
- isArray</H3>
- <PRE>
- protected boolean <B>isArray</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> clazz)</PRE>
- <DL>
- <DD>Method to declare various Java types to be handles as JSON array.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>clazz</CODE> - the type
- <DT><B>Returns:</B><DD><code>true</code> if handles as array<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="startObject()"><!-- --></A><H3>
- startObject</H3>
- <PRE>
- protected abstract void <B>startObject</B>()</PRE>
- <DL>
- <DD>Start a JSON object.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="addLabel(java.lang.String)"><!-- --></A><H3>
- addLabel</H3>
- <PRE>
- protected abstract void <B>addLabel</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> name)</PRE>
- <DL>
- <DD>Add a label to a JSON object.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>name</CODE> - the label's name<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="addValue(java.lang.String, com.thoughtworks.xstream.io.json.AbstractJsonWriter.Type)"><!-- --></A><H3>
- addValue</H3>
- <PRE>
- protected abstract void <B>addValue</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value,
- <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.Type.html" title="class in com.thoughtworks.xstream.io.json">AbstractJsonWriter.Type</A> type)</PRE>
- <DL>
- <DD>Add a value to a JSON object's label or to an array.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>value</CODE> - the value itself<DD><CODE>type</CODE> - the JSON type<DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="startArray()"><!-- --></A><H3>
- startArray</H3>
- <PRE>
- protected abstract void <B>startArray</B>()</PRE>
- <DL>
- <DD>Start a JSON array.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="nextElement()"><!-- --></A><H3>
- nextElement</H3>
- <PRE>
- protected abstract void <B>nextElement</B>()</PRE>
- <DL>
- <DD>Prepare a JSON object or array for another element.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="endArray()"><!-- --></A><H3>
- endArray</H3>
- <PRE>
- protected abstract void <B>endArray</B>()</PRE>
- <DL>
- <DD>End the JSON array.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="endObject()"><!-- --></A><H3>
- endObject</H3>
- <PRE>
- protected abstract void <B>endObject</B>()</PRE>
- <DL>
- <DD>End the JSON object.
- <P>
- <DD><DL>
- <DT><B>Since:</B></DT>
- <DD>1.4</DD>
- </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> </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/AbstractJsonWriter.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
- <A HREF="../../../../../com/thoughtworks/xstream/io/json/AbstractJsonWriter.Type.html" title="class in com.thoughtworks.xstream.io.json"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../../index.html?com/thoughtworks/xstream/io/json/AbstractJsonWriter.html" target="_top"><B>FRAMES</B></A>
- <A HREF="AbstractJsonWriter.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: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <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 © 2004-2011 <a href="http://xstream.codehaus.org">XStream</a>. All Rights Reserved.
- </BODY>
- </HTML>