org.eclipse.stp.core.introspection
Class FeatureAdapter

java.lang.Object
  extended by AdapterImpl
      extended by org.eclipse.stp.core.introspection.FeatureAdapter

public final class FeatureAdapter
extends AdapterImpl

A FeatureAdapter provides the feature that a given SCAObject should be persisted as. Each feature represents a possible substitution group from a (potentially) custom package.

Usage:

ACustomModelImplementation implementation = ACustomModelFactory.eINSTANCE.createACustomModelImplementation(); implementation.setCustomProperty(...); FeatureAdapter.setFeature(implementation, ACustomModelPackage.eINSTANCE.getDocumentRoot_ImplementationACustomModel());

For more information, take a look at Properties Implementation in com.ibm.ccl.soa.core.tests. In that plugin, see schemas/ for defining the EMF model, and props-ext-model/ for the generated version of the model.

Since:
1.0

Field Summary
static java.lang.String ADAPTER_TYPE
          The adapter type to search for when looking for the FeatureAdapter.
 
Method Summary
static FeatureAdapter findAdapter(SCAObject anObject)
           
 EStructuralFeature getFeature()
           
static EStructuralFeature getFeature(SCAObject anObject)
           This method may return null.
 boolean isAdapterForType(java.lang.Object type)
           
static void setFeature(SCAObject anObject, EStructuralFeature aFeature)
          Add a FeatureAdapter on the given object for the given feature if not already present.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADAPTER_TYPE

public static final java.lang.String ADAPTER_TYPE
The adapter type to search for when looking for the FeatureAdapter.

See Also:
EcoreUtil#getAdapter(java.util.List, java.lang.Object)
Method Detail

getFeature

public static EStructuralFeature getFeature(SCAObject anObject)

This method may return null.

Parameters:
anObject - The object representing a substitution group.
Returns:
The structural feature that should be used for the feature map when setting this implementation.

setFeature

public static void setFeature(SCAObject anObject,
                              EStructuralFeature aFeature)
Add a FeatureAdapter on the given object for the given feature if not already present. An invocation of this method for a feature already noted on the object will not result in any modifications.

Parameters:
anObject - The object representing a substitution group.
aFeature - The feature that represents how the element should be persisted.

findAdapter

public static FeatureAdapter findAdapter(SCAObject anObject)
Parameters:
anObject - The object to search for the FeatureAdapter.
Returns:
The adapter for ADAPTER_TYPE from the given object, or null if not found.

isAdapterForType

public boolean isAdapterForType(java.lang.Object type)

getFeature

public EStructuralFeature getFeature()
Returns:
The structural feature held by this FeatureAdapter.