org.eclipse.jpt.core.resource.java
Interface JavaResourcePersistentMember

All Superinterfaces:
JavaResourceNode, Model
All Known Subinterfaces:
JavaResourcePersistentAttribute, JavaResourcePersistentType, JavaResourcePersistentType2_0

public interface JavaResourcePersistentMember
extends JavaResourceNode

Java source code or binary persistent member.

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.core.resource.java.JavaResourceNode
JavaResourceNode.Root
 
Field Summary
static java.lang.String ANNOTATIONS_COLLECTION
          String associated with changes to the "annotations" collection
static java.lang.String PERSISTABLE_PROPERTY
           
 
Method Summary
 NestableAnnotation addAnnotation(int index, java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Add a new nestable annotation with the specified name.
 Annotation addAnnotation(java.lang.String annotationName)
          Add an annotation with the specified name.
 java.util.Iterator<Annotation> annotations()
          Return the member's annotations in the order that they appear.
 java.util.Iterator<NestableAnnotation> annotations(java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Return the nestable annotations with the specified name in the order that they appear.
 int annotationsSize()
          Return the number of annotations.
 Annotation getAnnotation(java.lang.String annotationName)
          Return the annotation with the specified name.
 TextRange getNameTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the text range for the member's name.
 Annotation getNonNullAnnotation(java.lang.String annotationName)
          Return the specified annotation.
 boolean isAnnotated()
          Return whether the underlying JDT member is currently annotated with any recognized annotations.
 boolean isFor(java.lang.String memberName, int occurrence)
          Return whether the Java resource persistent member is for the specified member.
 boolean isPersistable()
          Return whether the underlying JDT member is persistable according to the JPA spec.
 void moveAnnotation(int targetIndex, int sourceIndex, java.lang.String containerAnnotationName)
          Move the nestable annotation found in the specified container annotation at the specified source index to the specified target index.
 void removeAnnotation(int index, java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Remove the specified nestable annotation from the container annotation at the specified index.
 void removeAnnotation(java.lang.String annotationName)
          Remove the specified annotation.
 void resolveTypes(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Resolve type information that could be dependent on changes elsewhere in the workspace.
 Annotation setPrimaryAnnotation(java.lang.String primaryAnnotationName, java.lang.Iterable<java.lang.String> supportingAnnotationNames)
          Sets the specified primary annotation as the first annotation, and removes all known annotations (i.e.
 
Methods inherited from interface org.eclipse.jpt.core.resource.java.JavaResourceNode
getFile, getJavaResourceCompilationUnit, getRoot, getTextRange, initialize, synchronizeWith
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 

Field Detail

ANNOTATIONS_COLLECTION

static final java.lang.String ANNOTATIONS_COLLECTION
String associated with changes to the "annotations" collection

See Also:
Constant Field Values

PERSISTABLE_PROPERTY

static final java.lang.String PERSISTABLE_PROPERTY
See Also:
Constant Field Values
Method Detail

annotations

java.util.Iterator<Annotation> annotations()
Return the member's annotations in the order that they appear. Do not return duplicate annotations as this error is handled by the Java compiler.


annotationsSize

int annotationsSize()
Return the number of annotations.


getAnnotation

Annotation getAnnotation(java.lang.String annotationName)
Return the annotation with the specified name. Return the first if there are duplicates in the source code.


getNonNullAnnotation

Annotation getNonNullAnnotation(java.lang.String annotationName)
Return the specified annotation. Return the first if there are duplicates in the source code. Do not return null, but a Null Object instead if no annotation with the specified name exists in the source code.


annotations

java.util.Iterator<NestableAnnotation> annotations(java.lang.String nestableAnnotationName,
                                                   java.lang.String containerAnnotationName)
Return the nestable annotations with the specified name in the order that they appear. If nestable and container annotations are both specified on the member directly, return only the nestable annotations specified within the container annotation.


addAnnotation

Annotation addAnnotation(java.lang.String annotationName)
Add an annotation with the specified name. Return the newly-created annotation.


addAnnotation

NestableAnnotation addAnnotation(int index,
                                 java.lang.String nestableAnnotationName,
                                 java.lang.String containerAnnotationName)
Add a new nestable annotation with the specified name. Create a new container annotation if necessary and add the nestable annotation to it. If both the nestable annotation and the container annotation already exist, then add to the container annotation, leaving the existing nestable annotation alone. If only the nestable annotation exists, then create the new container annotation and move the existing nestable annotation to it along with the new one. If neither annotation exists, then create a new nestable annotation.


moveAnnotation

void moveAnnotation(int targetIndex,
                    int sourceIndex,
                    java.lang.String containerAnnotationName)
Move the nestable annotation found in the specified container annotation at the specified source index to the specified target index.


removeAnnotation

void removeAnnotation(java.lang.String annotationName)
Remove the specified annotation.


removeAnnotation

void removeAnnotation(int index,
                      java.lang.String nestableAnnotationName,
                      java.lang.String containerAnnotationName)
Remove the specified nestable annotation from the container annotation at the specified index. If there is no container, assume the index is zero and this does the same as removeAnnotation(String)


setPrimaryAnnotation

Annotation setPrimaryAnnotation(java.lang.String primaryAnnotationName,
                                java.lang.Iterable<java.lang.String> supportingAnnotationNames)
Sets the specified primary annotation as the first annotation, and removes all known annotations (i.e. does not remove non-persistence annotations) which are not included in the supporting annotations.


isPersistable

boolean isPersistable()
Return whether the underlying JDT member is persistable according to the JPA spec.


isAnnotated

boolean isAnnotated()
Return whether the underlying JDT member is currently annotated with any recognized annotations.


isFor

boolean isFor(java.lang.String memberName,
              int occurrence)
Return whether the Java resource persistent member is for the specified member.


getNameTextRange

TextRange getNameTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Return the text range for the member's name.


resolveTypes

void resolveTypes(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
Resolve type information that could be dependent on changes elsewhere in the workspace.