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

All Superinterfaces:
JavaResourceNode, Model
All Known Subinterfaces:
Access2_0Annotation, AssociationOverride2_0Annotation, AssociationOverrideAnnotation, AssociationOverridesAnnotation, AttributeOverrideAnnotation, AttributeOverridesAnnotation, BaseColumnAnnotation, BaseEclipseLinkTypeConverterAnnotation, BaseJoinColumnAnnotation, BaseTableAnnotation, BasicAnnotation, Cacheable2_0Annotation, CollectionTable2_0Annotation, ColumnAnnotation, CompleteColumnAnnotation, ContainerAnnotation<T>, DiscriminatorColumnAnnotation, DiscriminatorValueAnnotation, EclipseLinkBasicCollectionAnnotation, EclipseLinkBasicMapAnnotation, EclipseLinkCacheAnnotation, EclipseLinkChangeTrackingAnnotation, EclipseLinkClassExtractorAnnotation2_1, EclipseLinkConversionValueAnnotation, EclipseLinkConvertAnnotation, EclipseLinkConverterAnnotation, EclipseLinkCustomizerAnnotation, EclipseLinkExistenceCheckingAnnotation, EclipseLinkJoinFetchAnnotation, EclipseLinkMutableAnnotation, EclipseLinkNamedConverterAnnotation, EclipseLinkObjectTypeConverterAnnotation, EclipseLinkPrimaryKeyAnnotation, EclipseLinkPrivateOwnedAnnotation, EclipseLinkReadOnlyAnnotation, EclipseLinkReadTransformerAnnotation, EclipseLinkStructConverterAnnotation, EclipseLinkTimeOfDayAnnotation, EclipseLinkTransformationAnnotation, EclipseLinkTransformerAnnotation, EclipseLinkTypeConverterAnnotation, EclipseLinkVariableOneToOneAnnotation, EclipseLinkWriteTransformerAnnotation, ElementCollection2_0Annotation, EmbeddableAnnotation, EmbeddedAnnotation, EmbeddedIdAnnotation, EntityAnnotation, EnumeratedAnnotation, GeneratedAnnotation, GeneratedValueAnnotation, GeneratorAnnotation, IdAnnotation, IdClassAnnotation, InheritanceAnnotation, JoinColumnAnnotation, JoinColumnsAnnotation, JoinTableAnnotation, LobAnnotation, ManyToMany2_0Annotation, ManyToManyAnnotation, ManyToOne2_0Annotation, ManyToOneAnnotation, MapKeyAnnotation, MapKeyClass2_0Annotation, MapKeyColumn2_0Annotation, MapKeyEnumerated2_0Annotation, MapKeyJoinColumn2_0Annotation, MapKeyJoinColumns2_0Annotation, MapKeyTemporal2_0Annotation, MappedSuperclassAnnotation, MapsId2_0Annotation, NamedColumnAnnotation, NamedNativeQueriesAnnotation, NamedNativeQueryAnnotation, NamedQueriesAnnotation, NamedQuery2_0Annotation, NamedQueryAnnotation, NestableAnnotation, NestableAssociationOverrideAnnotation, NestableAttributeOverrideAnnotation, NestableEclipseLinkConversionValueAnnotation, NestableJoinColumnAnnotation, NestableMapKeyJoinColumnAnnotation, NestableNamedNativeQueryAnnotation, NestableNamedQueryAnnotation, NestablePrimaryKeyJoinColumnAnnotation, NestableQueryHintAnnotation, NestableSecondaryTableAnnotation, NestableUniqueConstraintAnnotation, OneToMany2_0Annotation, OneToManyAnnotation, OneToOne2_0Annotation, OneToOneAnnotation, OrderByAnnotation, OrderColumn2_0Annotation, OverrideAnnotation, OwnableRelationshipMappingAnnotation, PrimaryKeyJoinColumnAnnotation, PrimaryKeyJoinColumnsAnnotation, QueryAnnotation, QueryHintAnnotation, ReferenceTableAnnotation, RelationshipMapping2_0Annotation, RelationshipMappingAnnotation, SecondaryTableAnnotation, SecondaryTablesAnnotation, SequenceGenerator2_0Annotation, SequenceGeneratorAnnotation, SingleRelationshipMappingAnnotation, StaticMetamodelAnnotation, TableAnnotation, TableGeneratorAnnotation, TemporalAnnotation, TransientAnnotation, UniqueConstraintAnnotation, VersionAnnotation

public interface Annotation
extends JavaResourceNode

Common Java resource annotation behavior

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.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode
JavaResourceNode.Root
 
Method Summary
 java.lang.String getAnnotationName()
          Return the annotation's fully qualified name, as opposed to the value of the annotation's name element.
 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.
 boolean isUnset()
          Return whether all the annotation's member values are null; implying the annotation can be removed if it has no semantic value as a marker annotation.
 void newAnnotation()
          Create and add the corresponding Java annotation to the JDT DOM.
 void removeAnnotation()
          Remove the corresponding Java annotation from the JDT DOM.
 void restoreFrom(java.util.Map<java.lang.String,java.lang.Object> map)
          Restore the annotation's state from the specified map, recursing into nested annotations.
 void storeOn(java.util.Map<java.lang.String,java.lang.Object> map)
          Store the annotation's state in the specified map, recursing into nested annotations.
 
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

getAnnotationName

java.lang.String getAnnotationName()
Return the annotation's fully qualified name, as opposed to the value of the annotation's name element. For example:
     @com.foo.Bar(name="Thomas")
 
#getAnnotationName() will return "com.foo.Bar". In typical subclasses, #getName() would return "Thomas".

See Also:
JPA

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.


newAnnotation

void newAnnotation()
Create and add the corresponding Java annotation to the JDT DOM.


removeAnnotation

void removeAnnotation()
Remove the corresponding Java annotation from the JDT DOM.


isUnset

boolean isUnset()
Return whether all the annotation's member values are null; implying the annotation can be removed if it has no semantic value as a marker annotation.


storeOn

void storeOn(java.util.Map<java.lang.String,java.lang.Object> map)
Store the annotation's state in the specified map, recursing into nested annotations. Once the state is stored, clear it.

This is used to save an annotation's state when it is converted from stand-alone to nested (and vice versa). During tests, and possibly at other times (albeit asynchronously), the annotation's state is cleared out when the new annotation is written to the Java source file; since this will trigger a Java change event and the annotation will be sync'ed with the, now empty, Java source code annotation.

See Also:
restoreFrom(Map)

restoreFrom

void restoreFrom(java.util.Map<java.lang.String,java.lang.Object> map)
Restore the annotation's state from the specified map, recursing into nested annotations.

See Also:
storeOn(Map)