org.eclipse.jpt.jpa.core.resource.java
Interface AnnotationContainer<T extends NestableAnnotation>

All Known Subinterfaces:
AssociationOverridesAnnotation, AttributeOverridesAnnotation, ContainerAnnotation<T>, JoinColumnsAnnotation, MapKeyJoinColumns2_0Annotation, NamedNativeQueriesAnnotation, NamedQueriesAnnotation, PrimaryKeyJoinColumnsAnnotation, SecondaryTablesAnnotation

public interface AnnotationContainer<T extends NestableAnnotation>

Common behavior for all annotation "containers". This interface is used mainly in org.eclipse.jpt.jpa.core.internal.resource.java.source.AnnotationContainerTools.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is 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.

Since:
2.2
Version:
2.3

Method Summary
 T addNestedAnnotation()
          Add a nested annotation to the container without firing change notification.
 org.eclipse.jdt.core.dom.Annotation getAstAnnotation(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the corresponding JDT DOM annotation from the specified AST compilation unit.
 java.lang.String getElementName()
          Return the name of the container annotation's element that is used to indicate the nested annotations (typically "value").
 java.lang.String getNestedAnnotationName()
          Return the name of the nested annotations held by the container.
 java.lang.Iterable<T> getNestedAnnotations()
          Return the nested annotations held by the container.
 int getNestedAnnotationsSize()
          Return the number of nested annotations held by the container.
 T moveNestedAnnotation(int targetIndex, int sourceIndex)
          Move the nested annotation at the specified source index in the container to the specified target index without firing change notification.
 T removeNestedAnnotation(int index)
          Remove the nested annotation at the specified index from the container without firing change notification.
 void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation)
          The specified JDT DOM annotation was added to the JDT DOM annotation corresponding to the container.
 void syncRemoveNestedAnnotations(int index)
          The JDT DOM annotations starting at the specified index were removed from the JDT DOM annotations corresponding to the container.
 

Method Detail

getAstAnnotation

org.eclipse.jdt.core.dom.Annotation getAstAnnotation(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return the corresponding JDT DOM annotation from the specified AST compilation unit. Used as a starting point when traversing the AST.


getElementName

java.lang.String getElementName()
Return the name of the container annotation's element that is used to indicate the nested annotations (typically "value"). Used when traversing the AST.


getNestedAnnotationName

java.lang.String getNestedAnnotationName()
Return the name of the nested annotations held by the container. Used when traversing the AST.


getNestedAnnotations

java.lang.Iterable<T> getNestedAnnotations()
Return the nested annotations held by the container.


getNestedAnnotationsSize

int getNestedAnnotationsSize()
Return the number of nested annotations held by the container.


addNestedAnnotation

T addNestedAnnotation()
Add a nested annotation to the container without firing change notification.


syncAddNestedAnnotation

void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation)
The specified JDT DOM annotation was added to the JDT DOM annotation corresponding to the container. Add a corresponding nested annotation to the container and notify interested parties.


moveNestedAnnotation

T moveNestedAnnotation(int targetIndex,
                       int sourceIndex)
Move the nested annotation at the specified source index in the container to the specified target index without firing change notification. Return the moved nested annotation.


removeNestedAnnotation

T removeNestedAnnotation(int index)
Remove the nested annotation at the specified index from the container without firing change notification.


syncRemoveNestedAnnotations

void syncRemoveNestedAnnotations(int index)
The JDT DOM annotations starting at the specified index were removed from the JDT DOM annotations corresponding to the container. Remove the corresponding nested annotations from the container and notify interested parties.