org.eclipse.jpt.jpa.core.resource.java
Interface NestableAnnotation

All Superinterfaces:
Annotation, JavaResourceNode, Model
All Known Subinterfaces:
NestableAssociationOverrideAnnotation, NestableAttributeOverrideAnnotation, NestableEclipseLinkConversionValueAnnotation, NestableJoinColumnAnnotation, NestableMapKeyJoinColumnAnnotation, NestableNamedNativeQueryAnnotation, NestableNamedQueryAnnotation, NestablePrimaryKeyJoinColumnAnnotation, NestableQueryHintAnnotation, NestableSecondaryTableAnnotation, NestableUniqueConstraintAnnotation

public interface NestableAnnotation
extends Annotation

Interface for dealing with annotations that can be "nested" within arrays.

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.0
Version:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode
JavaResourceNode.Root
 
Method Summary
 void convertToNested(ContainerAnnotation<? extends NestableAnnotation> containerAnnotation, DeclarationAnnotationAdapter containerAnnotationAdapter, int index)
          Convert the annotation from "stand-alone" to "nested" within the "container" annotation adapted by the specified adapter at the specified index.
 void convertToStandAlone()
          Convert the annotation from "nested" within the "container" annotation to "stand-alone".
 void moveAnnotation(int index)
          Move the annotation to the specified index within its container array.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.resource.java.Annotation
getAnnotationName, getAstAnnotation, isUnset, newAnnotation, removeAnnotation, restoreFrom, storeOn
 
Methods inherited from interface org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode
getFile, getJavaResourceCompilationUnit, getParent, getRoot, getTextRange, initialize, synchronizeWith
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 

Method Detail

moveAnnotation

void moveAnnotation(int index)
Move the annotation to the specified index within its container array. This should only be called when the annotation is actually nested (as opposed to stand-alone).


convertToNested

void convertToNested(ContainerAnnotation<? extends NestableAnnotation> containerAnnotation,
                     DeclarationAnnotationAdapter containerAnnotationAdapter,
                     int index)
Convert the annotation from "stand-alone" to "nested" within the "container" annotation adapted by the specified adapter at the specified index. The index may have a value of only 0 or 1.

This is used to convert an annotation that is part of the "combination" pattern where a list containing elements of the annotation (e.g. JoinColumnAnnotation) can be represented by either the annotation itself (when there is only a single element in the collection) or a "container" annotation (e.g. JoinColumnsAnnotation) that holds only a single value element that is the array of "nested" annnotations.

See Also:
convertToStandAlone()

convertToStandAlone

void convertToStandAlone()
Convert the annotation from "nested" within the "container" annotation to "stand-alone".

See Also:
convertToNested(ContainerAnnotation, DeclarationAnnotationAdapter, int)