org.eclipse.jpt.jpa.core
Class JptJpaCorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.jpt.jpa.core.JptJpaCorePlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class JptJpaCorePlugin
extends org.eclipse.core.runtime.Plugin

The Dali core plug-in lifecycle implementation. A number of globally-available constants and methods.

Provisional API: This class 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:
3.0

Field Summary
static java.lang.String CONTENT_PREFIX
           
static java.lang.String CONTENT_PREFIX_
           
static org.eclipse.core.runtime.QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME
          The key for storing a JPA project's data source connection profile name in the Eclipse project's persistent properties.
static java.lang.String DEFAULT_JPA_PLATFORM_1_0_PREF_KEY
          The key for storing the default JPA platform ID for JPA 1.0 in the workspace preferences.
static java.lang.String DEFAULT_JPA_PLATFORM_2_0_PREF_KEY
          The key for storing the default JPA platform ID for JPA 2.0 in the workspace preferences.
static java.lang.String DEFAULT_JPA_PLATFORM_PREF_KEY
          Deprecated. As of version 2.3. Instead use DEFAULT_JPA_PLATFORM_1_0_PREF_KEY or DEFAULT_JPA_PLATFORM_2_0_PREF_KEY
static org.eclipse.core.runtime.IPath DEFAULT_ORM_XML_RUNTIME_PATH
           
static org.eclipse.core.runtime.IPath DEFAULT_PERSISTENCE_XML_RUNTIME_PATH
           
static java.lang.String DISCOVER_ANNOTATED_CLASSES
          The key for storing a JPA project's "discover" flag in the Eclipse project's preferences.
static java.lang.String LEGACY_PLUGIN_ID
          The legacy plug-in identifier of the persistence support, used for project preferences (value "org.eclipse.jpt.core").
static java.lang.String LEGACY_PLUGIN_ID_
           
static org.eclipse.core.runtime.content.IContentType MAPPING_FILE_CONTENT_TYPE
          The base content type for all mapping files.
static java.lang.String METAMODEL_SOURCE_FOLDER_NAME
          The key for storing the name of a JPA project's metamodel source folder in the Eclipse project's preferences.
static JptResourceType ORM_XML_1_0_RESOURCE_TYPE
          The resource type for orm.xml version 1.0 mapping files
static JptResourceType ORM_XML_2_0_RESOURCE_TYPE
          The resource type for orm.xml version 2.0 mapping files
static org.eclipse.core.runtime.content.IContentType ORM_XML_CONTENT_TYPE
          The content type for orm.xml mapping files.
static JptResourceType PERSISTENCE_XML_1_0_RESOURCE_TYPE
          The resource type for persistence.xml version 1.0 files
static JptResourceType PERSISTENCE_XML_2_0_RESOURCE_TYPE
          The resource type for persistence.xml version 2.0 files
static org.eclipse.core.runtime.content.IContentType PERSISTENCE_XML_CONTENT_TYPE
          The content type for persistence.xml files.
static java.lang.String PLUGIN_ID
          The plug-in identifier of the persistence support (value "org.eclipse.jpt.jpa.core").
static java.lang.String PLUGIN_ID_
           
static org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_CATALOG
          The key for storing a JPA project's user overridden default catalog name in the Eclipse project's persistent properties.
static org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA
          The key for storing a JPA project's user overridden default schema name in the Eclipse project's persistent properties.
static java.lang.String VALIDATION_MARKER_ID
          The identifier for the JPA validation marker (value "org.eclipse.jpt.jpa.core.jpaProblemMarker").
static java.lang.String VALIDATOR_ID
          The identifier for the JPA validator (value "org.eclipse.jpt.jpa.core.jpaValidator").
static org.eclipse.wst.common.project.facet.core.IProjectFacet WEB_FACET
          Web projects have some special exceptions.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
JptJpaCorePlugin()
           
 
Method Summary
static void clearProjectPersistentProperties(org.eclipse.core.resources.IProject project)
          Clear the JPA-specific project properties
static void clearProjectPreferences(org.eclipse.core.resources.IProject project)
          Clears the project of JPA-specific preferences
static void clearProjectPreferences(org.eclipse.core.resources.IProject project, java.lang.String... preferenceKeys)
          Clears the specified preferences
static boolean discoverAnnotatedClasses(org.eclipse.core.resources.IProject project)
          Return the JPA "discover" flag associated with the specified Eclipse project.
static java.lang.String getConnectionProfileName(org.eclipse.core.resources.IProject project)
          Return the name of the connection profile associated with the specified Eclipse project.
