## com.google.gwt.core.ext.typeinfo
Interface HasAnnotations

All Known Implementing Classes:
  JAbstractMethod, JAnnotationMethod, JAnnotationType, JArrayType, JClassType, JConstructor, JEnumConstant, JEnumType, JField, JGenericType, JMethod, JPackage, JParameter, JParameterizedType, JRawType, JRealClassType, JTypeParameter, JWildcardType

    public interface HasAnnotations

Interface implemented by elements that can have annotations. This interface is a departure for GWT in that it used types declared in the java.lang.annotation package instead of types declared as part of this typeinfo package. This reflects a compromise between a pure `TypeOracle` model and one that is more useful to developers.

Method Summary

`

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

`

`getAnnotation(java.lang.Class<T> annotationClass)`
Returns an instance of the specified annotation type if it is present on this element or `null` if it is not.

`boolean` | `isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)` Returns `true` if this item has an annotation of the specified type.

Method Detail

### getAnnotation

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

  Returns an instance of the specified annotation type if it is present on this element or `null` if it is not.

  Parameters:
    `annotationClass` - annotation type to search for
  Returns:
    instance of the specified annotation type if it is present on this element or `null` if it is not

### isAnnotationPresent

    boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)

  Returns `true` if this item has an annotation of the specified type.

  Parameters:
    `annotationClass` -
  Returns:
    `true` if this item has an annotation of the specified type