org.eclipse.jpt.jpa.core.context.persistence
Interface ClassRef

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNode, JpaStructureNode, Model, PersistentType.Owner, XmlContextNode

public interface ClassRef
extends XmlContextNode, JpaStructureNode, PersistentType.Owner

Context model corresponding to the XML resource model XmlJavaClassRef, which corresponds to the class element in the persistence.xml file. This is also used for "implied" class refs; i.e. class refs that are not explicitly listed in the persistence.xml file.

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:
3.0

Field Summary
static java.lang.String CLASS_NAME_PROPERTY
          String constant associated with changes to the class name
static java.lang.String JAVA_PERSISTENT_TYPE_PROPERTY
          String constant associated with changes to the java persistent type
 
Method Summary
 boolean containsOffset(int textOffset)
          Return whether the text representation of this persistence unit contains the given text offset
 java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteTypeEdits(org.eclipse.jdt.core.IType type)
          If this isFor(String) the given IType, create a text DeleteEdit for deleting the class element and any text that precedes it.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType, org.eclipse.jdt.core.IPackageFragment newPackage)
          Create ReplaceEdits for moving any references to the originalType to the newPackage.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage, java.lang.String newName)
          Create ReplaceEdits for renaming the class's package to the newName.
 java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType, java.lang.String newName)
          Create ReplaceEdits for renaming the class element to the newName.
 java.lang.String getClassName()
          Return the class name of the class ref.
 JavaPersistentType getJavaPersistentType()
          Return the JavaPersistentType that corresponds to this IClassRef.
 XmlJavaClassRef getXmlClassRef()
          Return the class ref's corresponding resource class ref.
 boolean isFor(java.lang.String typeName)
          Return whether the class ref is a reference to the specified type.
 boolean isVirtual()
          Return true if the mapping file ref is virtual; return false if the mapping file ref is represented by an entry in the persistence.xml file.
 void setClassName(java.lang.String className)
          Set the class name of the class ref.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.XmlContextNode
getValidationTextRange, validate
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaStructureNode
dispose, getId, getResourceType, getSelectionTextRange, getStructureNode
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.PersistentType.Owner
getDefaultPersistentTypeAccess, getOverridePersistentTypeAccess
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, synchronizeWithResourceModel, update
 

Field Detail

CLASS_NAME_PROPERTY

static final java.lang.String CLASS_NAME_PROPERTY
String constant associated with changes to the class name

See Also:
Constant Field Values

JAVA_PERSISTENT_TYPE_PROPERTY

static final java.lang.String JAVA_PERSISTENT_TYPE_PROPERTY
String constant associated with changes to the java persistent type

See Also:
Constant Field Values
Method Detail

isFor

boolean isFor(java.lang.String typeName)
Return whether the class ref is a reference to the specified type.


isVirtual

boolean isVirtual()
Return true if the mapping file ref is virtual; return false if the mapping file ref is represented by an entry in the persistence.xml file.


getXmlClassRef

XmlJavaClassRef getXmlClassRef()
Return the class ref's corresponding resource class ref. This is null for implied class refs.


containsOffset

boolean containsOffset(int textOffset)
Return whether the text representation of this persistence unit contains the given text offset


getClassName

java.lang.String getClassName()
Return the class name of the class ref.


setClassName

void setClassName(java.lang.String className)
Set the class name of the class ref.


getJavaPersistentType

JavaPersistentType getJavaPersistentType()
Return the JavaPersistentType that corresponds to this IClassRef. This can be null. This is not settable by users of this API.


createDeleteTypeEdits

java.lang.Iterable<org.eclipse.text.edits.DeleteEdit> createDeleteTypeEdits(org.eclipse.jdt.core.IType type)
If this isFor(String) the given IType, create a text DeleteEdit for deleting the class element and any text that precedes it. Otherwise return an EmptyIterable. Though this will contain 1 or 0 DeleteEdits, using an Iterable for ease of use with other createDeleteEdit API.


createRenameTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenameTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                             java.lang.String newName)
Create ReplaceEdits for renaming the class element to the newName. The originalType has not yet been renamed, the newName is the new short name. If this ClassRef does not match the original type, then return an empty Iterable.


createMoveTypeEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createMoveTypeEdits(org.eclipse.jdt.core.IType originalType,
                                                                           org.eclipse.jdt.core.IPackageFragment newPackage)
Create ReplaceEdits for moving any references to the originalType to the newPackage. The originalType has not yet been moved.


createRenamePackageEdits

java.lang.Iterable<org.eclipse.text.edits.ReplaceEdit> createRenamePackageEdits(org.eclipse.jdt.core.IPackageFragment originalPackage,
                                                                                java.lang.String newName)
Create ReplaceEdits for renaming the class's package to the newName. The originalPackage has not yet been renamed. If this class is not a part of the original package, then return an empty Iterable.