org.eclipse.jpt.jaxb.core
Interface JaxbProject

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

public interface JaxbProject
extends JaxbNode

A JAXB project is associated with an Eclipse project (and its corresponding Java project). It holds the "resource" model that corresponds to the various JPA-related resources (the persistence.xml file, its mapping files [orm.xml], and the Java source files). It also holds the "context" model that represents the JPA metadata, as derived from spec-defined defaults, Java source code annotations, and XML descriptors.

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

Nested Class Summary
static interface JaxbProject.Config
          The settings used to construct a JAXB project.
 
Field Summary
static java.lang.String JAXB_FILES_COLLECTION
          ID string used when the JAXB project's collection of JAXB files changes.
 
Method Summary
 void dispose()
          The JAXB project has been removed from the JJAXBPA model.
 JavaResourcePackage getAnnotatedJavaResourcePackage(java.lang.String packageName)
          Return the java resource package for the specified package if and only if it has recognized annotations.
 java.lang.Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages()
          Return the java resource packages that are annotated with 1 or more valid JAXB package annotations
 java.lang.Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes()
          Return all JavaResourceAbstractTypes that are represented by java source within this project, that are also annotated with a recognized annotation (and are persistable)
 Synchronizer getContextModelSynchronizer()
          Return the synchronizer that will synchronize the context model with the resource model whenever the resource model changes.
 JaxbContextRoot getContextRoot()
          Return the root of the JAXB project's context model.
 org.eclipse.jdt.core.IJavaProject getJavaProject()
          Return the Java project associated with the JAXB project.
 JavaResourcePackage getJavaResourcePackage(java.lang.String packageName)
          Return the Java resource package for the specified package.
 java.lang.Iterable<JavaResourcePackage> getJavaResourcePackages()
          Return the Java resource packages for the project.
 JavaResourceAbstractType getJavaResourceType(java.lang.String typeName)
          Return the JavaResourceAbstractType with the specified type name, regardless of what kind it is.
 JavaResourceAbstractType getJavaResourceType(java.lang.String typeName, JavaResourceAbstractType.Kind kind)
          Return the JavaResourceAbstractType with the specified type name and kind.
 java.lang.Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes()
          Return all JavaResourceAbstractTypes that are represented by java source within this project
 JaxbFile getJaxbFile(org.eclipse.core.resources.IFile file)
          Return the JAXB file corresponding to the specified file.
 java.lang.Iterable<JaxbFile> getJaxbFiles()
          Return the JAXB project's JAXB files.
 int getJaxbFilesSize()
          Return the size of the JAXB project's JAXB files.
 JaxbIndexResource getJaxbIndexResource(java.lang.String packageName)
          Return the first jaxb.index resource model (could be multiple if there are multiple locations for a given package) with the given package name
 java.lang.Iterable<JaxbIndexResource> getJaxbIndexResources()
          Return all jaxb.index resource models within the project
 JaxbPropertiesResource getJaxbPropertiesResource(java.lang.String packageName)
          Return the first jaxb.properties resource model (could be multiple if there are multiple locations for a given package) with the given package name
 java.lang.Iterable<JaxbPropertiesResource> getJaxbPropertiesResources()
          Return all jaxb.properties resource models within the project
 CommandExecutor getModifySharedDocumentCommandExecutor()
          Return the project-wide implementation of the CommandExecutor interface.
 java.lang.String getName()
          Return the JAXB project's name, which is the same as the associated Eclipse project's name.
 JaxbPlatform getPlatform()
          Return the vendor-specific JAXB platform that builds the JAXB project and its contents.
 java.lang.Iterable<? extends JavaContextNode> getPrimaryJavaNodes(org.eclipse.jdt.core.ICompilationUnit cu)
          Return all types/package infos that are primary context objects for the given compilation unit
 org.eclipse.core.resources.IProject getProject()
          Return the Eclipse project associated with the JAXB project.
 SchemaLibrary getSchemaLibrary()
          Return the schema library used for validating and user assist
 CallbackSynchronizer getUpdateSynchronizer()
          Return the synchronizer that will update the context model whenever it has any changes.
 java.lang.Iterable<org.eclipse.wst.validation.internal.provisional.core.IMessage> getValidationMessages(org.eclipse.wst.validation.internal.provisional.core.IReporter reporter)
          Return project's validation messages.
 void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
          Synchronize the JPA project with the specified Java change.
 void projectChanged(org.eclipse.core.resources.IResourceDelta delta)
          Synchronize the JPA project with the specified project resource delta, watching for added and removed files in particular.
 void setContextModelSynchronizer(Synchronizer synchronizer)
          Set the synchronizer that will keep the context model synchronized with the resource model whenever the resource model changes.
 void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor)
          Set a thread-specific implementation of the CommandExecutor interface that will be used to execute a command to modify a shared document.
 void setUpdateSynchronizer(CallbackSynchronizer synchronizer)
          Set the synchronizer that will update the context model whenever it has any changes.
 void synchronizeContextModel()
          The JAXB project's resource model has changed; synchronize the JPA project's context model with it.
 org.eclipse.core.runtime.IStatus synchronizeContextModel(org.eclipse.core.runtime.IProgressMonitor monitor)
          This is the callback used by the context model synchronizer to perform the actual "synchronize".
 void synchronizeContextModelAndWait()
          Force the JAXB project's context model to synchronize with it resource model synchronously.
 org.eclipse.core.runtime.IStatus update(org.eclipse.core.runtime.IProgressMonitor monitor)
          This is the callback used by the update synchronizer to perform the actual "update".
 void updateAndWait()
          Force the JAXB project to "update" synchronously.
 
