# Type
Date: 2013-02-18

## org.simpleframework.xml.strategy
Interface Type

    public interface Type

The `Type` interface is used to represent a method or field that has been annotated for serialization. Representing methods and fields as a generic type object allows various common details to be extracted in a uniform way. It allows all annotations on the method or field to be exposed. This can also wrap classes that represent entries to a list or map.

Author:
  Niall Gallagher

Method Summary

`

`<T extends java.lang.annotation.Annotation> T`

`

`getAnnotation(java.lang.Class<T> type)`
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.

Method Detail

### getType

    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.

  Returns:
    this returns the type for this method o field

### getAnnotation

    <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> type)

  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.

  Parameters:
    `type` - this is the type of the annotation to acquire
  Returns:
    this provides the annotation associated with this

### toString

    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.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    this returns a string representation of the type