static JpaPlatformDescription getDefaultJpaPlatform(org.eclipse.wst.common.project.facet.core.IProjectFacetVersion jpaFacetVersion)
          Return the default JpaPlatformDescription for new JPA projects with the given JPA facet version.
static org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()
          Return the default Dali preferences
static org.eclipse.core.runtime.IPath getJarRuntimeRootPath(org.eclipse.core.resources.IProject project)
          Return the runtime path to which JARs are relatively specified for the given project.
static JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
          Return the JPA file corresponding to the specified Eclipse file, or null if unable to associate the specified file with a JPA file.
static JpaFile getJpaFile(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath runtimePath)
           
static JpaPlatformDescription getJpaPlatformDescription(org.eclipse.core.resources.IProject project)
          Return the JPA platform description associated with the specified Eclipse project.
static java.lang.String getJpaPlatformId(org.eclipse.core.resources.IProject project)
          Return the JPA platform ID associated with the specified Eclipse project.
static java.lang.String getJpaPlatformIdPrefKey()
          Return the preferences key used to look up an Eclipse project's JPA platform ID.
static JpaPlatformManager getJpaPlatformManager()
           
static JpaProject getJpaProject(org.eclipse.core.resources.IProject project)
          Return the JPA project corresponding to the specified Eclipse project, or null if unable to associate the specified project with a JPA project.
static JpaProjectManager getJpaProjectManager()
          Return the singular JPA project manager corresponding to the current workspace.
static java.lang.String getMetamodelSourceFolderName(org.eclipse.core.resources.IProject project)
          Return the name of the metamodel source folder associated with the specified Eclipse project.
static org.eclipse.core.runtime.preferences.IEclipsePreferences getProjectPreferences(org.eclipse.core.resources.IProject project)
          Return the Dali preferences for the specified Eclipse project.
 javax.xml.parsers.SAXParserFactory getSAXParserFactory()
           
static java.lang.String getUserOverrideDefaultCatalog(org.eclipse.core.resources.IProject project)
          Return the default catalog (identifier) associated with the specified Eclipse project.
static java.lang.String getUserOverrideDefaultSchema(org.eclipse.core.resources.IProject project)
          Return the default schema (identifier) associated with the specified Eclipse project.
static org.eclipse.core.runtime.preferences.IEclipsePreferences getWorkspacePreferences()
          Return the Dali preferences for the current workspace instance.
static void initializeDefaultPreferences()
           
static JptJpaCorePlugin instance()
          Return the singleton Dali core plug-in.
static boolean javaElementChangeListenerIsActive()
          Return whether the JPA project manager's Java change listener is active.
static void log(org.eclipse.core.runtime.IStatus status)
          Log the specified status.
static void log(java.lang.String msg)
          Log the specified message.
static void log(java.lang.String msg, java.lang.Throwable throwable)
          Log the specified message and exception or error.
static void log(java.lang.Throwable throwable)
          Log the specified exception or error.
static boolean nodeIsJpa2_0Compatible(JpaNode jpaNode)
           
static boolean projectHasWebFacet(org.eclipse.core.resources.IProject project)
          Return whether the specified Eclipse project has a Web facet.
static void rebuildJpaProject(org.eclipse.core.resources.IProject project)
          The JPA settings associated with the specified Eclipse project have changed in such a way as to require the associated JPA project to be completely rebuilt (e.g.
static void setConnectionProfileName(org.eclipse.core.resources.IProject project, java.lang.String connectionProfileName)
          Set the name of the connection profile associated with the specified Eclipse project.
static void setDefaultJpaPlatformId(java.lang.String jpaFacetVersion, java.lang.String platformId)
          Set the default JPA platform ID for creating new JPA projects
static void setDiscoverAnnotatedClasses(org.eclipse.core.resources.IProject project, boolean discoverAnnotatedClasses)
          Set the JPA "discover" flag associated with the specified Eclipse project.
static void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive)
          Set whether the JPA project manager's Java change listener is active.
static void setJpaPlatformId(org.eclipse.core.resources.IProject project, java.lang.String jpaPlatformId)
          Set the JPA platform ID associated with the specified Eclipse project.
static void setMetamodelSourceFolderName(org.eclipse.core.resources.IProject project, java.lang.String metamodelSourceFolderName)
          Set the name of the metamodel source folder associated with the specified Eclipse project.
static void setProjectPreference(org.eclipse.core.resources.IProject project, java.lang.String preferenceKey, boolean preferenceValue)
          Set the project preference
