javax.enterprise.util

## Class AnnotationLiteral<T extends Annotation>

- java.lang.Object
- - javax.enterprise.util.AnnotationLiteral<T>

- Type Parameters:
    `T` - the annotation type
  All Implemented Interfaces:
    Serializable, Annotation

      public abstract class AnnotationLiteral<T extends Annotation>
      extends Object
      implements Annotation, Serializable

  Supports inline instantiation of annotation type instances.

  An instance of an annotation type may be obtained by subclassing `AnnotationLiteral`.

       public abstract class PayByQualifier extends AnnotationLiteral<PayBy> implements PayBy {
       }

       PayBy paybyCheque = new PayByQualifier() {
           public PaymentMethod value() {
               return CHEQUE;
           }
       };

  Author:
    Pete Muir, Gavin King, Marko Luksa
  See Also:
    `Instance.select(Annotation...)`, `Event.select(Annotation...)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AnnotationLiteral()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Class<? extends Annotation>` | `annotationType()`
    `boolean` | `equals(Object other)`
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AnnotationLiteral

          protected AnnotationLiteral()

  - ### Method Detail

    - #### annotationType

          public Class<? extends Annotation> annotationType()

      Specified by:
        `annotationType` in interface `Annotation`

    - #### toString

          public String toString()

      Specified by:
        `toString` in interface `Annotation`
      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object other)

      Specified by:
        `equals` in interface `Annotation`
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Annotation`
      Overrides:
        `hashCode` in class `Object`

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.