| com.metaboss.sdlctools.models.ModelAssistant
All known Subclasses: com.metaboss.sdlctools.models.modelassistant.metabossmodel.codeconstraints.ModelAssistantImpl, com.metaboss.sdlctools.models.modelassistant.metabossmodel.SingleModelAssistantImplBase,
ModelAssistant | public interface ModelAssistant (Code) | | Represents the interface for the model assistant component.
Model assistant is a component which can be installed to look after
certain aspects of the model. It can perform following tasks
- Validate model and produce list of error mesages describing what is wrong with the model from the point of view of this particular assistant.
Validation is expected to be implemented in body of the verifyConstraints() method. Note that
each assistant should only verify "own" constraints and not general model ones. If due to general model errors
assistant is unable to even check "own" constraints - verifyConstraints() method should just return quetly.
- Attempt to correct the errors in the model. This is expected to be implemented in body of
the rectifyModel() method.
- Autocomplete creation, deletion or modification of model objects so the relationships this assitant is looking after remain valid.
Autocompletion is expected to be implemented in bodies of the onModelElement.......() methods. These methods are
invoked by ModelRepository at the time when change is taking place while repository is still in transaction. Therefore
all autocompletion changes to the model will be a part of the same transaction and will be rolled back together with
original changes if required.
|
Inner Class :public interface ModelActionsLogger | |
Method Summary | |
public void | assignToModel(String pModelName) Assign this Assistant to look after a particular model.
Each assistant can only look after one model at a time, but any number of instances of assistants of the same type
may be created as needed (e.g. | public void | dismissFromModel(String pModelName) | public void | onModelElementAttributeBeingUpdated(String pModelName, RefObject pModelElementBeingUpdated, String pAttributeName, Object pOldAttributeValue, Object pNewAttributeValue) This method is called when attribute of the ModelElement has been modified.
Model is in transaction at the time and any change performed here may
be rolled back if transaction is not committed
Parameters: pModelName - - the name of the model where action is taking place Parameters: pModelElementBeingUpdated - the element being updated Parameters: pAttributeName - the name of the attribute being updated Parameters: pOldAttributeValue - - the old value of the attribute. | public void | onModelElementBeingDeleted(String pModelName, RefObject pModelElementToBeDeleted) This method is called when ModelElement is being deleted. | public void | onModelElementJustCreated(String pModelName, RefObject pModelElementJustCreated) This method is called when ModelElement is being created. | public void | onModelElementReferenceBeingUpdated(String pModelName, RefObject pModelElementBeingUpdated, String pReferenceName, RefObject pReferencedModelElementToRemove, RefObject pReferencedModelElementToAdd) This method is called when reference of the ModelElement has been modified. | public void | rectifyModel(String pModelName) This method attempts to rectify the model. | public void | setActionsLogger(String pModelName, ModelActionsLogger pModelActionsLogger) Assign the actions loger to this assistantis Assistant to look after a particular model.
Parameters: pModelName - - the name of the model this logger is assigned to Parameters: pModelActionsLogger - - the logger to use. | public Collection | verifyConstraints(String pModelName) This method verifies model constraints and returns collection of exceptions. |
COMPONENT_URL | final public static String COMPONENT_URL(Code) | | Naming URL of the component
|
OWNER_IDENTIFIER_PRREFIX | final public static String OWNER_IDENTIFIER_PRREFIX(Code) | | The prefix assistants use to form an owner identifier name of the elements they own.
Normally model element owner identifier will consist of <thisprefix><assistant package namegt;
|
assignToModel | public void assignToModel(String pModelName) throws ModelRepositoryException(Code) | | Assign this Assistant to look after a particular model.
Each assistant can only look after one model at a time, but any number of instances of assistants of the same type
may be created as needed (e.g. in case number of instances of the same model have been loaded)
Parameters: pModelName - - the name of the model this assistant needs to look after |
dismissFromModel | public void dismissFromModel(String pModelName) throws ModelRepositoryException(Code) | | Relieve this Assistant from looking after the model
Parameters: pModelName - - the name of the model this assistant needs to stop looking after |
onModelElementAttributeBeingUpdated | public void onModelElementAttributeBeingUpdated(String pModelName, RefObject pModelElementBeingUpdated, String pAttributeName, Object pOldAttributeValue, Object pNewAttributeValue) throws ModelRepositoryException(Code) | | This method is called when attribute of the ModelElement has been modified.
Model is in transaction at the time and any change performed here may
be rolled back if transaction is not committed
Parameters: pModelName - - the name of the model where action is taking place Parameters: pModelElementBeingUpdated - the element being updated Parameters: pAttributeName - the name of the attribute being updated Parameters: pOldAttributeValue - - the old value of the attribute. May be null if attribute had no value before Parameters: pNewAttributeValue - - the new value of the attribute. May be null if attribute is being cleared |
onModelElementBeingDeleted | public void onModelElementBeingDeleted(String pModelName, RefObject pModelElementToBeDeleted) throws ModelRepositoryException(Code) | | This method is called when ModelElement is being deleted. Model
is in transaction at the time and any change performed here may
be rolled back if transaction is not committed
Parameters: pModelName - - the name of the model where action is taking place Parameters: pModelElementToBeDeleted - the element being deleted |
onModelElementJustCreated | public void onModelElementJustCreated(String pModelName, RefObject pModelElementJustCreated) throws ModelRepositoryException(Code) | | This method is called when ModelElement is being created. Model
is in transaction at the time and any change performed here may
be rolled back if transaction is not committed
Parameters: pModelName - - the name of the model where action is taking place Parameters: pModelElementJustCreated - the element being created |
onModelElementReferenceBeingUpdated | public void onModelElementReferenceBeingUpdated(String pModelName, RefObject pModelElementBeingUpdated, String pReferenceName, RefObject pReferencedModelElementToRemove, RefObject pReferencedModelElementToAdd) throws ModelRepositoryException(Code) | | This method is called when reference of the ModelElement has been modified.
Model is in transaction at the time and any change performed here may
be rolled back if transaction is not committed
Parameters: pModelName - - the name of the model where action is taking place Parameters: pModelElementBeingUpdated - the element being updated Parameters: pReferenceName - the name of the reference being updated Parameters: pReferencedModelElementToRemove - - the old referenced element to be removed. May be null if nothing is being removed Parameters: pReferencedModelElementToAdd - - the new referenced element to be added. May be null if nothing is being added |
rectifyModel | public void rectifyModel(String pModelName) throws ModelRepositoryException(Code) | | This method attempts to rectify the model. It is only supposed to rectify features "owned"
by this assistant. In case if model is not good enough for this assistant to fix
its own stuff - assistant should quietly exit. Subsequent model validation will pick up errors
Parameters: pModelName - - the name of the model to rectify |
setActionsLogger | public void setActionsLogger(String pModelName, ModelActionsLogger pModelActionsLogger) throws ModelRepositoryException(Code) | | Assign the actions loger to this assistantis Assistant to look after a particular model.
Parameters: pModelName - - the name of the model this logger is assigned to Parameters: pModelActionsLogger - - the logger to use. null passed here will switch logging off |
verifyConstraints | public Collection verifyConstraints(String pModelName) throws ModelRepositoryException(Code) | | This method verifies model constraints and returns collection of exceptions.
It is only supposed to verify constraints "owned" by this assistant
Parameters: pModelName - - the name of the model to verify constraints on |
|
|