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

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

public interface JavaResourcePersistentMember
extends JavaResourceNode

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.


Field Summary
static java.lang.String MAPPING_ANNOTATIONS_COLLECTION
           
static java.lang.String PERSISTABLE_PROPERTY
           
static java.lang.String SUPPORTING_ANNOTATIONS_COLLECTION
           
 
Method Summary
 JavaResourceNode addSupportingAnnotation(int index, java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Add a new supporting nestable annotation with the specified name.
 JavaResourceNode addSupportingAnnotation(java.lang.String annotationName)
          Add a supporting annotation with the specified name.
 JavaResourceNode getMappingAnnotation()
          Return the member's mapping annotation.
 JavaResourceNode getMappingAnnotation(java.lang.String annotationName)
          Return the mapping annotation with the specified name.
 TextRange getNameTextRange(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Return the text range for the member's name.
 JavaResourceNode getNonNullSupportingAnnotation(java.lang.String annotationName)
          Return the specified supporting annotation.
 JavaResourceNode getNullMappingAnnotation(java.lang.String annotationName)
          Return a null mapping annotation with the specified name.
 JavaResourceNode getSupportingAnnotation(java.lang.String annotationName)
          Return the specified supporting annotation.
 boolean isFor(MethodSignature methodSignature, int occurrence)
          Return whether the Java resource persistent member is for the specified method.
 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.
 boolean isPersisted()
          Return whether the underlying JDT member is currently annotated as being persistent (equivalent to "is mapped").
 java.util.Iterator<Annotation> mappingAnnotations()
          Return the member's mapping annotations.
 int mappingAnnotationsSize()
          Return the number of mapping annotations.
 void moveSupportingAnnotation(int targetIndex, int sourceIndex, java.lang.String containerAnnotationName)
          Move the supporting nestable annotation found in the specified container annotation at the specified source index to the specified target index.
 void removeSupportingAnnotation(int index, java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Remove the specified supporting nestable annotation.
 void removeSupportingAnnotation(java.lang.String annotationName)
          Remove the specified supporting annotation.
 void resolveTypes(org.eclipse.jdt.core.dom.CompilationUnit astRoot)
          Resolve type information that could be dependent on other files being added or removed.
 void setMappingAnnotation(java.lang.String annotationName)
          Change the mapping annotation.
 java.util.Iterator<Annotation> supportingAnnotations()
          Return the member's supporting annotations.
 java.util.ListIterator<NestableAnnotation> supportingAnnotations(java.lang.String nestableAnnotationName, java.lang.String containerAnnotationName)
          Return the specified supporting nested annotations.
 int supportingAnnotationsSize()
          Return the number of supporting annotations.
 
Methods inherited from interface org.eclipse.jpt.core.resource.java.JavaResourceNode
getFile, getJpaCompilationUnit, getTextRange, initialize, update
 
Methods inherited from interface org.eclipse.jpt.utility.model.Model
addCollectionChangeListener, addCollectionChangeListener, addListChangeListener, addListChangeListener, addPropertyChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, addTreeChangeListener, removeCollectionChangeListener, removeCollectionChangeListener, removeListChangeListener, removeListChangeListener, removePropertyChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener, removeTreeChangeListener
 

Field Detail

MAPPING_ANNOTATIONS_COLLECTION

static final java.lang.String MAPPING_ANNOTATIONS_COLLECTION
See Also:
Constant Field Values

SUPPORTING_ANNOTATIONS_COLLECTION

static final java.lang.String SUPPORTING_ANNOTATIONS_COLLECTION
See Also:
Constant Field Values

PERSISTABLE_PROPERTY

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

mappingAnnotations

java.util.Iterator<Annotation> mappingAnnotations()
Return the member's mapping annotations. Do not return duplicate annotations as this error is handled by the java compiler.

See Also:
supportingAnnotations()

mappingAnnotationsSize

int mappingAnnotationsSize()
Return the number of mapping annotations.


getMappingAnnotation

JavaResourceNode getMappingAnnotation()
Return the member's mapping annotation.


getMappingAnnotation

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


setMappingAnnotation

void setMappingAnnotation(java.lang.String annotationName)
Change the mapping annotation. Remove any existing mapping annotations. Do not remove any non-mapping annotations.


getNullMappingAnnotation

JavaResourceNode getNullMappingAnnotation(java.lang.String annotationName)
Return a null mapping annotation with the specified name. The corresponding AnnotationDefinition must implement #buildNullAnnotation() AnnotationDefinition.buildNullAnnotation(JavaResourcePersistentMember, org.eclipse.jpt.core.utility.jdt.Member)


supportingAnnotations

java.util.Iterator<Annotation> supportingAnnotations()
Return the member's supporting annotations. Do not return duplicate annotations as this error is handled by the java compiler. Do not return any mapping annotations.

See Also:
mappingAnnotations()

supportingAnnotationsSize

int supportingAnnotationsSize()
Return the number of supporting annotations.


supportingAnnotations

java.util.ListIterator<NestableAnnotation> supportingAnnotations(java.lang.String nestableAnnotationName,
                                                                 java.lang.String containerAnnotationName)
Return the specified supporting nested annotations. If both the nestable and container annotations are specified on the member directly, return only the nestable annotations specified within the container annotation.


getSupportingAnnotation

JavaResourceNode getSupportingAnnotation(java.lang.String annotationName)
Return the specified supporting annotation. Return the first if there are duplicates in the source code.


getNonNullSupportingAnnotation

JavaResourceNode getNonNullSupportingAnnotation(java.lang.String annotationName)
Return the specified supporting 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.


addSupportingAnnotation

JavaResourceNode addSupportingAnnotation(java.lang.String annotationName)
Add a supporting annotation with the specified name.


removeSupportingAnnotation

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


addSupportingAnnotation

JavaResourceNode addSupportingAnnotation(int index,
                                         java.lang.String nestableAnnotationName,
                                         java.lang.String containerAnnotationName)
Add a new supporting 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 annotaion 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.


removeSupportingAnnotation

void removeSupportingAnnotation(int index,
                                java.lang.String nestableAnnotationName,
                                java.lang.String containerAnnotationName)
Remove the specified supporting nestable annotation.


moveSupportingAnnotation

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


isPersistable

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


isPersisted

boolean isPersisted()
Return whether the underlying JDT member is currently annotated as being persistent (equivalent to "is mapped").


isFor

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


isFor

boolean isFor(MethodSignature methodSignature,
              int occurrence)
Return whether the Java resource persistent member is for the specified method.


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 other files being added or removed.