|
Dali Provisional API Release 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectTranslatorResourceImpl
org.eclipse.jpt.common.core.resource.xml.JptXmlResource
public class JptXmlResource
To retrieve the JPA XML resource corresponding to an Eclipse file:
IFile file = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember("Foo.java");
JptXmlResource jpaXmlResource = (JptXmlResource) file.getAdapter(JptXmlResource.class);
This is a non-blocking call; and as a result it will return null
if the JPA XML resource or its JPA project is currently under construction.
See org.eclipse.jpt.jpa.core/plugin.xml:org.eclipse.core.runtime.adapters.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference |
|---|
JptResourceTypeReference.ResourceTypeTransformer |
| Nested classes/interfaces inherited from interface org.eclipse.jpt.common.core.ContentTypeReference |
|---|
ContentTypeReference.ContentIsKindOf, ContentTypeReference.ContentTypeTransformer |
| Field Summary | |
|---|---|
protected IContentType |
contentType
cache the content type - if the content type changes, the JPA project will throw out the JPA file holding the xml resource and build a new one |
protected org.eclipse.jpt.common.utility.internal.ListenerList<JptResourceModelListener> |
resourceModelListenerList
|
protected Translator |
rootTranslator
|
| Fields inherited from interface org.eclipse.jpt.common.core.JptResourceTypeReference |
|---|
RESOURCE_TYPE_TRANSFORMER |
| Fields inherited from interface org.eclipse.jpt.common.core.ContentTypeReference |
|---|
CONTENT_TYPE_TRANSFORMER |
| Constructor Summary | |
|---|---|
JptXmlResource(URI uri,
Renderer renderer,
IContentType contentType,
Translator rootTranslator)
|
|
| Method Summary | |
|---|---|
void |
addResourceModelListener(JptResourceModelListener listener)
Changes to the resource model result in events. |
EList<Adapter> |
eAdapters()
|
void |
eNotify(Notification notification)
Override to fire notification only when: the resource's state has actually changed; and the resource is loaded; and the resource's resource set is still present (EMF will fire an notification when the resource set is set to 'null', just before the resource is "unloaded" - we want to swallow this notification) |
boolean |
fileExists()
|
EList<EObject> |
getContents()
|
IContentType |
getContentType()
Return an Eclipse content type. |
protected IFile |
getConvertedURIFile()
|
protected String |
getDefaultPublicId()
only applicable for DTD-based files |
protected String |
getDefaultSystemId()
only applicable for DTD-based files |
protected int |
getDefaultVersionID()
this seems to be the default version of the spec for this doc and the id 10 maps to the version 1.0 |
String |
getDoctype()
only applicable for DTD-based files |
EntityResolver |
getEntityResolver()
|
IFile |
getFile()
Return the model's file. |
protected IFile |
getFile(URI fileURI)
Return the Eclipse file for the specified URI. |
JptResourceType |
getResourceType()
The XML schema version is required. |
protected JptResourceType |
getResourceType(String version)
|
org.eclipse.jpt.common.core.resource.xml.ERootObject |
getRootObject()
|
Translator |
getRootTranslator()
|
String |
getVersion()
|
protected boolean |
loadedFlagCleared(Notification notification)
Return whether the specified notification indicates the resource has been unloaded. |
void |
removeResourceModelListener(JptResourceModelListener listener)
|
protected void |
resourceModelChanged()
|
protected void |
resourceModelReverted()
|
protected void |
resourceModelUnloaded()
|
protected boolean |
resultSetCleared(Notification notification)
Return whether the specified notification indicates the resource's resource set was cleared. |
void |
save()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final IContentType contentType
protected final Translator rootTranslator
protected final org.eclipse.jpt.common.utility.internal.ListenerList<JptResourceModelListener> resourceModelListenerList
| Constructor Detail |
|---|
public JptXmlResource(URI uri,
Renderer renderer,
IContentType contentType,
Translator rootTranslator)
| Method Detail |
|---|
public IContentType getContentType()
ContentTypeReference
getContentType in interface ContentTypeReferencepublic String getVersion()
public JptResourceType getResourceType()
getResourceType in interface JptResourceTypeReferenceprotected JptResourceType getResourceType(String version)
public void eNotify(Notification notification)
protected boolean loadedFlagCleared(Notification notification)
protected boolean resultSetCleared(Notification notification)
resourceSet is
null (which is what we do)/
public String getDoctype()
public Translator getRootTranslator()
protected String getDefaultPublicId()
protected String getDefaultSystemId()
protected int getDefaultVersionID()
public org.eclipse.jpt.common.core.resource.xml.ERootObject getRootObject()
public EntityResolver getEntityResolver()
public boolean fileExists()
public IFile getFile()
JptResourceModel
getFile in interface JptResourceModelprotected IFile getConvertedURIFile()
protected IFile getFile(URI fileURI)
platform:/resource/....
public void save()
public String toString()
public void addResourceModelListener(JptResourceModelListener listener)
JptResourceModel
addResourceModelListener in interface JptResourceModelpublic void removeResourceModelListener(JptResourceModelListener listener)
removeResourceModelListener in interface JptResourceModelJptResourceModel.addResourceModelListener(JptResourceModelListener)protected void resourceModelChanged()
protected void resourceModelReverted()
protected void resourceModelUnloaded()
public EList<Adapter> eAdapters()
public EList<EObject> getContents()
|
Dali Provisional API Release 3.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||