com.thoughtworks.xstream.annotations
Annotation Type XStreamConverter


@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD})
@Documented
public @interface XStreamConverter

Annotation to declare a converter. The annotation supports additionally the injection of various constructor arguments provided by XStream:

The algorithm will try the converter's constructor with the most arguments first.

Note, the annotation matches a ConverterMatcher. ConverterMatcher as well as SingleValueConverter extend this interface. The AnnotationMapper can only handle these two known types.

Author:
Chung-Onn Cheong, Jörg Schaible

Required Element Summary
 Class<? extends ConverterMatcher> value
           
 
Optional Element Summary
 boolean[] booleans
           
 byte[] bytes
           
 char[] chars
           
 double[] doubles
           
 float[] floats
           
 int[] ints
           
 long[] longs
           
 int priority
           
 short[] shorts
           
 String[] strings
           
 Class<?>[] types
          Provide class types as arguments for the converter's constructor arguments.
 

Element Detail

value

public abstract Class<? extends ConverterMatcher> value

priority

public abstract int priority
Default:
0

types

public abstract Class<?>[] types
Provide class types as arguments for the converter's constructor arguments.

Note, that XStream itself provides the current class type as first Class argument to a constructor, if the annotation is added directly to a class type (and not as part of a parameter declaration of a XStreamConverters annotation). The current type has precedence over any type provided with this method.

Returns:
the types
Since:
1.4.2
Default:
{}

strings

public abstract String[] strings
Default:
{}

bytes

public abstract byte[] bytes
Default:
{}

chars

public abstract char[] chars
Default:
{}

shorts

public abstract short[] shorts
Default:
{}

ints

public abstract int[] ints
Default:
{}

longs

public abstract long[] longs
Default:
{}

floats

public abstract float[] floats
Default:
{}

doubles

public abstract double[] doubles
Default:
{}

booleans

public abstract boolean[] booleans
Default:
{}


Copyright © 2004-2014 XStream. All Rights Reserved.