static void setProjectPreference(org.eclipse.core.resources.IProject project, java.lang.String preferenceKey, java.lang.String preferenceValue)
          Set the project preference
static void setUserOverrideDefaultCatalog(org.eclipse.core.resources.IProject project, java.lang.String defaultCatalog)
          Set the default catalog (identifier) associated with the specified Eclipse project.
static void setUserOverrideDefaultSchema(org.eclipse.core.resources.IProject project, java.lang.String defaultSchema)
          Set the default schema (identifier) associated with the specified Eclipse project.
static void setWorkspacePreference(java.lang.String preferenceKey, java.lang.String preferenceValue)
          Set the workspace preference.
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
The plug-in identifier of the persistence support (value "org.eclipse.jpt.jpa.core").

See Also:
Constant Field Values

PLUGIN_ID_

public static final java.lang.String PLUGIN_ID_
See Also:
Constant Field Values

LEGACY_PLUGIN_ID

public static final java.lang.String LEGACY_PLUGIN_ID
The legacy plug-in identifier of the persistence support, used for project preferences (value "org.eclipse.jpt.core").

See Also:
Constant Field Values

LEGACY_PLUGIN_ID_

public static final java.lang.String LEGACY_PLUGIN_ID_
See Also:
Constant Field Values

DEFAULT_JPA_PLATFORM_PREF_KEY

@Deprecated
public static final java.lang.String DEFAULT_JPA_PLATFORM_PREF_KEY
Deprecated. As of version 2.3. Instead use DEFAULT_JPA_PLATFORM_1_0_PREF_KEY or DEFAULT_JPA_PLATFORM_2_0_PREF_KEY
The old key for storing the default JPA platform ID in the workspace preferences.

See Also:
Constant Field Values

DEFAULT_JPA_PLATFORM_1_0_PREF_KEY

public static final java.lang.String DEFAULT_JPA_PLATFORM_1_0_PREF_KEY
The key for storing the default JPA platform ID for JPA 1.0 in the workspace preferences.


DEFAULT_JPA_PLATFORM_2_0_PREF_KEY

public static final java.lang.String DEFAULT_JPA_PLATFORM_2_0_PREF_KEY
The key for storing the default JPA platform ID for JPA 2.0 in the workspace preferences.


DISCOVER_ANNOTATED_CLASSES

public static final java.lang.String DISCOVER_ANNOTATED_CLASSES
The key for storing a JPA project's "discover" flag in the Eclipse project's preferences.

See Also:
Constant Field Values

METAMODEL_SOURCE_FOLDER_NAME

public static final java.lang.String METAMODEL_SOURCE_FOLDER_NAME
The key for storing the name of a JPA project's metamodel source folder in the Eclipse project's preferences.

See Also:
Constant Field Values

DATA_SOURCE_CONNECTION_PROFILE_NAME

public static final org.eclipse.core.runtime.QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME
The key for storing a JPA project's data source connection profile name in the Eclipse project's persistent properties.


USER_OVERRIDE_DEFAULT_CATALOG

public static final org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_CATALOG
The key for storing a JPA project's user overridden default catalog name in the Eclipse project's persistent properties.


USER_OVERRIDE_DEFAULT_SCHEMA

public static final org.eclipse.core.runtime.QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA
The key for storing a JPA project's user overridden default schema name in the Eclipse project's persistent properties.


VALIDATION_MARKER_ID

public static final java.lang.String VALIDATION_MARKER_ID
The identifier for the JPA validation marker (value "org.eclipse.jpt.jpa.core.jpaProblemMarker").

See Also:
Constant Field Values

VALIDATOR_ID

public static final java.lang.String VALIDATOR_ID
The identifier for the JPA validator (value "org.eclipse.jpt.jpa.core.jpaValidator").

See Also:
Constant Field Values

PERSISTENCE_XML_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType PERSISTENCE_XML_CONTENT_TYPE
The content type for persistence.xml files.


PERSISTENCE_XML_1_0_RESOURCE_TYPE

public static final JptResourceType PERSISTENCE_XML_1_0_RESOURCE_TYPE
The resource type for persistence.xml version 1.0 files


PERSISTENCE_XML_2_0_RESOURCE_TYPE

public static final JptResourceType PERSISTENCE_XML_2_0_RESOURCE_TYPE
The resource type for persistence.xml version 2.0 files


MAPPING_FILE_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType MAPPING_FILE_CONTENT_TYPE
The base content type for all mapping files.


