## org.eclipse.jst.ws.annotations.core
Class AnnotationDefinition

    java.lang.Object
      org.eclipse.jst.ws.annotations.core.AnnotationDefinition

    public final class AnnotationDefinition

extends java.lang.Object

An `AnnotationDefinition` is a representation of the information contributed through the `org.eclipse.jst.ws.annotations.core.annotationDefinition`, `org.eclipse.jst.ws.annotations.core.annotationCategory` and `org.eclipse.jst.ws.annotations.core.annotationInitializer` extension points.

It supplies the annotation class name, its annotation category, the applicable targets for the annotation and an `IAnnotationAttributeInitializer` to initialize the annotations element-value pairs.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Constructor Summary
`AnnotationDefinition(org.eclipse.core.runtime.IConfigurationElement configurationElement, java.lang.String category)` Constructs an `AnnotationDefinition` using information from the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point and category name.

Method Summary
`IAnnotationAttributeInitializer` `getAnnotationAttributeInitializer()` Returns the annotations attribute initializer as specified in the `org.eclipse.jst.ws.annotations.core.annotationInitializer` extension point or null if no initializer can be found.
`java.lang.Class<? extends java.lang.annotation.Annotation>` `getAnnotationClass()` Deprecated. As of 1.1 replaced by `getAnnotationType()`
`java.lang.String` `getAnnotationClassName()` Returns the fully qualified class name of the annotation.
`org.eclipse.jdt.core.IType` `getAnnotationType()` Returns the annotation type as specified by the `class` attribute of the `annotation<annotation> element in the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point.`
`java.util.List<java.lang.annotation.ElementType>` `getAnnotationTypeTargets()` Returns a list of `ElementType` that specify the Java elements to which the annotation can be applied.
`java.lang.String` `getCategory()` Returns the category the annotation belongs to.
`java.lang.String` `getName()` Returns the annotation name.
`java.util.List<java.lang.annotation.ElementType>` `getTargets()` Deprecated. as of 1.1 replaced by `getAnnotationTypeTargets()`
`boolean` `isClassOnly()` Returns whether the annotation is restricted to class types.
`boolean` `isEnumOnly()` Returns whether the annotation is restricted to enum types.
`boolean` `isInterfaceOnly()` Returns whether the annotation is restricted to interface types.
`void` `setJavaProject(org.eclipse.jdt.core.IJavaProject javaProject)` Sets the `org.eclipse.jdt.core.IJavaProject` which is used to find the annotation type.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AnnotationDefinition

    public AnnotationDefinition(org.eclipse.core.runtime.IConfigurationElement configurationElement,
                                java.lang.String category)

  Constructs an `AnnotationDefinition` using information from the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point and category name.

  Parameters:
    `configurationElement` - the `annotation` element from the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point
    `category` - the category name

Method Detail

### getName

    public java.lang.String getName()

  Returns the annotation name.

  Returns:
    the annotation name.

### getCategory

    public java.lang.String getCategory()

  Returns the category the annotation belongs to.

  Returns:
    the annotation category.

### getAnnotationClassName

    public java.lang.String getAnnotationClassName()

  Returns the fully qualified class name of the annotation.

  Returns:
    the fully qualified class name of the annotation.

### isClassOnly

    public boolean isClassOnly()

  Returns whether the annotation is restricted to class types.

  Returns:
    `true` if the annotation is restricted to classes only.

### isInterfaceOnly

    public boolean isInterfaceOnly()

  Returns whether the annotation is restricted to interface types.

  Returns:
    `true` if the annotation is restricted to interfaces only.

### isEnumOnly

    public boolean isEnumOnly()

  Returns whether the annotation is restricted to enum types.

  Returns:
    `true` if the annotation is restricted to enums only.

### getAnnotationClass

    @Deprecated
    public java.lang.Class<? extends java.lang.annotation.Annotation> getAnnotationClass()

  Deprecated. As of 1.1 replaced by `getAnnotationType()`

  Returns the annotation class as specified by the `class` attribute of the `annotation<annotation> element in the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point.

  `
  Returns:
    the annotation class or null if not found.

### getAnnotationType

    public org.eclipse.jdt.core.IType getAnnotationType()

  Returns the annotation type as specified by the `class` attribute of the `annotation<annotation> element in the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point.

  `
  Returns:
    the `org.eclipse.jdt.core.IType` which represents an annotation type or null if the java project has not been set, if the type cannot be found or if the type does not represent an annotation type.
  Since:
    1.1
  See Also:
    `setJavaProject(IJavaProject)`

### getTargets

    @Deprecated
    public java.util.List<java.lang.annotation.ElementType> getTargets()

  Deprecated. as of 1.1 replaced by `getAnnotationTypeTargets()`

  Returns a list of `ElementType` that specify the Java elements to which the annotation can be applied.

  The element types are retrieved from the annotations `Target` meta-annotation type. This list can be filtered using the `targetFilter` element on the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point when defining the annotation.

  Returns:
    a list of element types.

### getAnnotationTypeTargets

    public java.util.List<java.lang.annotation.ElementType> getAnnotationTypeTargets()

  Returns a list of `ElementType` that specify the Java elements to which the annotation can be applied.

  The element types are retrieved from the annotations `Target` meta-annotation type. This list can be filtered using the `targetFilter` element on the `org.eclipse.jst.ws.annotations.core.annotationDefinition` extension point when defining the annotation.

  Returns:
    a list of element types or null if the java project has not been set or if the annotation type cannot be found.
  Since:
    1.1
  See Also:
    `setJavaProject(IJavaProject)`

### getAnnotationAttributeInitializer

    public IAnnotationAttributeInitializer getAnnotationAttributeInitializer()

  Returns the annotations attribute initializer as specified in the `org.eclipse.jst.ws.annotations.core.annotationInitializer` extension point or null if no initializer can be found.

  Returns:
    the `IAnnotationAttributeInitializer`

### setJavaProject

    public void setJavaProject(org.eclipse.jdt.core.IJavaProject javaProject)

  Sets the `org.eclipse.jdt.core.IJavaProject` which is used to find the annotation type.

  Since:
    1.1
  See Also:
    `getAnnotationType()`, `getAnnotationTypeTargets()`