public class PortableURIs
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PortableURIs.PortableFragmentDescription |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PORTABLE_SCHEME |
Constructor and Description |
---|
PortableURIs() |
Modifier and Type | Method and Description |
---|---|
protected PortableURIs.PortableFragmentDescription |
createPortableFragmentDescription(IEObjectDescription desc,
org.eclipse.emf.ecore.EObject target) |
protected PortableURIs.PortableFragmentDescription |
fromFragmentString(java.lang.String fragmentString) |
org.eclipse.emf.ecore.EObject |
getEObject(org.eclipse.emf.ecore.EObject from,
java.lang.String toFragment)
Finds an EObject for the given context EObject and fragment.
|
java.lang.String |
getFragment(org.eclipse.emf.ecore.EObject fromContainer,
org.eclipse.emf.ecore.EObject toChild)
Computes a fragment to the child relative from the given container.
|
protected java.lang.String |
getPortableURIFragment(org.eclipse.emf.ecore.EObject obj) |
boolean |
isPortableURIFragment(java.lang.String uriFragment) |
org.eclipse.emf.ecore.EObject |
resolve(StorageAwareResource resource,
java.lang.String portableFragment)
Resolves a given portable URI fragment against the given resource.
|
protected java.lang.String |
toFragmentString(PortableURIs.PortableFragmentDescription desc) |
org.eclipse.emf.common.util.URI |
toPortableURI(StorageAwareResource sourceResource,
org.eclipse.emf.ecore.EObject targetObject)
Creates and returns a portable URI from the global scope.
|
org.eclipse.emf.common.util.URI |
toPortableURI(StorageAwareResource sourceResource,
org.eclipse.emf.common.util.URI targetURI)
Creates and returns a portable URI from the given resource to the targetURI.
|
public static final java.lang.String PORTABLE_SCHEME
public boolean isPortableURIFragment(java.lang.String uriFragment)
public org.eclipse.emf.ecore.EObject resolve(StorageAwareResource resource, java.lang.String portableFragment)
resource
- the resource from which global scope to look up the EObjectportableFragment
- the portable fragment pointing to the to be resolved EObjectpublic org.eclipse.emf.common.util.URI toPortableURI(StorageAwareResource sourceResource, org.eclipse.emf.common.util.URI targetURI)
null
is no portable URI can be constructed, which is the case if the
targetObject is not itself exported or is a child of an exported EObject.sourceResource
- the resource from which the EObject should later be resolvedtargetURI
- the target URI that should be resolvable by the created portable URInull
public org.eclipse.emf.common.util.URI toPortableURI(StorageAwareResource sourceResource, org.eclipse.emf.ecore.EObject targetObject)
null
is no portable URI can be constructed, which is the case if the
targetObject is not itself exported or is a child of an exported EObject.sourceResource
- the resource from which the EObject should later be resolvedtargetObject
- the target object that should be resolvable by the created portable URInull
protected java.lang.String getPortableURIFragment(org.eclipse.emf.ecore.EObject obj)
null
if the give EObject isn't itself or is not contained in an exported EObjectDescriptionprotected PortableURIs.PortableFragmentDescription createPortableFragmentDescription(IEObjectDescription desc, org.eclipse.emf.ecore.EObject target)
protected java.lang.String toFragmentString(PortableURIs.PortableFragmentDescription desc)
protected PortableURIs.PortableFragmentDescription fromFragmentString(java.lang.String fragmentString)
public java.lang.String getFragment(org.eclipse.emf.ecore.EObject fromContainer, org.eclipse.emf.ecore.EObject toChild)
fromContainer
- the container EObject from which the fragment path is computedtoChild
- the target EObject which can be found using the fromContainer and resulting fragment pathnull is fromContainer == toChild
getEObject(EObject,String)
public org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.ecore.EObject from, java.lang.String toFragment)
from
- the EObject from which the path should be resolvedtoFragment
- the fragmentnull, the given EObject itself will be returned.