PageRenderTime 37ms CodeModel.GetById 7ms app.highlight 22ms RepoModel.GetById 1ms app.codeStats 1ms

/Prototipo/Servlet/lib/xstream-distribution-1.4.1-bin/xstream-1.4.1/docs/converters.html

http://prototipomemoria.googlecode.com/
HTML | 819 lines | 758 code | 34 blank | 27 comment | 0 complexity | 15d8a6c523fac6d0a8f1553133cee893 MD5 | raw file
  1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2<html xmlns="http://www.w3.org/1999/xhtml">
  3<!--
  4 Copyright (C) 2005, 2006 Joe Walnes.
  5 Copyright (C) 2006, 2007, 2008 XStream committers.
  6 All rights reserved.
  7 
  8 The software in this package is published under the terms of the BSD
  9 style license a copy of which has been included with this distribution in
 10 the LICENSE.txt file.
 11 
 12 Created on 29. January 2005 by Joe Walnes
 13 -->
 14    <head>
 15        <title>XStream - Converters</title>
 16        <link rel="stylesheet" type="text/css" href="style.css"/>
 17        
 18        
 19        <style type="text/css">
 20            .example { font-family: courier; font-size: 8pt; }
 21            #content td {     border-top: thin solid #5c5 ;}
 22            #content .headerRow { background-color: white; }
 23        </style>
 24    
 25
 26        <!-- Google analytics -->
 27        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
 28        </script>
 29        <script type="text/javascript">
 30          _uacct = "UA-110973-2";
 31          urchinTracker();
 32        </script>
 33
 34    </head>
 35    <body>
 36
 37        <div id="banner">
 38            <a href="index.html"><img id="logo" src="logo.gif" alt="XStream"/></a>
 39        </div>
 40
 41        <div id="center" class="Content2Column">  <!-- Content3Column for index -->
 42            <div id="content">
 43                <h1 class="FirstChild">Converters</h1>
 44
 45                
 46
 47        <p>The core of XStream consists of a registry of
 48        <a href="javadoc/com/thoughtworks/xstream/converters/Converter.html"><b>Converters</b></a>. The responsibility of a Converter is to
 49        provide a strategy for converting particular types of objects found in the object graph, to and from XML.</p>
 50
 51        <p>XStream is provided with Converters for common types such as primitives, String, File, Collections, arrays,
 52        and Dates.</p>
 53
 54		
 55        <table class="examplesTable" summary="Overview over all Converters delivered with XStream">
 56            <!-- .................................................................................................. -->
 57            <tr>
 58                <td colspan="4" class="headerRow"><h1 id="java.lang">java.lang (and core special types)</h1></td>
 59            </tr>
 60            <tr>
 61                <th>Converter</th>
 62                <th>Supported types</th>
 63                <th>Example</th>
 64                <th>Notes</th>
 65            </tr>
 66            <tr>
 67                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/NullConverter.html">NullConverter</a></td>
 68                <td>null values</td>
 69                <td class="example">&lt;null/&gt;</td>
 70                <td>Usually, null fields are left out of the XML, however when used in arrays or the root object they
 71                have to be explicitly marked.</td>
 72            </tr>
 73            <tr>
 74                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/ArrayConverter.html">ArrayConverter</a></td>
 75                <td>Any kind of array</td>
 76                <td class="example">
 77                    &lt;string-array&gt;<br/>
 78                    &nbsp;&nbsp;&lt;string&gt;apple&lt;/string&gt;<br/>
 79                    &nbsp;&nbsp;&lt;string&gt;banana&lt;/string&gt;<br/>
 80                    &nbsp;&nbsp;&lt;string&gt;cabbage&lt;/string&gt;<br/>
 81                    &lt;/string-array&gt;
 82                </td>
 83                <td>This supports arrays of primitives as well as objects. It also supports multi-dimensional arrays, even if
 84                they are non-rectangular.</td>
 85            </tr>
 86            <tr>
 87                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/BooleanConverter.html">BooleanConverter</a></td>
 88                <td>boolean<br/>java.lang.Boolean</td>
 89                <td class="example">&lt;boolean&gt;true&lt;/boolean&gt;</td>
 90                <td>&nbsp;</td>
 91            </tr>
 92            <tr>
 93                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/ByteConverter.html">ByteConverter</a></td>
 94                <td>byte<br/>java.lang.Byte</td>
 95                <td class="example">&lt;byte&gt;22&lt;/byte&gt;</td>
 96                <td>The byte is represented as an integer.</td>
 97            </tr>
 98            <tr>
 99                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/EncodedByteArrayConverter.html">EncodedByteArrayConverter</a></td>
