org.eclipse.jpt.core
Interface JpaFile

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

public interface JpaFile
extends JpaNode

A JpaProject contains Jpa files for all IFiles in the project that are relevant to the JpaPlatform.

See Also:
JpaFactory#hasRelevantContent(IFile), this method should be moved to JpaPlatform 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 ROOT_STRUCTURE_NODES_COLLECTION
          String constant associated with changes to the root structure nodes collection
 
Method Summary
 void addRootStructureNode(java.lang.Object key, JpaStructureNode rootStructureNode)
          Add a root context model object represented by this JPA file.
 void dispose()
          The JPA file has been removed from the JPA project.
 org.eclipse.core.resources.IFile getFile()
          Return the IFile associated with this JPA file
 ResourceModel getResourceModel()
          Return the resource model represented by this JPA file
 java.lang.String getResourceType()
          Return the type of resource represented by this JPA file
 JpaStructureNode getStructureNode(int textOffset)
          Return the structure node best represented by the location in the file.
 void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
          Forward the Java element changed event to the JPA file's content.
 void removeRootStructureNode(java.lang.Object key)
           
 java.util.Iterator<JpaStructureNode> rootStructureNodes()
          Return the root context model objects represented by this JPA file.
 int rootStructureNodesSize()
          Return the number of root context model objects represented by this JPA file.
 void updateFromResource()
          Update the JPA resource model from the underlying resource.
 
Methods inherited from interface org.eclipse.jpt.core.JpaNode
getJpaProject, getParent, getResource
 
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
 

Field Detail

ROOT_STRUCTURE_NODES_COLLECTION

static final java.lang.String ROOT_STRUCTURE_NODES_COLLECTION
String constant associated with changes to the root structure nodes collection

See Also:
Constant Field Values
Method Detail

getResourceType

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

See Also:
ResourceModel.getResourceType()

getFile

org.eclipse.core.resources.IFile getFile()
Return the IFile associated with this JPA file


getResourceModel

ResourceModel getResourceModel()
Return the resource model represented by this JPA file


javaElementChanged

void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
Forward the Java element changed event to the JPA file's content.


updateFromResource

void updateFromResource()
Update the JPA resource model from the underlying resource.


dispose

void dispose()
The JPA file has been removed from the JPA project. Clean up any hooks to external resources etc.


rootStructureNodes

java.util.Iterator<JpaStructureNode> rootStructureNodes()
Return the root context model objects represented by this JPA file.


rootStructureNodesSize

int rootStructureNodesSize()
Return the number of root context model objects represented by this JPA file.


addRootStructureNode

void addRootStructureNode(java.lang.Object key,
                          JpaStructureNode rootStructureNode)
Add a root context model object represented by this JPA file. 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. Call removeRootStructureNode(Object) to clean up when a file is deleted.


removeRootStructureNode

void removeRootStructureNode(java.lang.Object key)

getStructureNode

JpaStructureNode getStructureNode(int textOffset)
Return the structure node best represented by the location in the file.