Class OverrideType

  • All Implemented Interfaces:
    Type

    class OverrideType
    extends java.lang.Object
    implements Type
    The OverrideType 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class override
      This is the override that is used to represent the type.
      private Type type
      This is the type associated with this override type.
    • Constructor Summary

      Constructors 
      Constructor Description
      OverrideType​(Type type, java.lang.Class override)
      Constructor for the OverrideType object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 the OverrideType 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 this
        override - 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 a java.util.List then this will return null for any annotation requested.
        Specified by:
        getAnnotation in interface Type
        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.
        Specified by:
        getType in interface Type
        Returns:
        this returns the type for this method o field
      • 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.
        Specified by:
        toString in interface Type
        Overrides:
        toString in class java.lang.Object
        Returns:
        this returns a string representation of the type