Methods inherited from interface org.eclipse.jpt.jaxb.core.JaxbNode
getJaxbProject, 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

JAXB_FILES_COLLECTION

static final java.lang.String JAXB_FILES_COLLECTION
ID string used when the JAXB project's collection of JAXB files changes.

See Also:
Model.addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener), Constant Field Values
Method Detail

getName

java.lang.String getName()
Return the JAXB project's name, which is the same as the associated Eclipse project's name.


getProject

org.eclipse.core.resources.IProject getProject()
Return the Eclipse project associated with the JAXB project.


getJavaProject

org.eclipse.jdt.core.IJavaProject getJavaProject()
Return the Java project associated with the JAXB project.


getPlatform

JaxbPlatform getPlatform()
Return the vendor-specific JAXB platform that builds the JAXB project and its contents.


getSchemaLibrary

SchemaLibrary getSchemaLibrary()
Return the schema library used for validating and user assist


dispose

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


getJaxbFiles

java.lang.Iterable<JaxbFile> getJaxbFiles()
Return the JAXB project's JAXB files.


getJaxbFilesSize

int getJaxbFilesSize()
Return the size of the JAXB project's JAXB files.


getJaxbFile

JaxbFile getJaxbFile(org.eclipse.core.resources.IFile file)
Return the JAXB file corresponding to the specified file. Return null if there is no JAXB file associated with the specified file.


getJavaResourcePackages

java.lang.Iterable<JavaResourcePackage> getJavaResourcePackages()
Return the Java resource packages for the project. Return null if invalid or absent. These correspond to package-info.java files


getJavaResourcePackage

JavaResourcePackage getJavaResourcePackage(java.lang.String packageName)
Return the Java resource package for the specified package. Return null if invalid or absent.


getAnnotatedJavaResourcePackages

java.lang.Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages()
Return the java resource packages that are annotated with 1 or more valid JAXB package annotations


getAnnotatedJavaResourcePackage

JavaResourcePackage getAnnotatedJavaResourcePackage(java.lang.String packageName)
Return the java resource package for the specified package if and only if it has recognized annotations. Return null otherwise.


getJavaSourceResourceTypes

java.lang.Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes()
Return all JavaResourceAbstractTypes that are represented by java source within this project


getAnnotatedJavaSourceResourceTypes

java.lang.Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes()
Return all JavaResourceAbstractTypes that are represented by java source within this project, that are also annotated with a recognized annotation (and are persistable)


getJavaResourceType

JavaResourceAbstractType getJavaResourceType(java.lang.String typeName)
Return the JavaResourceAbstractType with the specified type name, regardless of what kind it is. Return null if absent.


getJavaResourceType

JavaResourceAbstractType getJavaResourceType(java.lang.String typeName,
                                             JavaResourceAbstractType.Kind kind)
Return the JavaResourceAbstractType with the specified type name and kind. Return null if invalid or absent or if the kind does not match.


getJaxbIndexResources

java.lang.Iterable<JaxbIndexResource> getJaxbIndexResources()
Return all jaxb.index resource models within the project


