public class LogicResourceImpl extends org.eclipse.emf.common.notify.impl.NotifierImpl implements LogicResource, java.lang.Cloneable
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterListorg.eclipse.emf.ecore.resource.Resource.Diagnostic, org.eclipse.emf.ecore.resource.Resource.Factory, org.eclipse.emf.ecore.resource.Resource.Internal, org.eclipse.emf.ecore.resource.Resource.IOWrappedException| Modifier and Type | Field and Description |
|---|---|
static java.util.concurrent.atomic.AtomicBoolean |
applyHorribleHack
Enable duplicate resource loading to handle issue with profile resolution for custom profiles
Must be enabled only once
|
protected ClosureUtils.IClosureIOHelper |
closureIOHelper
Helper to load closure files
|
protected java.util.Map |
defaultLoadOptions
The storage for the default load options.
|
protected java.util.Map |
defaultSaveOptions
The storage for the default save options.
|
protected java.util.Map |
intrinsicIDToEObjectMap
A map to retrieve the EObject based on the value of its ID feature.
|
protected boolean |
isClosureRoot
Determinse if this logic resource is closure root or not
|
protected boolean |
isLoaded
The loaded flag.
|
protected boolean |
isLoading
The loading flag.
|
protected boolean |
isModified
The modified flag.
|
protected org.eclipse.emf.common.notify.Adapter |
modificationTrackingAdapter
The modification tracking adapter.
|
protected org.eclipse.emf.ecore.resource.ResourceSet |
pResourceSet
Resource set associated with this logical resource.
|
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> |
subUnits
A list of subunits associated with this logical resource
|
protected org.eclipse.emf.common.util.URI |
uri
The URI.
|
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAGOPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS| Constructor and Description |
|---|
LogicResourceImpl(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) |
LogicResourceImpl(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
boolean loadAdapters)
Constructor
|
LogicResourceImpl(org.eclipse.emf.common.util.URI uri,
org.eclipse.emf.ecore.resource.ResourceSet pResourceSet)
Creates an instance with the given URI and resource set.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubunit(org.eclipse.emf.ecore.resource.Resource resource)
Add a subunit resource to this logical resource.
|
java.lang.Object |
clone() |
boolean |
containSubunit(org.eclipse.emf.common.util.URI uri)
Determine if this logical resource contains
a subunit with the given uri
|
static byte[] |
copy(java.io.InputStream in) |
org.eclipse.emf.ecore.resource.Resource |
createSubunit(org.eclipse.emf.common.util.URI uri)
Create a subunit with the given URI
|
void |
delete(java.util.Map options) |
org.eclipse.emf.common.util.TreeIterator |
getAllContents() |
org.eclipse.emf.common.util.EList |
getContents()
Get a list of resouce level object excluding cross-containment
reference root.
|
protected static org.eclipse.emf.ecore.resource.URIConverter |
getDefaultURIConverter()
Returns the default URI converter that's used when there is no resource
set.
|
org.eclipse.emf.ecore.EObject |
getEObject(java.lang.String uriFragment) |
org.eclipse.emf.common.util.EList |
getErrors() |
org.eclipse.emf.common.util.EList |
getFullContents()
Get a list of resouce level object including cross-containment
reference root.
|
java.lang.Object |
getProperty(java.lang.String prop,
java.lang.Object defaultValue)
Returns user's property
Returns defaultValue if property is not defined
|
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet() |
org.eclipse.emf.ecore.EObject |
getRootElement()
Get the root of this logical model.
|
org.eclipse.emf.ecore.resource.Resource |
getRootResource()
Get the root physical resource of this logical resource
|
org.eclipse.emf.ecore.resource.Resource |
getSubunit(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
Get the subunit associated with the given uri.
|
java.util.List |
getSubunits()
Get all the subunits belong to this logical model
|
long |
getTimeStamp() |
org.eclipse.emf.common.util.URI |
getURI() |
protected org.eclipse.emf.ecore.resource.URIConverter |
getURIConverter()
Returns the URI converter.
|
java.lang.String |
getURIFragment(org.eclipse.emf.ecore.EObject eObject) |
org.eclipse.emf.common.util.EList |
getWarnings() |
protected void |
init(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
boolean loadAdapters) |
boolean |
isLoaded() |
boolean |
isModified() |
boolean |
isRootElement(java.lang.Object object)
Returns true if object is a root element of LogicResource
NOTE: We can't use comparison getRootElement() == object because in closure mode
LogicResource has mutliple roots
|
boolean |
isTrackingModification() |
void |
load(java.io.InputStream inputStream,
java.util.Map options) |
void |
load(java.util.Map options) |
protected void |
loadClosure(java.util.Map options) |
boolean |
remove(org.eclipse.emf.ecore.resource.Resource physicalResource,
int index) |
void |
removeContentAdapter() |
void |
resolveAll(org.eclipse.emf.ecore.resource.Resource resource)
Visits all proxies in the resource and tries to resolve them.
|
void |
save_old(java.lang.String toPath)
Deprecated.
|
void |
save(java.util.Map options) |
void |
save(java.io.OutputStream outputStream,
java.util.Map options)
Saves the resource to the output stream using the specified options.
|
void |
save(java.lang.String toPath)
Save this logical resouce into the destination path.
|
void |
setLoaded(boolean isLoaded)
Set whether this logical resource has been loaded.
|
void |
setModified(boolean isModified) |
void |
setProperty(java.lang.String prop,
java.lang.Object value)
Set user's property for resource
|
void |
setRootElement(org.eclipse.emf.ecore.EObject root)
This method should only be used with care.
|
void |
setRootResource(org.eclipse.emf.ecore.resource.Resource resource)
This method should only be used with care.
|
void |
setTimeStamp(long newTimeStamp) |
void |
setTrackingModification(boolean isTrackingModification) |
void |
setURI(org.eclipse.emf.common.util.URI uri) |
void |
unload() |
eAdapters, eBasicAdapters, eDeliver, eSetDelivereBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotifyprotected java.util.Map defaultSaveOptions
protected java.util.Map defaultLoadOptions
protected org.eclipse.emf.common.util.URI uri
getURI()protected boolean isModified
isModifiedprotected boolean isLoaded
isLoadedprotected boolean isLoading
isLoadingprotected org.eclipse.emf.common.notify.Adapter modificationTrackingAdapter
isTrackingModification()protected java.util.Map intrinsicIDToEObjectMap
protected org.eclipse.emf.ecore.resource.ResourceSet pResourceSet
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> subUnits
protected boolean isClosureRoot
protected ClosureUtils.IClosureIOHelper closureIOHelper
public static final java.util.concurrent.atomic.AtomicBoolean applyHorribleHack
public LogicResourceImpl(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
public LogicResourceImpl(org.eclipse.emf.common.util.URI uri,
org.eclipse.emf.ecore.resource.ResourceSet pResourceSet)
uri - the URI.public LogicResourceImpl(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
boolean loadAdapters)
resourceSet - given resource setloadAdapters - whether register listener to resourceset as such any subunit
proxy resolution will cause subunit to be added to subunit
list of this logical resource.protected static org.eclipse.emf.ecore.resource.URIConverter getDefaultURIConverter()
getURIConverter()protected void init(org.eclipse.emf.ecore.resource.ResourceSet resourceSet,
boolean loadAdapters)
public void removeContentAdapter()
removeContentAdapter in interface LogicResourcepublic org.eclipse.emf.ecore.resource.Resource getRootResource()
LogicResourcegetRootResource in interface LogicResourcepublic void setRootResource(org.eclipse.emf.ecore.resource.Resource resource)
LogicResourcesetRootResource in interface LogicResourceresource - root resource.public org.eclipse.emf.ecore.EObject getRootElement()
LogicResourcegetRootElement in interface LogicResourcepublic void setRootElement(org.eclipse.emf.ecore.EObject root)
LogicResourcesetRootElement in interface LogicResourceroot - new root of this logical modelpublic void addSubunit(org.eclipse.emf.ecore.resource.Resource resource)
LogicResourceaddSubunit in interface LogicResourceresource - given subunit resource.public org.eclipse.emf.ecore.resource.Resource createSubunit(org.eclipse.emf.common.util.URI uri)
LogicResourcecreateSubunit in interface LogicResourceuri - given URIpublic boolean containSubunit(org.eclipse.emf.common.util.URI uri)
LogicResourcecontainSubunit in interface LogicResourceuri - given uripublic java.util.List getSubunits()
LogicResourcegetSubunits in interface LogicResourcepublic org.eclipse.emf.ecore.resource.Resource getSubunit(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
LogicResourcegetSubunit in interface LogicResourceuri - given uriloadOnDemand - whether to load on demandpublic org.eclipse.emf.common.util.EList getContents()
getContents in interface org.eclipse.emf.ecore.resource.ResourceResource.getContents()public org.eclipse.emf.common.util.EList getFullContents()
LogicResourcegetFullContents in interface LogicResourcepublic org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
getResourceSet in interface org.eclipse.emf.ecore.resource.Resourcepublic org.eclipse.emf.common.util.TreeIterator getAllContents()
getAllContents in interface org.eclipse.emf.ecore.resource.Resourcepublic java.lang.String getURIFragment(org.eclipse.emf.ecore.EObject eObject)
getURIFragment in interface org.eclipse.emf.ecore.resource.Resourcepublic org.eclipse.emf.ecore.EObject getEObject(java.lang.String uriFragment)
getEObject in interface org.eclipse.emf.ecore.resource.Resourcepublic boolean isModified()
isModified in interface org.eclipse.emf.ecore.resource.Resourcepublic void setModified(boolean isModified)
setModified in interface org.eclipse.emf.ecore.resource.Resourcepublic org.eclipse.emf.common.util.URI getURI()
getURI in interface org.eclipse.emf.ecore.resource.Resourcepublic void setURI(org.eclipse.emf.common.util.URI uri)
setURI in interface org.eclipse.emf.ecore.resource.Resourcepublic boolean remove(org.eclipse.emf.ecore.resource.Resource physicalResource,
int index)
public org.eclipse.emf.common.util.EList getErrors()
getErrors in interface org.eclipse.emf.ecore.resource.Resourcepublic org.eclipse.emf.common.util.EList getWarnings()
getWarnings in interface org.eclipse.emf.ecore.resource.Resourceprotected org.eclipse.emf.ecore.resource.URIConverter getURIConverter()
converter from the
containing resource set, but it calls
getDefaultURIConverter() when there is no containing resource set.public void save(java.util.Map options)
throws java.io.IOException
save in interface org.eclipse.emf.ecore.resource.Resourcejava.io.IOExceptionpublic void load(java.util.Map options)
throws java.io.IOException
load in interface org.eclipse.emf.ecore.resource.Resourcejava.io.IOExceptionprotected void loadClosure(java.util.Map options)
throws java.io.IOException
java.io.IOExceptionpublic void save(java.io.OutputStream outputStream,
java.util.Map options)
throws java.io.IOException
save in interface org.eclipse.emf.ecore.resource.Resourceoptions - the save options.java.io.IOExceptionsave(Map),
load(InputStream, Map)public static byte[] copy(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionpublic final void load(java.io.InputStream inputStream,
java.util.Map options)
throws java.io.IOException
load in interface org.eclipse.emf.ecore.resource.Resourcejava.io.IOExceptionpublic void resolveAll(org.eclipse.emf.ecore.resource.Resource resource)
resource - the objects to visit.public boolean isLoaded()
isLoaded in interface org.eclipse.emf.ecore.resource.Resourcepublic final void unload()
unload in interface org.eclipse.emf.ecore.resource.Resourcepublic boolean isTrackingModification()
isTrackingModification in interface org.eclipse.emf.ecore.resource.Resourcepublic void setTrackingModification(boolean isTrackingModification)
setTrackingModification in interface org.eclipse.emf.ecore.resource.Resourcepublic void save(java.lang.String toPath)
throws java.io.IOException
LogicResourcesave in interface LogicResourcetoPath - destination pathjava.io.IOException@Deprecated public void save_old(java.lang.String toPath)
toPath - public void setLoaded(boolean isLoaded)
LogicResourcesetLoaded in interface LogicResourceisLoaded - the isLoaded to setpublic void delete(java.util.Map options)
throws java.io.IOException
delete in interface org.eclipse.emf.ecore.resource.Resourcejava.io.IOExceptionpublic long getTimeStamp()
getTimeStamp in interface org.eclipse.emf.ecore.resource.Resourcepublic void setTimeStamp(long newTimeStamp)
setTimeStamp in interface org.eclipse.emf.ecore.resource.Resourcepublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void setProperty(java.lang.String prop,
java.lang.Object value)
LogicResourcesetProperty in interface LogicResourcepublic java.lang.Object getProperty(java.lang.String prop,
java.lang.Object defaultValue)
LogicResourcegetProperty in interface LogicResourcepublic boolean isRootElement(java.lang.Object object)
LogicResourceisRootElement in interface LogicResource