@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD})
@Documented
public @interface XStreamConverter
Mapper
: The current mapper chain of the XStream
instance.ClassLoaderReference
: The reference to the class
loader used by the XStream instance to deserialize the objects.ReflectionProvider
: The reflection
provider used by the reflection based converters of the current XStream instance.ConverterLookup
: The lookup for converters
handling a special type.Class
: The type of the element where the annotation is declared. Note, that this
argument is not supported when using
XStreamConverters
or useImplicitType()
== false.JVM
: Utility e.g. to load classes.ClassLoader
(deprecated since 1.4.5): The class loader used by the XStream
instance to deserialize the objects. Use ClassLoaderReference as argumentThe algorithm will try the converter's constructor with the most arguments first.
Note, the annotation matches a ConverterMatcher
.
Converter
as well as
SingleValueConverter
extend this interface. The
AnnotationMapper
can only handle these two
known types.
Modifier and Type | Required Element and Description |
---|---|
java.lang.Class<? extends ConverterMatcher> |
value |
Modifier and Type | Optional Element and Description |
---|---|
boolean[] |
booleans |
byte[] |
bytes |
char[] |
chars |
double[] |
doubles |
float[] |
floats |
int[] |
ints |
long[] |
longs |
java.lang.Class<?>[] |
nulls
Provide null types as arguments for the converter's constructor arguments.
|
int |
priority |
short[] |
shorts |
java.lang.String[] |
strings |
java.lang.Class<?>[] |
types
Provide class types as arguments for the converter's constructor arguments.
|
boolean |
useImplicitType
Flag to provide the current type as implicit first Class argument to a converter's
constructor.
|
public abstract java.lang.Class<? extends ConverterMatcher> value
public abstract boolean useImplicitType
public abstract java.lang.Class<?>[] types
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.
Copyright © 2004–2024 XStream. All rights reserved.