Dali Provisional API
Release 3.2

org.eclipse.jpt.jaxb.core
Interface JaxbProject

All Superinterfaces:
IAdaptable, JaxbNode, Model
All Known Subinterfaces:
ELJaxbProject

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

Nested Class Summary
static interface JaxbProject.Config
          The settings used to construct a JAXB project.
 
Field Summary
static String EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION
          ID string used when the JPA project's collection of external Java resource compilation units changes.
static IProjectFacet FACET
          The JAXB project facet.
static String FACET_ID
          The JAXB project facet ID.
static String JAXB_FILES_COLLECTION
          ID string used when the JAXB project's collection of JAXB files changes.
static String MARKER_TYPE
          The JAXB validation marker type (value: "org.eclipse.jpt.jaxb.core.problem").
static String MARKER_TYPE_SCOPE
           
static String MARKER_TYPE_SCOPE_
           
static String RELATIVE_MARKER_TYPE
           
 
Method Summary
 void dispose()
          The JAXB project has been removed from the JJAXBPA model.
 JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName)
          Return the java resource package for the specified package if and only if it has recognized annotations.
 Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages()
          Return the java resource packages that are annotated with 1 or more valid JAXB package annotations
 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)
 org.eclipse.jpt.jaxb.core.utility.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.
 Iterable<JavaResourceCompilationUnit> getExternalJavaResourceCompilationUnits()
          Return the JPA project's external Java resource compilation units.
 int getExternalJavaResourceCompilationUnitsSize()
          Return the size of the JPA project's external Java resource compilation units.
 JavaResourceTypeCache getExternalJavaResourceTypeCache()
          Return the JPA project's external Java resource persistent type cache.
 IJavaProject getJavaProject()
          Return the Java project associated with the JAXB project.
 JavaResourcePackage getJavaResourcePackage(String packageName)
          Return the Java resource package for the specified package.
 Iterable<JavaResourcePackage> getJavaResourcePackages()
          Return the Java resource packages for the project.
 JavaResourceAbstractType getJavaResourceType(String typeName)
          Return the JavaResourceAbstractType with the specified type name, regardless of what kind it is.
 JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAnnotatedElement.AstNodeType astNodeType)
          Return the JavaResourceAbstractType with the specified type name and astNodeType.
 Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes()
          Return all JavaResourceAbstractTypes that are represented by java source within this project
 JaxbFile getJaxbFile(IFile file)
          Return the JAXB file corresponding to the specified file.
 Iterable<JaxbFile> getJaxbFiles()
          Return the JAXB project's JAXB files.
 int getJaxbFilesSize()
          Return the size of the JAXB project's JAXB files.
 JaxbIndexResource getJaxbIndexResource(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
 Iterable<JaxbIndexResource> getJaxbIndexResources()
          Return all jaxb.index resource models within the project
 JaxbPropertiesResource getJaxbPropertiesResource(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
 Iterable<JaxbPropertiesResource> getJaxbPropertiesResources()
          Return all jaxb.properties resource models within the project
 ExtendedCommandExecutor getModifySharedDocumentCommandExecutor()
          Return the project-wide implementation of the ExtendedCommandExecutor interface.
 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.
 Iterable<? extends JaxbContextNode> getPrimaryJavaNodes(ICompilationUnit cu)
          Return all types/package infos that are primary context objects for the given compilation unit
 IProject getProject()
          Return the Eclipse project associated with the JAXB project.
 SchemaLibrary getSchemaLibrary()
          Return the schema library used for validating and user assist
 org.eclipse.jpt.jaxb.core.utility.CallbackSynchronizer getUpdateSynchronizer()
          Return the synchronizer that will update the context model whenever it has any changes.
 Iterable<IMessage> getValidationMessages(IReporter reporter)
          Return project's validation messages.
 void javaElementChanged(ElementChangedEvent event)
          Synchronize the JPA project with the specified Java change.
 void projectChanged(IResourceDelta delta)
          Synchronize the JPA project with the specified project resource delta, watching for added and removed files in particular.
 void setContextModelSynchronizer(org.eclipse.jpt.jaxb.core.utility.Synchronizer synchronizer)
          Set the synchronizer that will keep the context model synchronized with the resource model whenever the resource model changes.
 void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor)
          Set a thread-specific implementation of the ExtendedCommandExecutor interface that will be used to execute a command to modify a shared document.
 void setUpdateSynchronizer(org.eclipse.jpt.jaxb.core.utility.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.
 IStatus synchronizeContextModel(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.
 IStatus update(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, getResource, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

FACET_ID

static final String FACET_ID
The JAXB project facet ID.

Value: "jpt.jaxb"

See Also:
Constant Field Values

FACET

static final IProjectFacet FACET
The JAXB project facet.


MARKER_TYPE_SCOPE

static final String MARKER_TYPE_SCOPE

MARKER_TYPE_SCOPE_

static final String MARKER_TYPE_SCOPE_

RELATIVE_MARKER_TYPE

static final String RELATIVE_MARKER_TYPE
See Also:
Constant Field Values

MARKER_TYPE

static final String MARKER_TYPE
The JAXB validation marker type (value: "org.eclipse.jpt.jaxb.core.problem").

See org.eclipse.jpt.jaxb.core/plugin.xml:org.eclipse.core.resources.markers.

See Also:
IMarker.getType()

JAXB_FILES_COLLECTION

static final 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

EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION

static final String EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION
ID string used when the JPA project's collection of external Java resource compilation units changes.

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

getName

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


getProject

IProject getProject()
Return the Eclipse project associated with the JAXB project.


getJavaProject

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

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(IFile file)
Return the JAXB file corresponding to the specified file. Return null if there is no JAXB file associated with the specified file.


getExternalJavaResourceCompilationUnits

Iterable<JavaResourceCompilationUnit> getExternalJavaResourceCompilationUnits()
Return the JPA project's external Java resource compilation units.


getExternalJavaResourceCompilationUnitsSize

int getExternalJavaResourceCompilationUnitsSize()
Return the size of the JPA project's external Java resource compilation units.


getExternalJavaResourceTypeCache

JavaResourceTypeCache getExternalJavaResourceTypeCache()
Return the JPA project's external Java resource persistent type cache.


getJavaResourcePackages

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(String packageName)
Return the Java resource package for the specified package. Return null if invalid or absent.


getAnnotatedJavaResourcePackages

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


getAnnotatedJavaResourcePackage

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


getJavaSourceResourceTypes

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


getAnnotatedJavaSourceResourceTypes

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(String typeName)
Return the JavaResourceAbstractType with the specified type name, regardless of what kind it is. Return null if absent.


getJavaResourceType

JavaResourceAbstractType getJavaResourceType(String typeName,
                                             JavaResourceAnnotatedElement.AstNodeType astNodeType)
Return the JavaResourceAbstractType with the specified type name and astNodeType. Return null if invalid or absent or if the astNodeType does not match.


getJaxbIndexResources

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


getJaxbIndexResource

JaxbIndexResource getJaxbIndexResource(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

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


getJaxbPropertiesResource

JaxbPropertiesResource getJaxbPropertiesResource(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

Iterable<? extends JaxbContextNode> getPrimaryJavaNodes(ICompilationUnit cu)
Return all types/package infos that are primary context objects for the given compilation unit


projectChanged

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


javaElementChanged

void javaElementChanged(ElementChangedEvent event)
Synchronize the JPA project with the specified Java change.


getContextModelSynchronizer

org.eclipse.jpt.jaxb.core.utility.Synchronizer getContextModelSynchronizer()
Return the synchronizer that will synchronize the context model with the resource model whenever the resource model changes.


setContextModelSynchronizer

void setContextModelSynchronizer(org.eclipse.jpt.jaxb.core.utility.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

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


getUpdateSynchronizer

org.eclipse.jpt.jaxb.core.utility.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(org.eclipse.jpt.jaxb.core.utility.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

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


getValidationMessages

Iterable<IMessage> getValidationMessages(IReporter reporter)
Return project's validation messages.


setThreadLocalModifySharedDocumentCommandExecutor

void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor)
Set a thread-specific implementation of the ExtendedCommandExecutor 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 ExtendedCommandExecutor.


getModifySharedDocumentCommandExecutor

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


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.