Package org.simpleframework.xml.core
Class OverrideType
- java.lang.Object
-
- org.simpleframework.xml.core.OverrideType
-
- All Implemented Interfaces:
Type
class OverrideType extends java.lang.Object implements Type
TheOverrideType
is used to represent a type as class other than that defined in a containing type. This can be used to ensure that a union type does not have to have an attribute defining its type serialized in to the resulting XML.
-
-
Constructor Summary
Constructors Constructor Description OverrideType(Type type, java.lang.Class override)
Constructor for theOverrideType
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> label)
This is the annotation associated with the method or field that has been annotated.java.lang.Class
getType()
This will provide the method or field type.java.lang.String
toString()
This is used to describe the type as it exists within the owning class.
-
-
-
Field Detail
-
override
private final java.lang.Class override
This is the override that is used to represent the type.
-
type
private final Type type
This is the type associated with this override type.
-
-
Constructor Detail
-
OverrideType
public OverrideType(Type type, java.lang.Class override)
Constructor for theOverrideType
object. This is used to create a type object that has an override type which is can be used to ensure serialization does not require any extra data containing the class name of the type instance.- Parameters:
type
- this is the type used internally for thisoverride
- this is the override type to use
-
-
Method Detail
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> label)
This is the annotation associated with the method or field that has been annotated. If this represents an entry to a Java collection such as ajava.util.List
then this will return null for any annotation requested.- Specified by:
getAnnotation
in interfaceType
- Parameters:
label
- this is the type of the annotation to acquire- Returns:
- this provides the annotation associated with this
-
getType
public java.lang.Class getType()
This will provide the method or field type. The type is the class that is to be read and written on the object. Typically the type will be a serializable object or a primitive type.
-
toString
public java.lang.String toString()
This is used to describe the type as it exists within the owning class. This is used to provide error messages that can be used to debug issues that occur when processing.
-
-