getJaxbIndexResource

JaxbIndexResource getJaxbIndexResource(java.lang.String packageName)
Return the first jaxb.index resource model (could be multiple if there are multiple locations for a given package) with the given package name


getJaxbPropertiesResources

java.lang.Iterable<JaxbPropertiesResource> getJaxbPropertiesResources()
Return all jaxb.properties resource models within the project


getJaxbPropertiesResource

JaxbPropertiesResource getJaxbPropertiesResource(java.lang.String packageName)
Return the first jaxb.properties resource model (could be multiple if there are multiple locations for a given package) with the given package name


getContextRoot

JaxbContextRoot getContextRoot()
Return the root of the JAXB project's context model.


getPrimaryJavaNodes

java.lang.Iterable<? extends JavaContextNode> getPrimaryJavaNodes(org.eclipse.jdt.core.ICompilationUnit cu)
Return all types/package infos that are primary context objects for the given compilation unit


projectChanged

void projectChanged(org.eclipse.core.resources.IResourceDelta delta)
Synchronize the JPA project with the specified project resource delta, watching for added and removed files in particular.


javaElementChanged

void javaElementChanged(org.eclipse.jdt.core.ElementChangedEvent event)
Synchronize the JPA project with the specified Java change.


getContextModelSynchronizer

Synchronizer getContextModelSynchronizer()
Return the synchronizer that will synchronize the context model with the resource model whenever the resource model changes.


setContextModelSynchronizer

void setContextModelSynchronizer(Synchronizer synchronizer)
Set the synchronizer that will keep the context model synchronized with the resource model whenever the resource model changes. Before setting the synchronizer, clients should save the current synchronizer so it can be restored later.

See Also:
getContextModelSynchronizer()

synchronizeContextModel

void synchronizeContextModel()
The JAXB project's resource model has changed; synchronize the JPA project's context model with it. This method is typically called when the resource model state has changed when it is synchronized with its underlying Eclipse resource as the result of an Eclipse resource change event. This method can also be called when a client (e.g. a JUnit test case) has manipulated the resource model via its API (as opposed to modifying the underlying Eclipse resource directly) and needs the context model to be synchronized accordingly (since manipulating the resource model via its API will not trigger this method). Whether the context model is synchronously (or asynchronously) depends on the current context model synchronizer.

See Also:
synchronizeContextModelAndWait()

synchronizeContextModelAndWait

void synchronizeContextModelAndWait()
Force the JAXB project's context model to synchronize with it resource model synchronously.

See Also:
synchronizeContextModel(), updateAndWait()

synchronizeContextModel

org.eclipse.core.runtime.IStatus synchronizeContextModel(org.eclipse.core.runtime.IProgressMonitor monitor)
This is the callback used by the context model synchronizer to perform the actual "synchronize".


getUpdateSynchronizer

CallbackSynchronizer getUpdateSynchronizer()
Return the synchronizer that will update the context model whenever it has any changes. This allows any intra-JAXB project dependencies to be updated.


setUpdateSynchronizer

void setUpdateSynchronizer(CallbackSynchronizer synchronizer)
Set the synchronizer that will update the context model whenever it has any changes. This allows any intra-JAXB project dependencies to be updated. Before setting the update synchronizer, clients should save the current synchronizer so it can be restored later.

See Also:
getUpdateSynchronizer()

updateAndWait

void updateAndWait()
Force the JAXB project to "update" synchronously.

See Also:
synchronizeContextModelAndWait()

update

org.eclipse.core.runtime.IStatus update(org.eclipse.core.runtime.IProgressMonitor monitor)
This is the callback used by the update synchronizer to perform the actual "update".


getValidationMessages

java.lang.Iterable<org.eclipse.wst.validation.internal.provisional.core.IMessage> getValidationMessages(org.eclipse.wst.validation.internal.provisional.core.IReporter reporter)
Return project's validation messages.


setThreadLocalModifySharedDocumentCommandExecutor

void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor)
Set a thread-specific implementation of the CommandExecutor interface that will be used to execute a command to modify a shared document. If necessary, the command executor can be cleared by setting it to null. This allows background clients to modify documents that are already present in the UI. See implementations of CommandExecutor.


getModifySharedDocumentCommandExecutor

CommandExecutor getModifySharedDocumentCommandExecutor()
Return the project-wide implementation of the CommandExecutor interface.