ORM_XML_CONTENT_TYPE

public static final org.eclipse.core.runtime.content.IContentType ORM_XML_CONTENT_TYPE
The content type for orm.xml mapping files.


ORM_XML_1_0_RESOURCE_TYPE

public static final JptResourceType ORM_XML_1_0_RESOURCE_TYPE
The resource type for orm.xml version 1.0 mapping files


ORM_XML_2_0_RESOURCE_TYPE

public static final JptResourceType ORM_XML_2_0_RESOURCE_TYPE
The resource type for orm.xml version 2.0 mapping files


WEB_FACET

public static final org.eclipse.wst.common.project.facet.core.IProjectFacet WEB_FACET
Web projects have some special exceptions.


DEFAULT_PERSISTENCE_XML_RUNTIME_PATH

public static final org.eclipse.core.runtime.IPath DEFAULT_PERSISTENCE_XML_RUNTIME_PATH

DEFAULT_ORM_XML_RUNTIME_PATH

public static final org.eclipse.core.runtime.IPath DEFAULT_ORM_XML_RUNTIME_PATH

CONTENT_PREFIX

public static final java.lang.String CONTENT_PREFIX
See Also:
Constant Field Values

CONTENT_PREFIX_

public static final java.lang.String CONTENT_PREFIX_
See Also:
Constant Field Values
Constructor Detail

JptJpaCorePlugin

public JptJpaCorePlugin()
Method Detail

instance

public static JptJpaCorePlugin instance()
Return the singleton Dali core plug-in.


getJpaProjectManager

public static JpaProjectManager getJpaProjectManager()
Return the singular JPA project manager corresponding to the current workspace.


getJpaProject

public static JpaProject getJpaProject(org.eclipse.core.resources.IProject project)
Return the JPA project corresponding to the specified Eclipse project, or null if unable to associate the specified project with a JPA project.


getJpaFile

public static JpaFile getJpaFile(org.eclipse.core.resources.IFile file)
Return the JPA file corresponding to the specified Eclipse file, or null if unable to associate the specified file with a JPA file.


rebuildJpaProject

