Top Description Methods
com.thoughtworks.xstream.annotations

public @Interface XStreamConverter

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE, FIELD
@Documented
Imports
com.thoughtworks.xstream.XStream, com.thoughtworks.xstream.converters.ConverterMatcher, java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

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. com.thoughtworks.xstream.converters.Converter as well as com.thoughtworks.xstream.converters.SingleValueConverter extend this interface. The com.thoughtworks.xstream.mapper.AnnotationMapper can only handle these two known types.

Authors
Chung-Onn Cheong, Jörg Schaible

Method Summary

Modifier and TypeMethod and Description
public boolean[]
public byte[]
public char[]
public double[]
public float[]
public int[]
ints()

public long[]
public Class<?>[]

Returns:

the types provided as null values
nulls
()

Provide null types as arguments for the converter's constructor arguments.

public int
public short[]
public String[]
public Class<?>[]

Returns:

the types
types
()

Provide class types as arguments for the converter's constructor arguments.

public boolean

Returns:

true if the current type is provided
useImplicitType
()

Flag to provide the current type as implicit first Class argument to a converter's constructor.

public Class<? extends ConverterMatcher>
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

booleansback to summary
public boolean[] booleans()
bytesback to summary
public byte[] bytes()
charsback to summary
public char[] chars()
doublesback to summary
public double[] doubles()
floatsback to summary
public float[] floats()
intsback to summary
public int[] ints()
longsback to summary
public long[] longs()
nullsback to summary
public Class<?>[] nulls()

Provide null types as arguments for the converter's constructor arguments.

Returns:Class<?>[]

the types provided as null values

Since
1.4.9
priorityback to summary
public int priority()
shortsback to summary
public short[] shorts()
stringsback to summary
public String[] strings()
typesback to summary
public 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. This behavior can be overridden setting useImplicitType() to false.

Returns:Class<?>[]

the types

Since
1.4.2
useImplicitTypeback to summary
public boolean useImplicitType()

Flag to provide the current type as implicit first Class argument to a converter's constructor.

Returns:boolean

true if the current type is provided

Since
1.4.5
valueback to summary
public Class<? extends ConverterMatcher> value()