org.eclipse.gmf.runtime.emf.core.util
Class Util
java.lang.Object
org.eclipse.gmf.runtime.emf.core.util.Util
-
public class Util
- extends java.lang.Object
Internal utilities, for private use of the EMF Core plug-in.
-
Since:
- 1.2
Method Summary
|
static java.lang.StringBuffer
|
appendQualifiedName
(java.lang.StringBuffer buffer,
java.lang.String qName)
Appends an encoded version of the specified qualified name to the
specified buffer. |
static boolean
|
canContain
(org.eclipse.emf.ecore.EClass class1,
org.eclipse.emf.ecore.EClass class2,
java.util.Set visited)
Can an instance of class1 contain an instance of class2. |
static java.lang.String
|
decodeQName
(java.lang.String qName)
Decodes the specified qualified name by replacing each three-digit escape
sequence by the character that it represents. |
static org.eclipse.emf.common.util.URI
|
denormalizeURI
(org.eclipse.emf.common.util.URI uri,
org.eclipse.emf.ecore.resource.ResourceSet rset)
Attempts to obtain the most abstract URI possible for the specified URI,
preferring "platform:" scheme over "file:" scheme for files in the
workspace, and "pathmap:" scheme over these where a file resides in a
path-mapped location. |
static java.lang.String
|
encodeQualifiedName
(java.lang.String qName)
Encodes the specified qualified name. |
static
IResourceHelper
|
getHelper
(org.eclipse.emf.ecore.resource.Resource resource)
Gets the helper for the specified resource, if any. |
static java.lang.String
|
getProxyID
(org.eclipse.emf.ecore.EObject proxy)
Gets the proxy ID by parsing the proxy URI. |
static org.eclipse.emf.ecore.EObject
|
resolve
(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
org.eclipse.emf.ecore.EObject proxy)
Attempts to resolve the specified proxy object, returning
null (rather than the original proxy) if it is unresolvable. |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
getHelper
public static
IResourceHelper getHelper(org.eclipse.emf.ecore.resource.Resource resource)
- Gets the helper for the specified resource, if any.
-
-
Parameters:
-
resource
- a resource (may be null
)
-
Returns:
- the helper, if one is attached, or
null
if none
or if no resource is specified
encodeQualifiedName
public static java.lang.String encodeQualifiedName(java.lang.String qName)
- Encodes the specified qualified name.
-
-
Parameters:
-
qName
- The qualified name to be encoded.
-
Returns:
- The encoded qualified name.
appendQualifiedName
public static java.lang.StringBuffer appendQualifiedName(java.lang.StringBuffer buffer,
java.lang.String qName)
- Appends an encoded version of the specified qualified name to the
specified buffer. All excluded characters, such as space and
#
, are escaped, as are /
and
?
.
-
-
Parameters:
-
buffer
- The buffer to which to append. -
qName
- The qualified name to be encoded.
-
Returns:
- The buffer.
decodeQName
public static java.lang.String decodeQName(java.lang.String qName)
- Decodes the specified qualified name by replacing each three-digit escape
sequence by the character that it represents.
-
-
Parameters:
-
qName
- The qualified name to be decoded.
-
Returns:
- The decoded qualified name.
denormalizeURI
public static org.eclipse.emf.common.util.URI denormalizeURI(org.eclipse.emf.common.util.URI uri,
org.eclipse.emf.ecore.resource.ResourceSet rset)
- Attempts to obtain the most abstract URI possible for the specified URI,
preferring "platform:" scheme over "file:" scheme for files in the
workspace, and "pathmap:" scheme over these where a file resides in a
path-mapped location.
-
-
Parameters:
-
uri
- the URI to denormalize -
rset
- the resource set context for this URI (defining, among other
things, a URI converter)
-
Returns:
- the URI denormalized as much as possible
getProxyID
public static java.lang.String getProxyID(org.eclipse.emf.ecore.EObject proxy)
- Gets the proxy ID by parsing the proxy URI.
-
-
Parameters:
-
proxy
- The proxy object.
-
Returns:
- The ID.
resolve
public static org.eclipse.emf.ecore.EObject resolve(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
org.eclipse.emf.ecore.EObject proxy)
- Attempts to resolve the specified
proxy
object, returning
null
(rather than the original proxy) if it is unresolvable.
-
-
Parameters:
-
domain
- The editing domain. -
proxy
- The proxy object.
-
Returns:
- The resolved object, or
null
if not resolved
canContain
public static boolean canContain(org.eclipse.emf.ecore.EClass class1,
org.eclipse.emf.ecore.EClass class2,
java.util.Set visited)
- Can an instance of class1 contain an instance of class2.
-
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.