org.eclipse.jpt.core
Interface JpaFile

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaNode, Model

public interface JpaFile
extends JpaNode

A JPA Project contains JPA files for all files in the project that are relevant to the JPA platform. 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 JAVA_RESOURCE_TYPE
          Constant representing a Java resource type.
static java.lang.String ORM_RESOURCE_TYPE
          Constant representing a mapping file (e.g.
static java.lang.String PERSISTENCE_RESOURCE_TYPE
          Constant representing a persistence.xml resource type.
static java.lang.String ROOT_STRUCTURE_NODES_COLLECTION
           
 
Method Summary
 void addResourceModelListener(ResourceModelListener listener)
          Changes to the resource model result in events.
 void addRootStructureNode(java.lang.Object key, JpaStructureNode rootStructureNode)
          Add a root context structure node.
 org.eclipse.core.resources.IFile getFile()
          Return the JPA file's Eclipse file.
 java.lang.String getResourceType()
          Return the type of resource held by the JPA file.
 JpaStructureNode getStructureNode(int textOffset)
          Return the structure node best corresponding to the location in the file.
 void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
          A JDT Java element has changed.
 void jpaFilesChanged()
          Calculate any information that is dependent on other files being added or removed.
 java.util.Iterator<JavaResourcePersistentType> persistableTypes()
          Return all the types that are "persistable", as defined by the JPA spec.
 void removeResourceModelListener(ResourceModelListener listener)
           
 void removeRootStructureNode(java.lang.Object key)
           
 java.util.Iterator<JpaStructureNode> rootStructureNodes()
          Return the JPA file's root structure nodes.
 int rootStructureNodesSize()
          Return the count of the JPA file's root context model objects.
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent
 
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
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.core.IResourcePart
getResource
 

Field Detail

JAVA_RESOURCE_TYPE

static final java.lang.String JAVA_RESOURCE_TYPE
Constant representing a Java resource type.

See Also:
getResourceType(), Constant Field Values

PERSISTENCE_RESOURCE_TYPE

static final java.lang.String PERSISTENCE_RESOURCE_TYPE
Constant representing a persistence.xml resource type.

See Also:
getResourceType(), Constant Field Values

ORM_RESOURCE_TYPE

static final java.lang.String ORM_RESOURCE_TYPE
Constant representing a mapping file (e.g. orm.xml) resource type.

See Also:
getResourceType(), Constant Field Values

ROOT_STRUCTURE_NODES_COLLECTION

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

getFile

org.eclipse.core.resources.IFile getFile()
Return the JPA file's Eclipse file.


persistableTypes

java.util.Iterator<JavaResourcePersistentType> persistableTypes()
Return all the types that are "persistable", as defined by the JPA spec.


javaElementChanged

void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
A JDT Java element has changed. Synchronize the JPA file's resource model.


jpaFilesChanged

void jpaFilesChanged()
Calculate any information that is dependent on other files being added or removed. For now, only the Java resource model needs this; in particular, it needs to re-calculate resolved types.


getResourceType

java.lang.String getResourceType()
Return the type of resource held by the JPA file.


addResourceModelListener

void addResourceModelListener(ResourceModelListener listener)
Changes to the resource model result in events. In particular, the JPA project performs an "update" whenever a resource changes.


removeResourceModelListener

void removeResourceModelListener(ResourceModelListener listener)
See Also:
#addResourceModelChangeListener(ResourceModelListener)

rootStructureNodes

java.util.Iterator<JpaStructureNode> rootStructureNodes()
Return the JPA file's root structure nodes.


rootStructureNodesSize

int rootStructureNodesSize()
Return the count of the JPA file's root context model objects.


addRootStructureNode

void addRootStructureNode(java.lang.Object key,
                          JpaStructureNode rootStructureNode)
Add a root context structure node. There is the potential for multiple root structure nodes for a particular key. For example, a Java file that is listed both as a in the persistence.xml and as an in an orm.xml file. In this case the orm.xml file needs to set the root structure node after the Java class reference. Last one in during project "update" wins.


removeRootStructureNode

void removeRootStructureNode(java.lang.Object key)
See Also:
addRootStructureNode(Object, JpaStructureNode)

getStructureNode

JpaStructureNode getStructureNode(int textOffset)
Return the structure node best corresponding to the location in the file.