org.eclipse.stp.core.introspection
Interface IDynamicModelIntrospector


public interface IDynamicModelIntrospector

Provides a simple interface for non-EMF models to normalize their content into an EMF structure. The following pattern should be followed for Component Types: For component type, this should start be of the following pattern: For each Service: startFeature: ComponentType>Service: feature:SCAPackage.getComponentType_Services() type: SCAPackage.getService() substitutionGroupFeature: SCAPackage.getComponentType_Services() * - Here the substitutionGroup feature is the same as the feature since substituion of this type is not allowed. attribute() ComponentType>Service>_Name:SCAPackage.getService_Name() startFeature() ComponentType>Service>Interface: feature:SCAPackage.getService_Interface() type: SCAPackage.getJavaInterface() substitutionGroupFeature: SCAPackage.getSCACoreRoot_InterfaceJava() attribute( ... isUniqueKey=true) SCAPackage.getJavaInterface_Interface(); endFeature() ComponentType>Service>Interface: SCAPackage.getService_Interface() endFeature() ComponentType>Service:SCAPackage.getComponentType_Services().

Since:
1.0

Field Summary
static int BATCH
          Indicate the BATCH mode.
static int INCREMENTAL_ADD
          Indicate the feature being started was added.
static int INCREMENTAL_REMOVE
          Indicate the feature being started has been removed.
static int INCREMENTAL_UPDATE
          Indicate the feature being started has changed in some way.
 
Method Summary
 void attribute(EAttribute attribute, java.lang.Object value, boolean isUniqueKey)
          Indicate the attribute being parsed and the current value.
 void endFeature(EStructuralFeature feature)
          Indicate when a feature is fully parsed.
 void endIntrospection()
          Indicate the parsing is complete.
 void removeUntouched(EStructuralFeature feature)
          Delete the untouched nodes.
 void reset()
          Instruct the parser to dispose of any resources it may be holding onto as a result of a startIntrospection() ...
 void startFeature(EStructuralFeature feature, EClass type, EStructuralFeature substitutionGroupFeature)
          Indicate which feature is being parsed, the type of that feature, and the serialization feature for that type.
 void startFeature(EStructuralFeature feature, EClass type, EStructuralFeature substitutionGroupFeature, int announcementType)
          Indicate which feature is being parsed, the type of that feature, and the serialization feature for that type.
 void startIntrospection(EStructuralFeature feature, SCAObject root)
          Should be called before the introspection begins (e.g.
 

Field Detail

BATCH

static final int BATCH
Indicate the BATCH mode. The current state of the model will be announced, and the IDynamicModelIntrospector will handle the merge.

See Also:
Constant Field Values

INCREMENTAL_ADD

static final int INCREMENTAL_ADD
Indicate the feature being started was added. Describe all attributes and contained features.

See Also:
Constant Field Values

INCREMENTAL_UPDATE

static final int INCREMENTAL_UPDATE
Indicate the feature being started has changed in some way. Describe the set of unique attributes, and then any modified attribute values or contained features.

See Also:
Constant Field Values

INCREMENTAL_REMOVE

static final int INCREMENTAL_REMOVE
Indicate the feature being started has been removed. Describe the set of unique attributes or features that contain unique attributes to identify the model element to remove.

See Also:
Constant Field Values
Method Detail

startIntrospection

void startIntrospection(EStructuralFeature feature,
                        SCAObject root)
Should be called before the introspection begins (e.g. at the beginning of a parse on the implementatation model).

Parameters:
feature - The root feature of the given root. In general, this is an element from the document root.
root - The target that will be (potentially) modified.

startFeature

void startFeature(EStructuralFeature feature,
                  EClass type,
                  EStructuralFeature substitutionGroupFeature)
Indicate which feature is being parsed, the type of that feature, and the serialization feature for that type.

For example: SCAPackage pkg = SCAPackage.eINSTANCE; modelIntrospector.startFeature( pkg.getService_Interface(), // we are parsing an interface for a service pkg.getJavaInterface(), // its type is com.ibm.ccl.soa.core.JavaInterface pkg.getSCACoreRoot_InterfaceJava()); // its serialization format is "interface.java"

Parameters:
feature - The feature that is being updated
type - The type of the value that will be set on the feature
substitutionGroupFeature - The feature that this type will be serialized as

startFeature

void startFeature(EStructuralFeature feature,
                  EClass type,
                  EStructuralFeature substitutionGroupFeature,
                  int announcementType)
Indicate which feature is being parsed, the type of that feature, and the serialization feature for that type.

For example: SCAPackage pkg = SCAPackage.eINSTANCE; modelIntrospector.startFeature( pkg.getService_Interface(), // we are parsing an interface for a service pkg.getJavaInterface(), // its type is com.ibm.ccl.soa.core.JavaInterface pkg.getSCACoreRoot_InterfaceJava()); // its serialization format is "interface.java"

Parameters:
feature - The feature that is being updated
type - The type of the value that will be set on the feature
substitutionGroupFeature - The feature that this type will be serialized as
announcementType - Should be one of BATCH, INCREMENTAL_ADD, INCREMENTAL_UPDATE, or INCREMENTAL_REMOVE

attribute

void attribute(EAttribute attribute,
               java.lang.Object value,
               boolean isUniqueKey)
Indicate the attribute being parsed and the current value.

Parameters:
attribute - The attribute of the current feature that has a value
value - The current value of the attribute
isUniqueKey - True marks the attribute as one of possibly many that identifies the uniqueness of this modele element.

endFeature

void endFeature(EStructuralFeature feature)
Indicate when a feature is fully parsed.

Parameters:
feature - The feature that has been completed.

endIntrospection

void endIntrospection()
Indicate the parsing is complete. Apply changes (if any).


removeUntouched

void removeUntouched(EStructuralFeature feature)
Delete the untouched nodes. Anything not announced should be removed.

Parameters:
feature - The feature that has been updated.

reset

void reset()
Instruct the parser to dispose of any resources it may be holding onto as a result of a startIntrospection() ... endIntrospection() sequence.