Annotation Type XStreamConverter
-
@Retention(RUNTIME) @Target({TYPE,FIELD}) @Documented public @interface XStreamConverterAnnotation to declare a converter. The annotation supports additionally the injection of various constructor arguments provided by XStream: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.- All elements provided with the individual arrays of this annotation. The provided values follow the declaration sequence if a constructor requires multiple arguments of the same type.
Class: The type of the element where the annotation is declared. Note, that this argument is not supported when usingXStreamConvertersoruseImplicitType()== 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 argument
The algorithm will try the converter's constructor with the most arguments first.
Note, the annotation matches a
ConverterMatcher.Converteras well asSingleValueConverterextend this interface. TheAnnotationMappercan only handle these two known types.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.Class<? extends ConverterMatcher>value
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean[]booleansbyte[]byteschar[]charsdouble[]doublesfloat[]floatsint[]intslong[]longsjava.lang.Class<?>[]nullsProvide null types as arguments for the converter's constructor arguments.intpriorityshort[]shortsjava.lang.String[]stringsjava.lang.Class<?>[]typesProvide class types as arguments for the converter's constructor arguments.booleanuseImplicitTypeFlag to provide the current type as implicit first Class argument to a converter's constructor.
-
-
-
Element Detail
-
value
java.lang.Class<? extends ConverterMatcher> value
-
-
-
types
java.lang.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
XStreamConvertersannotation). The current type has precedence over any type provided with this method. This behavior can be overridden settinguseImplicitType()to false.- Returns:
- the types
- Since:
- 1.4.2
- Default:
- {}
-
-