org.eclipse.jpt.jpa.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 spec. 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.2

Field Summary
static java.lang.String ROOT_STRUCTURE_NODES_COLLECTION
           
 
Method Summary
 void addRootStructureNode(java.lang.Object key, JpaStructureNode rootStructureNode)
          Add a root structure node.
 org.eclipse.core.runtime.content.IContentType getContentType()
          Return the JPA file's content type.
 org.eclipse.core.resources.IFile getFile()
          Return the JPA file's Eclipse file.
 JptResourceModel getResourceModel()
          Return the resource model corresponding to the JPA file; typically a JPA compilation unit, a JPA XML resource, or a JPA package fragment root (JAR).
 JptResourceModel getResourceModel(org.eclipse.core.runtime.content.IContentType contentType)
          Convenience method.
 java.lang.Iterable<JpaStructureNode> getRootStructureNodes()
          Return the JPA file's root structure nodes.
 int getRootStructureNodesSize()
          Return the count of the JPA file's root context model objects.
 JpaStructureNode getStructureNode(int textOffset)
          Return the structure node best corresponding to the location in the file.
 void removeRootStructureNode(java.lang.Object key, JpaStructureNode rootStructureNode)
          Remove the root structure node for the specified key if its current value is the same as the specified node.
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
getJpaProject, getParent, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.IResourcePart
getResource
 

Field Detail

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.


getContentType

org.eclipse.core.runtime.content.IContentType getContentType()
Return the JPA file's content type.


getResourceModel

JptResourceModel getResourceModel()
Return the resource model corresponding to the JPA file; typically a JPA compilation unit, a JPA XML resource, or a JPA package fragment root (JAR).


getResourceModel

JptResourceModel getResourceModel(org.eclipse.core.runtime.content.IContentType contentType)
Convenience method. Return the resource model corresponding to the JPA file if the file's content is a "kind-of" the specified content type; otherwise, return null. This is useful when a client has looked up the JPA file via a file name [and assumed content type].

See Also:
getResourceModel()

getRootStructureNodes

java.lang.Iterable<JpaStructureNode> getRootStructureNodes()
Return the JPA file's root structure nodes.


getRootStructureNodesSize

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


addRootStructureNode

void addRootStructureNode(java.lang.Object key,
                          JpaStructureNode rootStructureNode)
Add a root structure node. There is the potential for multiple root structure nodes for a particular key. For example, a Java type can be listed both as a <class> in the persistence.xml file and as an <entity> in an orm.xml file. In this case, the Jave type in the orm.xml file must set the root structure node after the Java type in the persistence.xml file. Last one in during project update wins.


removeRootStructureNode

void removeRootStructureNode(java.lang.Object key,
                             JpaStructureNode rootStructureNode)
Remove the root structure node for the specified key if its current value is the same as the specified node.

See Also:
addRootStructureNode(Object, JpaStructureNode)

getStructureNode

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