org.eclipse.stp.core.internal.introspection
Class ModelIntrospectionManager

java.lang.Object
  extended by org.eclipse.stp.core.internal.introspection.ModelIntrospectionManager
All Implemented Interfaces:
IModelIntrospectionManager

public class ModelIntrospectionManager
extends java.lang.Object
implements IModelIntrospectionManager

Provides the implementaiton of IModelIntrospectionManager. Clients should access this implementation through IModelIntrospectionManager.eINSTANCE.

Since:
1.0
See Also:
IModelIntrospectionManager.eINSTANCE

Field Summary
 
Fields inherited from interface org.eclipse.stp.core.introspection.IModelIntrospectionManager
eINSTANCE
 
Constructor Summary
ModelIntrospectionManager()
           
 
Method Summary
 void bind(ComponentType componentType, org.eclipse.emf.common.util.URI implementation)
          Bind a ComponentType to a specific implementation.
static org.eclipse.emf.ecore.EStructuralFeature getStructuralFeature(SCAObject anSCAObject)
          This method assumes that the Implementation is contained so that it can check the FeatureMap of the containing model element.
static java.lang.String getSubstitutionGroupName(SCAObject anSCAObject)
           
 ComponentType resolve(Implementation implementation)
          Resolve will return a ComponentType bound to the given implementation.
 ComponentType resolve(Implementation implementation, org.eclipse.core.resources.IProject context)
           
 void unbind(ComponentType componentType)
          Strip the modeled ComponentType from the implementation which backs it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelIntrospectionManager

public ModelIntrospectionManager()
Method Detail

bind

public void bind(ComponentType componentType,
                 org.eclipse.emf.common.util.URI implementation)
Description copied from interface: IModelIntrospectionManager
Bind a ComponentType to a specific implementation. In general, clients will not need to call this method.

Clients which acquire the ComponentType from Component.resolveComponentType() should NOT call this method.

Specified by:
bind in interface IModelIntrospectionManager
Parameters:
componentType - A non-null componentType
implementation - The implementation URI of the backing model (e.g. a fully qualified Java class)

unbind

public void unbind(ComponentType componentType)
Description copied from interface: IModelIntrospectionManager
Strip the modeled ComponentType from the implementation which backs it. The ComponentType will have no properties, services, or references after this method.

No changes will be made to the underlying model as a result of this method.

Specified by:
unbind in interface IModelIntrospectionManager
Parameters:
componentType - A non-null componenttype that has been bound.

resolve

public ComponentType resolve(Implementation implementation)
Description copied from interface: IModelIntrospectionManager
Resolve will return a ComponentType bound to the given implementation.

The ComponentType can be shared in some cases. If the implementation introspector defines an IShareableComponentTypeFactory, then the implementation model will be converted to URI and requested through the ResourceSet of the Implementation that is supplied.

Therefore, resolve() should only be supplied implementations that are contained by a Component, which are contained by a ResourceSet. (The actual containment is Implementation > Component > Composite/Module > SCACoreRoot > Resource > ResourceSet).

The one special case is AbstractImplementation (SCAPackage.getAbstractImplementation()) which does not need to be contained to be resolved.

The feature from the implementation will be determined using the FeatureMap of the containing Component.

Specified by:
resolve in interface IModelIntrospectionManager
Parameters:
implementation - A contained Implementation
Returns:
The (possibly shared) bound ComponentType derived from the given Implementation.

resolve

public ComponentType resolve(Implementation implementation,
                             org.eclipse.core.resources.IProject context)

getStructuralFeature

public static org.eclipse.emf.ecore.EStructuralFeature getStructuralFeature(SCAObject anSCAObject)
This method assumes that the Implementation is contained so that it can check the FeatureMap of the containing model element. Otherwise, the method checks for the FeatureAdapter on the Implementation. If neither of these attempts succeeds, then this method will fail miserably (e.g. return null).

This method asserts its expectations so don't get tricky.

Parameters:
implementation - The Implementation which must either be contained or have a FeatureAdapter.
Returns:
The structural feature if found.

getSubstitutionGroupName

public static java.lang.String getSubstitutionGroupName(SCAObject anSCAObject)