Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.eclipse.emf.texo.resolver;
 
 import  org.eclipse.emf.common.util.URI;
 import  org.eclipse.emf.ecore.EClass;
 import  org.eclipse.emf.ecore.EObject;
Can resolve URI's and id's to objects and back. Provider of URI's for an object, is capable of creating an URI and resolve an URI to an object.

Author(s):
Martin Taal
public interface ObjectResolver {

  
Create an EObject for the passed in object.
  public EObject resolveToEObject(Object object);

  
Create or retrieve an object that represents the passed in EObject.
  public Object resolveFromEObject(EObject eObject);

  
Retrieve an object using an URI. Converts the URI to an EClass and id object and then calls get(EClass, Object).

Parameters:
objectUri the uri representing the object's EClass and id.
Returns:
an object read from the object store
See also:
IdProvider.convertIdStringToId(EClass, String)
  public Object fromUri(URI objectUri);

  
Create a unique URI from an object.

Parameters:
object must be an EObject or an object which can be converted to a ModelObject using the ModelResolver.getModelObject(Object).
Returns:
the unique URI for the object
See also:
fromUri(URI)
IdProvider.getIdAsString(ModelObject)
  public URI toUri(Object object);

  
Creates an uri from the type and id.

Parameters:
eClass the eClass defining the type
idString the id as a string
Returns:
the created uri which fits to the store
  public URI toURI(EClass eClassString idString);

  
If true then this uri resolver will generate and parse uris of the form: http://localhost:8080/texo/wsxml/Library/1 So the EClass name and id are appended at the end with the forward slash as separator.
  public boolean isUseWebServiceUriFormat();
  public void setUseWebServiceUriFormat(boolean useWebServiceUriFormat);
  public void setUri(URI uri);
  public EObject getEObject(URI uri);
  public void removeFromCache(URI objectUri);
New to GrepCode? Check out our FAQ X