Class ClassType

java.lang.Object
org.simpleframework.xml.core.ClassType
All Implemented Interfaces:
Type

class ClassType extends Object implements Type
The ClassType object is used to represent a type that is neither a field or method. Such a type is used when an object is to be used to populate a collection. In such a scenario there is no method or field annotations associated with the object.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Class
    This is the type that is represented by this instance.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the ClassType object.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends Annotation>
    T
    This is used to acquire an annotation of the specified type.
    This is the class associated with this type.
    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 Details

    • type

      private final Class type
      This is the type that is represented by this instance.
  • Constructor Details

    • ClassType

      public ClassType(Class type)
      Constructor for the ClassType object. This will create a type used to represent a stand alone object, such as an object being inserted in to a Java collection.
      Parameters:
      type - this is the class that this type represents
  • Method Details

    • getType

      public Class getType()
      This is the class associated with this type. This is used by the serialization framework to determine how the XML is to be converted in to an object and vice versa.
      Specified by:
      getType in interface Type
      Returns:
      this returns the class associated with this type
    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> type)
      This is used to acquire an annotation of the specified type. If no such annotation exists for the type then this will return null. Currently for classes this will always be null.
      Specified by:
      getAnnotation in interface Type
      Parameters:
      type - this is the annotation type be be acquired
      Returns:
      currently this method will always return null
    • toString

      public 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 Object
      Returns:
      this returns a string representation of the type