IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.emf.msl
Interface IEObjectHelper


public interface IEObjectHelper

An interface that provides various utility functions to manage and validate EObject and its proxies.

API clients should not implement this interface.

Unless specified differently, members of this interface should always be called in the context of a ResourceSetReadOperation


Method Summary
 void destroy(org.eclipse.emf.ecore.EObject eObject)
          Destroys the object by removing it from its container and severing all references from and to the object. it is also recursive, i.e., it gets called on the children.
 String getID(org.eclipse.emf.ecore.EObject eObject)
          Returns the ID if there is one for the given object; if there is no ID, it returns an empty string.
 String getName(org.eclipse.emf.ecore.EObject eObject)
          Gets the name of an object if the object has name, returns an empty string otherwise.
 org.eclipse.emf.ecore.EClass getProxyClass(org.eclipse.emf.ecore.InternalEObject eObject)
          Gets the EClass of the object referenced by the proxy by parsing the proxy URI.
 String getProxyID(org.eclipse.emf.ecore.InternalEObject eObject)
          Gets the ID of the object referenced by the proxy by parsing the proxy URI.
 String getProxyName(org.eclipse.emf.ecore.InternalEObject eObject)
          Gets the name of the object referenced by the proxy by parsing the proxy URI.
 String getProxyQName(org.eclipse.emf.ecore.InternalEObject eObject)
          Gets the fully qualified name of the object referenced by the proxy by parsing the proxy URI.
 String getQName(org.eclipse.emf.ecore.EObject eObject, boolean formatted)
          Gets the fully qualified name of an object.
 Collection getReferencers(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference[] features)
          Finds all referencers of a particular object.
 boolean setName(org.eclipse.emf.ecore.EObject eObject, String name)
          Sets the name of an object if the object can be assigned a name.
 org.eclipse.core.runtime.IStatus validate(Collection objects, org.eclipse.core.runtime.IProgressMonitor monitor)
          This method validates a collection of elements by evaluating the batch constraints that apply to them, recursively, over their containment sub-trees.
 

Method Detail

destroy

public void destroy(org.eclipse.emf.ecore.EObject eObject)
Destroys the object by removing it from its container and severing all references from and to the object. it is also recursive, i.e., it gets called on the children. The object must be attached to a container for the method to have any effect. This member must always be called in the context of a ResourceSetModifyOperation

Parameters:
eObject - The object to destroy.

getID

public String getID(org.eclipse.emf.ecore.EObject eObject)
Returns the ID if there is one for the given object; if there is no ID, it returns an empty string.

Parameters:
eObject - The object to get the ID for.
Returns:
The ID of the object.

getName

public String getName(org.eclipse.emf.ecore.EObject eObject)
Gets the name of an object if the object has name, returns an empty string otherwise.

Parameters:
eObject - The object to get the name of.
Returns:
The object's name.

setName

public boolean setName(org.eclipse.emf.ecore.EObject eObject,
                       String name)
Sets the name of an object if the object can be assigned a name. The object must be nameable

Parameters:
eObject - The object to set the name of.
name - The object's new name.
Returns:
true if the name was set
Throws:
IllegalArgumentException - The specified eObject is not nameable.

getQName

public String getQName(org.eclipse.emf.ecore.EObject eObject,
                       boolean formatted)
Gets the fully qualified name of an object.

Parameters:
eObject - The object to get the fully qualified name of.
formatted - When true, unnamed parents will be listed using their meta-class name.
Returns:
The object's fully qualified name.

getReferencers

public Collection getReferencers(org.eclipse.emf.ecore.EObject eObject,
                                 org.eclipse.emf.ecore.EReference[] features)
Finds all referencers of a particular object. The search can be narrowed down by passing the list of reference features to match.

Parameters:
eObject - the referenced object
features - the reference features, can be null or empty
Returns:
the collection of referencers

validate

public org.eclipse.core.runtime.IStatus validate(Collection objects,
                                                 org.eclipse.core.runtime.IProgressMonitor monitor)
This method validates a collection of elements by evaluating the batch constraints that apply to them, recursively, over their containment sub-trees. Any problems found are returned as status objects. Any containment relationships amongst the specified elements are handled so that no duplication occurs. This can be a long-running operation (hence the progress monitor).

Parameters:
objects - the objects to validate
monitor - the progress monitor
Returns:
The validation results. The status may be a single IValidationStatus, or a multi-status composed of IValidationStatus es, or neither

getProxyName

public String getProxyName(org.eclipse.emf.ecore.InternalEObject eObject)
Gets the name of the object referenced by the proxy by parsing the proxy URI.

Parameters:
eObject - the proxy object
Returns:
the name of the object referenced by the proxy

getProxyQName

public String getProxyQName(org.eclipse.emf.ecore.InternalEObject eObject)
Gets the fully qualified name of the object referenced by the proxy by parsing the proxy URI.

Parameters:
eObject - the proxy object
Returns:
the fully qualified name of the object referenced by the proxy

getProxyID

public String getProxyID(org.eclipse.emf.ecore.InternalEObject eObject)
Gets the ID of the object referenced by the proxy by parsing the proxy URI.

Parameters:
eObject - the proxy object
Returns:
the ID of the object referenced by the proxy

getProxyClass

public org.eclipse.emf.ecore.EClass getProxyClass(org.eclipse.emf.ecore.InternalEObject eObject)
Gets the EClass of the object referenced by the proxy by parsing the proxy URI.

Parameters:
eObject - the proxy object
Returns:
the EClass of the object referenced by the proxy

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.