100                <td>byte[]</td>
101                <td class="example">&lt;byte-array&gt;AHiEFiEABQ==&lt;/byte-array&gt;</td>
102                <td>Uses Base64 encoding to store binary data in XML. Converter is not automatically registered.</td>
103            </tr>
104            <tr>
105                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/CharConverter.html">CharConverter</a></td>
106                <td>char<br/>java.lang.Character</td>
107                <td class="example">&lt;char&gt;X&lt;/char&gt;</td>
108                <td>&nbsp;</td>
109            </tr>
110            <tr>
111                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/CharArrayConverter.html">CharArrayConverter</a></td>
112                <td>char[]</td>
113                <td class="example">
114                    &lt;char-array&gt;hello&lt;char-array&gt;
115                </td>
116                <td>Joins all characters into a single String.</td>
117            </tr>
118            <tr>
119                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/DoubleConverter.html">DoubleConverter</a></td>
120                <td>double<br/>java.lang.Double</td>
121                <td class="example">&lt;double&gt;456774543443.4553435&lt;/double&gt;</td>
122                <td>&nbsp;</td>
123            </tr>
124            <tr>
125                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/FloatConverter.html">FloatConverter</a></td>
126                <td>float<br/>java.lang.Float</td>
127                <td class="example">&lt;float&gt;4563443.435&lt;/float&gt;</td>
128                <td>&nbsp;</td>
129            </tr>
130            <tr>
131                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/IntConverter.html">IntConverter</a></td>
132                <td>int<br/>java.lang.Integer</td>
133                <td class="example">&lt;int&gt;12345678&lt;/int&gt;</td>
134                <td>&nbsp;</td>
135            </tr>
136            <tr>
137                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/LongConverter.html">LongConverter</a></td>
138                <td>long<br/>java.lang.Long</td>
139                <td class="example">&lt;long&gt;2344556678888786&lt;/long&gt;</td>
140                <td>&nbsp;</td>
141            </tr>
142            <tr>
143                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/ShortConverter.html">ShortConverter</a></td>
144                <td>short<br/>java.lang.Short</td>
145                <td class="example">&lt;short&gt;1445&lt;/short&gt;</td>
146                <td>&nbsp;</td>
147            </tr>
148            <tr>
149                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/StringConverter.html">StringConverter</a></td>
150                <td>java.lang.String</td>
151                <td class="example">&lt;string&gt;hello world&lt;/string&gt;</td>
152                <td>&nbsp;</td>
153            </tr>
154            <tr>
155                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/StringBufferConverter.html">StringBufferConverter</a></td>
156                <td>java.lang.StringBuffer</td>
157                <td class="example">&lt;string-buffer&gt;hello world&lt;/string-buffer&gt;</td>
158                <td>&nbsp;</td>
159            </tr>
160            <tr>
161                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/StringBuildererConverter.html">StringBuilderConverter</a></td>
162                <td>java.lang.StringBuilder</td>
163                <td class="example">&lt;string-builder&gt;hello world&lt;/string-builder&gt;</td>
164                <td>Available under Java 1.5 or greater.</td>
165            </tr>
166            <tr>
167                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ThrowableConverter.html">ThrowableConverter</a></td>
168                <td>java.lang.Throwable<br/>java.lang.Exception<br/>java.lang.RuntimeException<br/>java.lang.Error<br/>...and all subclasses
169                of these.</td>
170                <td class="example">
171                    &lt;java.io.IOException&gt;<br/>
172                    &nbsp;&nbsp;&lt;detailMessage&gt;No file&lt;/detailMessage&gt;<br/>
173                    &nbsp;&nbsp;&lt;stack-trace&gt;<br/>
174                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;trace&gt;com.x.Foo.stuff(Foo.java:22)&lt;/trace&gt;<br/>
175                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;trace&gt;com.x.Foo.blah(Foo.java:31)&lt;/trace&gt;<br/>
176                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;trace&gt;com.x.Foo.main(Foo.java:43)&lt;/trace&gt;<br/>
177                    &nbsp;&nbsp;&lt;/stack-trace&gt;<br/>
178                    &lt;/java.io.IOException&gt;
179                </td>
180                <td>This is only available under Java 1.4 or greater. It retains the full stack trace, including that of any
181                nested exceptions. The stack trace elements are handled by the
182                <a href="javadoc/com/thoughtworks/xstream/converters/extended/StackTraceElementConverter.html">StackTraceElementConverter</a>.</td>
183            </tr>
184            <tr>
185                <td><a href="javadoc/com/thoughtworks/xstream/converters/enums/EnumConverter.html">EnumConverter</a></td>
186                <td>java.lang.Enum</td>
187                <td class="example">&lt;java.lang.annotation.RetentionPolicy&gt;<br/>CLASS<br/>&lt;/java.lang.annotation.RetentionPolicy&gt;</td>
188                <td>Available under Java 1.5 or greater.</td>
189            </tr>
190
191            <!-- .................................................................................................. -->
192            <tr>
193                <td colspan="4" class="headerRow"><h1 id="java.util">java.util</h1></td>
194            </tr>
195            <tr>
196                <th>Converter</th>
197                <th>Supported types</th>
198                <th>Example</th>
199                <th>Notes</th>
200            </tr>
201            <tr>
202                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/CollectionConverter.html">CollectionConverter</a></td>
203                <td>java.util.ArrayList<br/>java.util.LinkedList<br/>java.util.HashSet<br/>java.util.Vector<br/>java.util.LinkedHashSet</td>
204                <td class="example">
205                    &lt;linked-list&gt;<br/>
206                    &nbsp;&nbsp;&lt;string&gt;apple&lt;/string&gt;<br/>
207                    &nbsp;&nbsp;&lt;string&gt;banana&lt;/string&gt;<br/>
208                    &nbsp;&nbsp;&lt;big-decimal&gt;12345.4555&lt;/big-decimal&gt;<br/>
209                    &lt;/linked-list&gt;
210                </td>
211                <td>The objects inside the collection can be any type of objects, including nested collections.</td>
212            </tr>
213            <tr>
214                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/MapConverter.html">MapConverter</a></td>
215                <td>java.util.HashMap<br/>java.util.Hashtable<br/>java.util.LinkedHashMap</td>
216                <td class="example">
217                    &lt;map&gt;<br/>
218                    &nbsp;&nbsp;&lt;entry&gt;<br/>
219                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;apple&lt;/string&gt;<br/>
220                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;float&gt;123.553&lt;/float&gt;<br/>
221                    &nbsp;&nbsp;&lt;/entry&gt;<br/>
222                    &nbsp;&nbsp;&lt;entry&gt;<br/>
223                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;orange&lt;/string&gt;<br/>
224                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;float&gt;55.4&lt;/float&gt;<br/>
225                    &nbsp;&nbsp;&lt;/entry&gt;<br/>
226                    &lt;/map&gt;
227                </td>
228                <td>Both key and values can be any type of objects.</td>
229            </tr>
230            <tr>
231                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/PropertiesConverter.html">PropertiesConverter</a></td>
232                <td>java.util.Properties</td>
233                <td class="example">
234                    &lt;properties&gt;<br/>
235                    &nbsp;&nbsp;&lt;property name=&quot;host&quot; value=&quot;localhost&quot;/&gt;<br/>
236                    &nbsp;&nbsp;&lt;property name=&quot;port&quot; value=&quot;888&quot;/&gt;<br/>
237                    &lt;/properties&gt;
238                </td>
239                <td>Because the Properties class only accepts Strings for keys and values, the XML can be more concise. 
240                If the Properties instance includes a set of default Properties, these are serialized in a nested <code>&lt;defaults&gt;</code> element.</td>
241            </tr>
242            <tr>
243                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/TreeMapConverter.html">TreeMapConverter</a></td>
244                <td>java.util.TreeMap</td>
245                <td class="example">
246                    &lt;tree-map&gt;<br/>
247                    &nbsp;&nbsp;&lt;comparator class=&quot;com.blah.MyComparator&quot;/&gt;<br/>
248                    &nbsp;&nbsp;&lt;entry&gt;<br/>
249                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;apple&lt;/string&gt;<br/>
250                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;float&gt;123.553&lt;/float&gt;<br/>
251                    &nbsp;&nbsp;&lt;/entry&gt;<br/>
252                    &nbsp;&nbsp;&lt;entry&gt;<br/>
253                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;orange&lt;/string&gt;<br/>
254                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;float&gt;55.4&lt;/float&gt;<br/>
255                    &nbsp;&nbsp;&lt;/entry&gt;<br/>
256                    &lt;/tree-map&gt;
257                </td>
258                <td>This is similar to MapConverter with an additional field for storing the java.util.Comparator associated with the TreeMap.</td>
259            </tr>
260            <tr>
261                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/TreeSetConverter.html">TreeSetConverter</a></td>
262                <td>java.util.TreeSet</td>
263                <td class="example">
264                    &lt;tree-set&gt;<br/>
265                    &nbsp;&nbsp;&lt;comparator class=&quot;com.blah.MyComparator&quot;/&gt;<br/>
266                    &nbsp;&nbsp;&lt;string&gt;apple&lt;/string&gt;<br/>
267                    &nbsp;&nbsp;&lt;string&gt;banana&lt;/string&gt;<br/>
268                    &nbsp;&nbsp;&lt;string&gt;cabbage&lt;/string&gt;<br/>
269                    &lt;/tree-set&gt;
270                </td>
271                <td>This is similar to CollectionConverter with an additional field for storing the java.util.Comparator associated with the TreeSet.</td>
272            </tr>
273            <tr>
274                <td><a href="javadoc/com/thoughtworks/xstream/converters/collections/BitSetConverter.html">BitSetConverter</a></td>
275                <td>java.util.BitSet</td>
276                <td class="example">
277                    &lt;bit-set&gt;0,1,3,5,6,8,10&lt;/bit-set&gt;
278                </td>
279                <td>Stores a comma separated list of which bits are set. Designed to be readable without taking up too much space.</td>
280            </tr>
281            <tr>
282                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/DateConverter.html">DateConverter</a></td>
283                <td>java.util.Date</td>
284                <td class="example">&lt;date&gt;2004-02-22 15:16:04.0 EST&lt;/date&gt;</td>
285                <td></td>
286            </tr>
287            <tr>
288                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/GregorianCalendarConverter.html">GregorianCalendarConverter</a></td>
289                <td>java.util.Calendar<br/>java.util.GregorianCalendar</td>
290                <td class="example">
291                    &lt;gregorian-calendar&gt;<br/>
292                    &nbsp;&nbsp;&lt;time&gt;555454646&lt;/time&gt;<br/>
293                    &lt;/gregorian-calendar&gt;
294                </td>
295                <td>&nbsp;</td>
296            </tr>
297            <tr>
298                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ISO8601DateConverter.html">ISO8601DateConverter</a></td>
299                <td>java.util.Date</td>
300                <td class="example">&lt;date&gt;2006-07-28T12:06:17.654-03:00&lt;/date&gt;</td>
301                <td>Not automatically registered, needs joda-time</td>
302            </tr>
303            <tr>
304                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ISO8601GregorianCalendarConverter.html">ISO8601GregorianCalendarConverter</a></td>
305                <td>java.util.GregorianCalendar</td>
306                <td class="example">
307                    &lt;gregorian-calendar&gt;<br/>
308                    2006-07-28T12:07:02.788-03:00<br/>
309                    &lt;/gregorian-calendar&gt;
310                </td>
311                <td>Not automatically registered, needs joda-time</td>
312            </tr>
313            <tr>
314                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/LocaleConverter.html">LocaleConverter</a></td>
315                <td>java.util.Locale</td>
316                <td class="example">&lt;locale&gt;en_GB&lt;/locale&gt;</td>
317                <td>&nbsp;</td>
318            </tr>
319            <tr>
320                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/CurrencyConverter.html">CurrencyConverter</a></td>
321                <td>java.util.Currency</td>
322                <td class="example">&lt;currency&gt;USD&lt;/currency&gt;</td>
323                <td>Available under Java 1.4 or greater.</td>
324            </tr>
325            <tr>
326                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/UUIDConverter.html">UUIDConverter</a></td>
327                <td>java.util.UUID</td>
328                <td class="example">&lt;uuid&gt;ca05f023-e07f-4956-a6ef-14ddd23df47b&lt;/uuid&gt;</td>
329                <td>Available under Java 1.5 or greater.</td>
330            </tr>
331            <tr>
332                <td><a href="javadoc/com/thoughtworks/xstream/converters/enums/EnumMapConverter.html">EnumMapConverter</a></td>
333                <td>java.util.EnumMap</td>
334                <td class="example">
335                &lt;enum-map enum-type="simple"&gt;<br/>
336                &nbsp;&nbsp;&lt;entry&gt;<br/>
337                &nbsp;&nbsp;&nbsp;&nbsp;&lt;simple&gt;GREEN&lt;/simple&gt;<br/>
338                &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;grass&lt;/string&gt;<br/>
339                &nbsp;&nbsp;&lt;/entry&gt;<br/>
340                &nbsp;&nbsp;&lt;entry&gt;<br/>
341                &nbsp;&nbsp;&nbsp;&nbsp;&lt;simple&gt;BLUE&lt;/simple&gt;<br/>
342                &nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;sky&lt;/string&gt;<br/>
343                &nbsp;&nbsp;&lt;/entry&gt;<br/>
344                &lt;/enum-map&gt;</td>
345                <td>Available under Java 1.5 or greater.</td>
346            </tr>
347            <tr>
348                <td><a href="javadoc/com/thoughtworks/xstream/converters/enums/EnumSetConverter.html">EnumSetConverter</a></td>
349                <td>java.util.EnumSet</td>
350                <td class="example">
351                &lt;enum-set enum-type=&quot;simple&quot;&gt;<br/>
352                &nbsp;&nbsp;GREEN,BLUE<br/>
353                &lt;/enum-set&gt;</td>
354                <td>Available under Java 1.5 or greater.</td>
355            </tr>
356            <tr>
357                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/RegexPatternConverter.html">RegexPatternConverter</a></td>
358                <td>java.util.regex.Pattern</td>
359                <td class="example">
360                &lt;java.util.regex.Pattern&gt;<br/>
361				&nbsp;&nbsp;&lt;pattern&gt;.*&lt;/pattern&gt;<br/>
362				&nbsp;&nbsp;&lt;flags&gt;0&lt;/flags&gt;<br/>
363				&lt;/java.util.regex.Pattern&gt;
364                </td>
365                <td>Available under Java 1.4 or greater.</td>
366            </tr>
367
368            <!-- .................................................................................................. -->
369            <tr>
370                <td colspan="4" class="headerRow"><h1 id="java.sql">java.sql</h1></td>
371            </tr>
372            <tr>
373                <th>Converter</th>
374                <th>Supported types</th>
375                <th>Example</th>
376                <th>Notes</th>
377            </tr>
378            <tr>
379                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/SqlDateConverter.html">SqlDateConverter</a></td>
380                <td>java.sql.Date</td>
381                <td class="example">&lt;sql-date&gt;1978-08-25&lt;/sql-date&gt;</td>
382                <td>&nbsp;</td>
383            </tr>
384            <tr>
385                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/SqlTimeConverter.html">SqlTimeConverter</a></td>
386                <td>java.sql.Time</td>
387                <td class="example">&lt;sql-time&gt;14:07:33&lt;/sql-time&gt;</td>
388                <td>&nbsp;</td>
389            </tr>
390            <tr>
391                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/SqlTimestampConverter.html">SqlTimestampConverter</a></td>
392                <td>java.sql.Timestamp</td>
393                <td class="example">&lt;sql-timestamp&gt;1970-01-01 00:00:01.234&lt;/sql-timestamp&gt;</td>
394                <td>&nbsp;</td>
395            </tr>
396            <tr>
397                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ISO8601SqlTimestampConverter.html">ISO8601SqlTimestampConverter</a></td>
398                <td>java.sql.Timestamp</td>
399                <td class="example">&lt;sql-timestamp&gt;2006-07-28T12:06:17.654000000-03:00&lt;/sql-timestamp&gt;</td>
400                <td>Not automatically registered, needs joda-time</td>
401            </tr>
402
403            <!-- .................................................................................................. -->
404            <tr>
405                <td colspan="4" class="headerRow"><h1 id="java.math">java.math</h1></td>
406            </tr>
407            <tr>
408                <th>Converter</th>
409                <th>Supported types</th>
410                <th>Example</th>
411                <th>Notes</th>
412            </tr>
413            <tr>
414                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/BigDecimalConverter.html">BigDecimalConverter</a></td>
415                <td>java.math.BigDecimal</td>
416                <td class="example">&lt;big-decimal&gt;342346.445332&lt;/big-decimal&gt;</td>
417                <td>&nbsp;</td>
418            </tr>
419            <tr>
420                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/BigIntegerConverter.html">BigIntegerConverter</a></td>
421                <td>java.math.BigInteger</td>
422                <td class="example">&lt;big-int&gt;23434224556&lt;/big-int&gt;</td>
423                <td>&nbsp;</td>
424            </tr>
425
426            <!-- .................................................................................................. -->
427            <tr>
428                <td colspan="4" class="headerRow"><h1 id="java.net">java.net</h1></td>
429            </tr>
430            <tr>
431                <th>Converter</th>
432                <th>Supported types</th>
433                <th>Example</th>
434                <th>Notes</th>
435            </tr>
436            <tr>
437                <td><a href="javadoc/com/thoughtworks/xstream/converters/basic/URLConverter.html">URLConverter</a></td>
438                <td>java.net.Url</td>
439                <td class="example">&lt;url&gt;http://codehaus.org/blah&lt;/url&gt;</td>
440                <td>&nbsp;</td>
441            </tr>
442
443            <!-- .................................................................................................. -->
444            <tr>
445                <td colspan="4" class="headerRow"><h1 id="java.io">java.io</h1></td>
446            </tr>
447            <tr>
448                <th>Converter</th>
449                <th>Supported types</th>
450                <th>Example</th>
451                <th>Notes</th>
452            </tr>
453            <tr>
454                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/FileConverter.html">FileConverter</a></td>
455                <td>java.io.File</td>
456                <td class="example">&lt;file&gt;/stuff/hello.txt&lt;/file&gt;</td>
457                <td>&nbsp;</td>
458            </tr>
459            <tr>
460                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/SerializableConverter.html">SerializableConverter</a></td>
461                <td>java.io.Serializable</td>
462                <td>&nbsp;</td>
463                <td>See description at Generalized Converters</td>
464            </tr>
465            <tr>
466                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/ExternalizableConverter.html">ExternalizableConverter</a></td>
467                <td>java.io.Externalizable</td>
468                <td>&nbsp;</td>
469                <td>See description at Generalized Converters</td>
470            </tr>
471
472            <!-- .................................................................................................. -->
473            <tr>
474                <td colspan="4" class="headerRow"><h1 id="java.lang.reflect">java.lang.reflect</h1></td>
475            </tr>
476            <tr>
477                <th>Converter</th>
478                <th>Supported types</th>
479                <th>Example</th>
480                <th>Notes</th>
481            </tr>
482            <tr>
483                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/JavaClassConverter.html">JavaClassConverter</a></td>
484                <td>java.lang.Class</td>
485                <td class="example">&lt;class&gt;com.foo.MyThing&lt;/class&gt;</td>
486                <td>This converter will look for the class in the ClassLoader of the current XStream instance. It is possible
487                to use another ClassLoader by re-registering a new instance of this converter that is wrapped around another
488                ClassLoader.</td>
489            </tr>
490            <tr>
491                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/JavaFieldConverter.html">JavaFieldConverter</a></td>
492                <td>java.lang.reflect.Field</td>
493                <td class="example">
494                    &lt;field&gt;<br/>
495                    &nbsp;&nbsp;&lt;name&gt;myField&lt;/name&gt;<br/>
496                    &nbsp;&nbsp;&lt;class&gt;com.foo.MyThing&lt;/class&gt;<br/>
497                    &lt;/field&gt;
498                </td>
499                <td>As with the JavaClassConverter, the converter will use the ClassLoader of the XStream instance to resolve classes
500                by default. This can be changed by specifying another ClassLoader when constructing this Converter.</td>
501            </tr>
502            <tr>
503                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/JavaMethodConverter.html">JavaMethodConverter</a></td>
504                <td>java.lang.reflect.Method<br/>java.lang.reflect.Constructor</td>
505                <td class="example">
506                    &lt;method&gt;<br/>
507                    &nbsp;&nbsp;&lt;class&gt;com.foo.MyThing&lt;/class&gt;<br/>
508                    &nbsp;&nbsp;&lt;name&gt;doStuff&lt;/name&gt;<br/>
509                    &nbsp;&nbsp;&lt;parameter-types&gt;<br/>
510                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;class&gt;java.lang.String&lt;/class&gt;<br/>
511                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;class&gt;java.util.Iterator&lt;/class&gt;<br/>
512                    &nbsp;&nbsp;&lt;/parameter-types&gt;<br/>
513                    &lt;/method&gt;
514                </td>
515                <td>The enclosing element for this tag will either by &lt;method&gt; or &lt;constructor&gt;. As with the JavaClassConverter, the converter
516                will use the ClassLoader of the XStream instance to resolve classes by default. This can be changed by specifying another ClassLoader when
517                constructing this Converter.</td>
518            </tr>
519            <tr>
520                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/DynamicProxyConverter.html">DynamicProxyConverter</a></td>
521                <td>Any dynamic proxy generated by java.lang.reflect.Proxy</td>
522                <td class="example">
523                    &lt;dynamic-proxy&gt;<br/>
524                    &nbsp;&nbsp;&lt;interface&gt;com.foo.Blah&lt;/interface&gt;<br/>
525                    &nbsp;&nbsp;&lt;interface&gt;com.foo.Woo&lt;/interface&gt;<br/>
526                    &nbsp;&nbsp;&lt;handler class=&quot;com.foo.MyHandler&quot;&gt;<br/>
527                    &nbsp;&nbsp;&nbsp;&nbsp;&lt;something&gt;blah&lt;/something&gt;<br/>
528                    &nbsp;&nbsp;&lt;/handler&gt;<br/>
529                    &lt;/dynamic-proxy&gt;
530                </td>
531                <td>The dynamic proxy itself is not serialized, however the interfaces it implements and the actual InvocationHandler
532                instance are serialized. This allows the proxy to be reconstructed after deserialization.</td>
533            </tr>
534
535            <!-- .................................................................................................. -->
536            <tr>
537                <td colspan="4" class="headerRow"><h1 id="java.awt">java.awt</h1></td>
538            </tr>
539            <tr>
540                <th>Converter</th>
541                <th>Supported types</th>
542                <th>Example</th>
543                <th>Notes</th>
544            </tr>
545            <tr>
546                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ColorConverter.html">ColorConverter</a></td>
547                <td>java.awt.Color</td>
548                <td class="example">
549                    &lt;awt-color&gt;<br/>
550                    &nbsp;&nbsp;&lt;red&gt;255&lt;/red&gt;<br/>
551                    &nbsp;&nbsp;&lt;green&gt;255&lt;/green&gt;<br/>
552                    &nbsp;&nbsp;&lt;blue&gt;255&lt;/blue&gt;<br/>
553                    &nbsp;&nbsp;&lt;alpha&gt;255&lt;/alpha&gt;<br/>
554                    &lt;/awt-color&gt;
555                </td>
556                <td><b>Warning:</b> The AWT toolkit is initialized when a Color is deserialized due to the internals of the Color class.
557                This should only be an issue if deserializing a Color on a headless server process.</td>
558            </tr>
559            <tr>
560                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/FontConverter.html">FontConverter</a></td>
561                <td>java.awt.Font</td>
562                <td class="example">&nbsp;</td>
563                <td><b>Warning:</b> The AWT toolkit is initialized when a Font is deserialized due to the internals of the Font class.
564                This should only be an issue if deserializing a Font on a headless server process.</td>
565            </tr>
566
567            <!-- .................................................................................................. -->
568            <tr>
569                <td colspan="4" class="headerRow"><h1 id="java.awt.font">java.awt.font</h1></td>
570            </tr>
571            <tr>
572                <th>Converter</th>
573                <th>Supported types</th>
574                <th>Example</th>
575                <th>Notes</th>
576            </tr>
577            <tr>
578                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/TextAttributeConverter.html">TextAttributeConverter</a></td>
579                <td>java.awt.font.TextAttribute</td>
580                <td class="example">
581                    &lt;awt-text-attribute&gt;family&lt;/awt-text-attribute&gt;
582                </td>
583                <td><b>Warning:</b> The AWT toolkit is initialized when a TextAttribute is deserialized due to the internals of the TextAttribute class.
584                This should only be an issue if deserializing a TextAttribute on a headless server process.</td>
585            </tr>
586            
587            <!-- .................................................................................................. -->
588            <tr>
589                <td colspan="4" class="headerRow"><h1 id="javax.swing">javax.swing</h1></td>
590            </tr>
591            <tr>
592                <th>Converter</th>
593                <th>Supported types</th>
594                <th>Example</th>
595                <th>Notes</th>
596            </tr>
597            <tr>
598                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/LookAndFeelConverter.html">LookAndFeelConverter</a></td>
599                <td>javax.swing.LookAndFeel implementations</td>
600                <td class="example">&nbsp;</td>
601                <td>Explicit mapping to the ReflectionConverter. Although the implementations of the LookAndFeel classes are serializable, they will
602                throw an exception executing writeObject(), therefore the SerializableConverter is not used.</td>
603            </tr>
604            
605            <!-- .................................................................................................. -->
606            <tr>
607                <td colspan="4" class="headerRow"><h1 id="javax.security.auth">javax.security.auth</h1></td>
608            </tr>
609            <tr>
610                <th>Converter</th>
611                <th>Supported types</th>
612                <th>Example</th>
613                <th>Notes</th>
614            </tr>
615            <tr>
616                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/SubjectConverter.html">SubjectConverter</a></td>
617                <td>javax.security.auth.Subject</td>
618                <td class="example">
619                &lt;auth-subject&gt;<br/>
620				&nbsp;&nbsp;&lt;principals&gt;<br/>
621				&nbsp;&nbsp;&nbsp;&nbsp;&lt;com.thoughtworks.xstream.Admin/&gt;<br/>
622				&nbsp;&nbsp;&lt;/principals&gt;<br/>
623				&nbsp;&nbsp;&lt;readOnly&gt;false&lt;/readOnly&gt;<br/>
624				&lt;/auth-subject&gt;<br/>
625                </td>
626                <td>Available under Java 1.4 or greater. This converter does not serialize any credentials but only the principals.</td>
627            </tr>
628
629            <!-- .................................................................................................. -->
630            <tr>
631                <td colspan="4" class="headerRow"><h1 id="java.nio">java.nio</h1></td>
632            </tr>
633            <tr>
634                <th>Converter</th>
635                <th>Supported types</th>
636                <th>Example</th>
637                <th>Notes</th>
638            </tr>
639            <tr>
640                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/CharsetConverter.html">CharsetConverter</a></td>
641                <td>java.nio.charset.Charset</td>
642                <td class="example">&lt;charset&gt;US-ASCII&lt;/charset&gt;</td>
643                <td>Available under Java 1.4 or greater.</td>
644            </tr>
645
646            <!-- .................................................................................................. -->
647            <tr>
648                <td colspan="4" class="headerRow"><h1 id="javax.xml.datatype">javax.xml.datatype</h1></td>
649            </tr>
650            <tr>
651                <th>Converter</th>
652                <th>Supported types</th>
653                <th>Example</th>
654                <th>Notes</th>
655            </tr>
656            <tr>
657                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/DurationConverter.html">DurationConverter</a></td>
658                <td>javax.xml.datatype.Duration</td>
659                <td class="example">&lt;duration&gt;PT1H2M&lt;/duration&gt;</td>
660                <td>Available under Java 1.5 or greater.</td>
661            </tr>
662
663            <!-- .................................................................................................. -->
664            <tr>
665                <td colspan="4" class="headerRow"><h1 id="generic">Generalized Converters</h1></td>
666            </tr>
667            <tr>
668                <th>Converter</th>
669                <th>Supported types</th>
670                <th>Explanation</th>
671                <th>Notes</th>
672            </tr>
673            <tr>
674                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/ReflectionConverter.html">ReflectionConverter</a></td>
675                <td>Any type</td>
676                <td>The Converter is used as fallback. It uses reflection to examine the class and will serialize its fields.</td>
677                <td>&nbsp;</td>
678            </tr>
679            <tr>
680                <td><a href="javadoc/com/thoughtworks/xstream/annotations/AnnotationReflectionConverter.html">AnnotationReflectionConverter</a></td>
681                <td>Any type</td>
682                <td>The Converter is used as fallback. It uses reflection to examine the class and will serialize its fields and supports annotations for 
683                local converters.</td>
684                <td>Needs JDK 1.5, default for JDK 1.5. Deprecated since XStream 1.3 and must be registered now explicitly.</td>
685            </tr>
686            <tr>
687                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/SerializableConverter.html">SerializableConverter</a></td>
688                <td>java.io.Serializable or types with one of the serializable methods readObject or writeObject</td>
689                <td>The Converter is used for any JDK-serializable types, if not handled by a specialized Converter.</td>
690                <td>&nbsp;</td>
691            </tr>
692            <tr>
693                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/ExternalizableConverter.html">ExternalizableConverter</a></td>
694                <td>java.io.Externalizable</td>
695                <td>The Converter is used for any JDK-externalizable types, if not handled by a specialized Converter.</td>
696                <td>&nbsp;</td>
697            </tr>
698            <tr>
699                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ToAttributesValueConverter.html">ToAttributesValueConverter</a></td>
700                <td>Any type with all but one fields to be represented by a single string</td>
701                <td>The Converter is used to write all but one fields of the type as attributes. The left over field is then used as current value.</td>
702                <td>Must be registered explicitly for the appropriate type</td>
703            </tr>
704            <tr>
705                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/ToStringConverter.html">ToStringConverter</a></td>
706                <td>Any type with natural String representation</td>
707                <td>The Converter must be initialized with a type, that provides a complete String representation with its toString() method
708                and is able to be recreated by a constructor taking a single String argument.</td>
709                <td>Must be registered explicitly for the appropriate type</td>
710            </tr>
711            <tr>
712                <td><a href="javadoc/com/thoughtworks/xstream/converters/javabean/JavaBeanConverter.html">JavaBeanConverter</a></td>
713                <td>Java beans</td>
714                <td>The Converter handles any type as Java bean. It expects the type to convert to have a public default constructor and
715                appropriate getter and setters.</td>
716                <td>Must be registered explicitly. Should be used as fallback.</td>
717            </tr>
718            <tr>
719                <td><a href="javadoc/com/thoughtworks/xstream/converters/extended/PropertyEditorCapableConverter.html">PropertyEditorCapableConverter</a></td>
720                <td>Any type with a PropertyEditor implementation</td>
721                <td>The Converter can handles any type that provides a PropertyEditor implementation. The PropertyEditor's methods getAsText() and
722                setAsText() are used to convert between object and string representation.</td>
723                <td>Must be registered explicitly for the appropriate type.</td>
724            </tr>
725
726            <!-- .................................................................................................. -->
727            <tr>
728                <td colspan="4" class="headerRow"><h1 id="3rdParty">Converters for 3rd party classes</h1></td>
729            </tr>
730            <tr>
731                <th>Converter</th>
732                <th>Supported types</th>
733                <th>Explanation</th>
734                <th>Notes</th>
735            </tr>
736            <tr>
737                <td><a href="javadoc/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.html">CGLIBEnhancedConverter</a></td>
738                <td>Proxies generated by the CGLIB Enhancer</td>
739                <td>The Converter handles proxies generated by the CGLIB Enhancer, if there were not multiple callbacks registered.
740                A proxy with multiple callbacks can currently not be handled at all.</td>
741                <td>Must be registered explicitly in combination with the CGLIBMapper. See <a href="faq.html#Serialization_CGLIB">FAQ</a>.</td>
742            </tr>
743
744        </table>
745
746    
747
748                <br/>
749
750            </div>
751        </div>
752
753        <div class="SidePanel" id="left">
754                <div class="MenuGroup">
755                    <h1>Software</h1>
756                    <ul>
757                                <li><a href="index.html">About XStream</a></li>
758                                <li><a href="news.html">News</a></li>
759                                <li><a href="changes.html">Change History</a></li>
760                                <li><a href="versioning.html">About Versioning</a></li>
761                    </ul>
762                </div>
763                <div class="MenuGroup">
764                    <h1>Evaluating XStream</h1>
765                    <ul>
766                                <li><a href="tutorial.html">Two Minute Tutorial</a></li>
767                                <li><a href="graphs.html">Object references</a></li>
768                                <li><a href="manual-tweaking-output.html">Tweaking the Output</a></li>
769                                <li><a href="license.html">License</a></li>
770                                <li><a href="download.html">Download</a></li>
771                                <li><a href="references.html">References</a></li>
772                                <li><a href="parser-benchmarks.html">Parser Benchmarks</a></li>
773                                <li><a href="http://www.ohloh.net/projects/3459">Code Statistics</a></li>
774                    </ul>
775                </div>
776                <div class="MenuGroup">
777                    <h1>Using XStream</h1>
778                    <ul>
779                                <li><a href="architecture.html">Architecture Overview</a></li>
780                                <li class="currentLink">Converters</li>
781                                <li><a href="faq.html">Frequently Asked Questions</a></li>
782                                <li><a href="list-user.html">Users' Mailing List</a></li>
783                                <li><a href="issues.html">Reporting Issues</a></li>
784                    </ul>
785                </div>
786                <div class="MenuGroup">
787                    <h1>Javadoc</h1>
788                    <ul>
789                                <li><a href="javadoc/index.html">XStream Core</a></li>
790                                <li><a href="hibernate-javadoc/index.html">Hibernate Extensions</a></li>
791                                <li><a href="benchmark-javadoc/index.html">Benchmark Module</a></li>
792                    </ul>
793                </div>
794                <div class="MenuGroup">
795                    <h1>Tutorials</h1>
796                    <ul>
797                                <li><a href="tutorial.html">Two Minute Tutorial</a></li>
798                                <li><a href="alias-tutorial.html">Alias Tutorial</a></li>
799                                <li><a href="annotations-tutorial.html">Annotations Tutorial</a></li>
800                                <li><a href="converter-tutorial.html">Converter Tutorial</a></li>
801                                <li><a href="objectstream.html">Object Streams Tutorial</a></li>
802                                <li><a href="persistence-tutorial.html">Persistence API Tutorial</a></li>
803                                <li><a href="json-tutorial.html">JSON Tutorial</a></li>
804                    </ul>
805                </div>
806                <div class="MenuGroup">
807                    <h1>Developing XStream</h1>
808                    <ul>
809                                <li><a href="how-to-contribute.html">How to Contribute</a></li>
810                                <li><a href="list-dev.html">Developers' Mailing List</a></li>
811                                <li><a href="team.html">Development Team</a></li>
812                                <li><a href="repository.html">Source Repository</a></li>
813                                <li><a href="http://bamboo.ci.codehaus.org/browse/XSTREAM">Continuous Integration</a></li>
814                    </ul>
815                </div>
816        </div>
817
818  </body>
819</html>