public static void rebuildJpaProject(org.eclipse.core.resources.IProject project)
The JPA settings associated with the specified Eclipse project have changed in such a way as to require the associated JPA project to be completely rebuilt (e.g. when the user changes a project's JPA platform).


projectHasWebFacet

public static boolean projectHasWebFacet(org.eclipse.core.resources.IProject project)
Return whether the specified Eclipse project has a Web facet.


getJpaFile

public static JpaFile getJpaFile(org.eclipse.core.resources.IProject project,
                                 org.eclipse.core.runtime.IPath runtimePath)

getJarRuntimeRootPath

public static org.eclipse.core.runtime.IPath getJarRuntimeRootPath(org.eclipse.core.resources.IProject project)
Return the runtime path to which JARs are relatively specified for the given project. (Web projects have a different runtime structure than non-web projects.)


initializeDefaultPreferences

public static void initializeDefaultPreferences()

getDefaultPreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()
Return the default Dali preferences

See Also:
JpaPreferenceInitializer

getWorkspacePreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getWorkspacePreferences()
Return the Dali preferences for the current workspace instance.


setWorkspacePreference

public static void setWorkspacePreference(java.lang.String preferenceKey,
                                          java.lang.String preferenceValue)
Set the workspace preference.


getProjectPreferences

public static org.eclipse.core.runtime.preferences.IEclipsePreferences getProjectPreferences(org.eclipse.core.resources.IProject project)
Return the Dali preferences for the specified Eclipse project.


setProjectPreference

public static void setProjectPreference(org.eclipse.core.resources.IProject project,
                                        java.lang.String preferenceKey,
                                        java.lang.String preferenceValue)
Set the project preference


setProjectPreference

public static void setProjectPreference(org.eclipse.core.resources.IProject project,
                                        java.lang.String preferenceKey,
                                        boolean preferenceValue)
Set the project preference


clearProjectPreferences

public static void clearProjectPreferences(org.eclipse.core.resources.IProject project)
Clears the project of JPA-specific preferences


clearProjectPreferences

public static void clearProjectPreferences(org.eclipse.core.resources.IProject project,
                                           java.lang.String... preferenceKeys)
Clears the specified preferences


getDefaultJpaPlatform

public static JpaPlatformDescription getDefaultJpaPlatform(org.eclipse.wst.common.project.facet.core.IProjectFacetVersion jpaFacetVersion)
Return the default JpaPlatformDescription for new JPA projects with the given JPA facet version.


getJpaPlatformManager

public static JpaPlatformManager getJpaPlatformManager()

setDefaultJpaPlatformId

public static void setDefaultJpaPlatformId(java.lang.String jpaFacetVersion,
                                           java.lang.String platformId)
Set the default JPA platform ID for creating new JPA projects


getJpaPlatformId

public static java.lang.String getJpaPlatformId(org.eclipse.core.resources.IProject project)
Return the JPA platform ID associated with the specified Eclipse project.


getJpaPlatformDescription

public static JpaPlatformDescription getJpaPlatformDescription(org.eclipse.core.resources.IProject project)
Return the JPA platform description associated with the specified Eclipse project.


setJpaPlatformId

public static void setJpaPlatformId(org.eclipse.core.resources.IProject project,
                                    java.lang.String jpaPlatformId)
Set the JPA platform ID associated with the specified Eclipse project.


getJpaPlatformIdPrefKey

public static java.lang.String getJpaPlatformIdPrefKey()
Return the preferences key used to look up an Eclipse project's JPA platform ID.


discoverAnnotatedClasses

public static boolean discoverAnnotatedClasses(org.eclipse.core.resources.IProject project)
Return the JPA "discover" flag associated with the specified Eclipse project.


setDiscoverAnnotatedClasses

public static void setDiscoverAnnotatedClasses(org.eclipse.core.resources.IProject project,
                                               boolean discoverAnnotatedClasses)
Set the JPA "discover" flag associated with the specified Eclipse project.


getMetamodelSourceFolderName

public static java.lang.String getMetamodelSourceFolderName(org.eclipse.core.resources.IProject project)
Return the name of the metamodel source folder associated with the specified Eclipse project.


setMetamodelSourceFolderName

public static void setMetamodelSourceFolderName(org.eclipse.core.resources.IProject project,
                                                java.lang.String metamodelSourceFolderName)
Set the name of the metamodel source folder associated with the specified Eclipse project.


getConnectionProfileName

public static java.lang.String getConnectionProfileName(org.eclipse.core.resources.IProject project)
Return the name of the connection profile associated with the specified Eclipse project.


setConnectionProfileName

public static void setConnectionProfileName(org.eclipse.core.resources.IProject project,
                                            java.lang.String connectionProfileName)
Set the name of the connection profile associated with the specified Eclipse project.


getUserOverrideDefaultCatalog

public static java.lang.String getUserOverrideDefaultCatalog(org.eclipse.core.resources.IProject project)
Return the default catalog (identifier) associated with the specified Eclipse project.

See Also:
JpaProject.getUserOverrideDefaultCatalog()

setUserOverrideDefaultCatalog

public static void setUserOverrideDefaultCatalog(org.eclipse.core.resources.IProject project,
                                                 java.lang.String defaultCatalog)
Set the default catalog (identifier) associated with the specified Eclipse project.

See Also:
JpaProject.setUserOverrideDefaultCatalog(String)

getUserOverrideDefaultSchema

public static java.lang.String getUserOverrideDefaultSchema(org.eclipse.core.resources.IProject project)
Return the default schema (identifier) associated with the specified Eclipse project.

See Also:
JpaProject.getUserOverrideDefaultSchema()

setUserOverrideDefaultSchema

public static void setUserOverrideDefaultSchema(org.eclipse.core.resources.IProject project,
                                                java.lang.String defaultSchema)
Set the default schema (identifier) associated with the specified Eclipse project.

See Also:
JpaProject.setUserOverrideDefaultSchema(String)

clearProjectPersistentProperties

public static void clearProjectPersistentProperties(org.eclipse.core.resources.IProject project)
Clear the JPA-specific project properties


nodeIsJpa2_0Compatible

public static boolean nodeIsJpa2_0Compatible(JpaNode jpaNode)

javaElementChangeListenerIsActive

public static boolean javaElementChangeListenerIsActive()
Return whether the JPA project manager's Java change listener is active.


setJavaElementChangeListenerIsActive

public static void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive)
Set whether the JPA project manager's Java change listener is active.


log

public static void log(java.lang.String msg)
Log the specified message.


log

public static void log(java.lang.Throwable throwable)
Log the specified exception or error.


log

public static void log(java.lang.String msg,
                       java.lang.Throwable throwable)
Log the specified message and exception or error.


log

public static void log(org.eclipse.core.runtime.IStatus status)
Log the specified status.


start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception

getSAXParserFactory

public javax.xml.parsers.SAXParserFactory getSAXParserFactory()