| |
|
| com.metaboss.sdlctools.models.ModelRepository
All known Subclasses: com.metaboss.sdlctools.models.impl.ModelRepositoryImpl,
ModelRepository | public interface ModelRepository (Code) | | Represents the generic interface to the jmi / mof model repository.
|
Method Summary | |
public void | beginTransaction() This method is part of repository transaction mangement suite of methods. | public void | close() Closes whole repository without saving any changes to any of the models. | public void | closeModel(String pModelName) Closes model in repository without saving any changes to the location specified at the time model was created or opened. | public void | commitTransaction() This method is part of repository transaction mangement suite of methods. | public boolean | containsMetaModel(String pMetaModelName) Parameters: pMetaModelName - the unique name of the MetaModel. | public boolean | containsModel(String pModelName) Parameters: pModelName - the unique name of the Model given to it when it was opened or created. | public RefObject | copyModelElement(RefObject pSourceObject, String pTargetModelName, boolean pDeepCopy, ModelElementResolver pExternalElementResolver) This helper method copies given object to different model and returns newly created object.
Parameters: pSourceObject - the object to copy from Parameters: pTargetModelName - the model to copy. | public void | createModel(String pModelName, File pModelRootFile, String pMetaModelName, Properties pModelStorageProperties) Creates a new model in the model repository. | public RefObject | duplicateModelElement(RefObject pSourceObject) This helper method duplicates given object in the same model and returns newly created object.
The parent (ie. | public void | emptyModelElement(RefObject pModelElement) | public void | exportModel(String pModelName, boolean pValidateModel, File pModelRootFile, Properties pModelStorageProperties) Saves model at the location specified explicitly in this call.
Repository must not be in transaction at the time of this call.
All files will be saved as this is not an existing location. | public RefPackage | getDefaultModelExtent() Retrieves the RefPackage representing the outermost package of the default Model.
The model is set as default by using setDefaultModel()
All model exploration and navigation and editing can start from here
the requested RefPackage. | public String | getDefaultModelMetaModelName() | public String | getDefaultModelName() | public ModelPackage | getMetaModelExtent(String pMetaModelName) Retrieves the ModelPackage representing the outermost package of the specified MetaModel. | public String | getMetaModelName(String pModelName) Retrieves the name of the MetaModel for this model
Parameters: pModelName - the unique name of the Model. | public RefPackage | getModelExtent(String pModelName) Retrieves the RefPackage representing the outermost package of the specified Model. | public RefBaseObject | getModelObjectByRepositoryId(String pRepositoryId) Retrieves the RefBaseObject represented by the RepositoryId (MOF Id). | public RefPackage | getModelPackage(String pModelName, MofPackage pPackageDescriptor) Retrieves the RefPackage described by supplied package descriptor.
Parameters: pModelName - the unique name of the Model. | public String | getOwnerMetaModelName(RefBaseObject pModelObject) Retrieves the name of the metamodel given object belongs to.
Parameters: pModelObject - the object from the model. | public String | getOwnerModelName(RefBaseObject pModelObject) Retrieves the name of the model given object belongs to.
Parameters: pModelObject - the object from the model. | public List | getTopLevelModelObjects(String pModelName) Retrieves the collection of the RefObjects which are at the top level
that is they are not owned by any other object.
Parameters: pModelName - the unique name of the Model. | public boolean | isInTransaction() This method is part of repository transaction mangement suite of methods. | public boolean | isModelModified(String pModelName) Checks if model has been modified and needs saving
Repository must not be in transaction at the time of this call.
Only files modified since last save will be considered. | public String[] | listMetaModelNames() Lists names of the loaded MetaModels.
array of strings containg the names of the loaded MetaModels. | public String[] | listModelNames() Lists names of the loaded Models.
array of strings containg the names of the loaded Models. | public void | loadMetaModel(String pMetaModelName, File pMetaModelFile, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties) Loads meta model from the specified URL to the model repository. | public void | loadMetaModel(String pMetaModelName, InputStream pMetaModelInputStream, String pMetaModelURIString, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties) Loads meta model from the specified URL to the model repository. | public void | openModel(String pModelName, File pModelRootFile, String pMetaModelName) Reads in existing model from the specified file location to the model repository.
The metamodel of the model must have been loaded prior to this call. | public void | rectifyModel(String pModelName) Attempts to correct the errors in the given model. | public void | registerModelAssistant(String pMetaModelName, ModelAssistant pAssistant) Adds the assistant to the metamodel. | public void | registerModelListener(String pModelName, ModelListener pModelListener) Adds a listener object to the model. | public void | removeMetaModel(String pMetaModelName) Removes MetaModel with the specified name. | public void | retrofitModelElement(RefObject pSampleObject, RefObject pTargetObject, ModelElementResolver pExternalElementResolver) This helper method changes all internals of the target object to be exactly the same as
the internals of the sample object. | public void | rollbackTransaction() This method is part of repository transaction mangement suite of methods. | public void | saveDefaultModel(boolean pValidateModel) Saves default model at the location specified at the time model was created or opened.
Repository must not be in transaction at the time of this call. | public void | saveDefaultModelAs(boolean pValidateModel, File pNewModelRootFile, Properties pNewModelStorageProperties) Saves default model at the location specified in this method call.
The location is also changed for a future (similarly to the editor's saveAs commands).
Repository must not be in transaction at the time of this call.
All files will be saved will be saved. | public void | saveModel(String pModelName, boolean pValidateModel) Saves model at the location specified at the time model was created or opened.
Repository must not be in transaction at the time of this call. | public void | saveModelAs(String pModelName, boolean pValidateModel, File pNewModelRootFile, Properties pNewModelStorageProperties) Saves model at the location specified in this method call. | public List | searchByXPath(String pContextModelName, String pXPathExpression) Retrieves the collection of the Objects matching given XPath expression. | public List | searchByXPath(RefBaseObject pContextObject, String pXPathExpression) Retrieves the collection of the RefBaseObjects matching given XPath expression.
The XPath expression follows XPath 1.0 syntax with
following specific features:
- All instance objects in the model (ie.
| public List | searchByXPath(Collection pContextObjects, String pXPathExpression) Retrieves the collection of the Objects matching given XPath expression. | public String | setDefaultModel(String pModelName) Sets the default model name. | public void | unregisterModelAssistant(String pMetaModelName, ModelAssistant pAssistant) Removes the assistant from the metamodel. | public void | unregisterModelListener(String pModelName, ModelListener pModelListener) Removes a listener object from the metamodel. | public void | validateModel(String pModelName) Verifies model constraints on the given model. |
COMPONENT_URL | final public static String COMPONENT_URL(Code) | | Naming URL of the component
|
METAMODEL_NAME_METABOSS | final public static String METAMODEL_NAME_METABOSS(Code) | | Reserved name of the MetaBoss MetaModel
|
METAMODEL_NAME_UML | final public static String METAMODEL_NAME_UML(Code) | | Reserved name of the UML MetaModel
|
beginTransaction | public void beginTransaction() throws ModelRepositoryException(Code) | | This method is part of repository transaction mangement suite of methods.
It creates new transaction.
throws: ModelRepositoryException - if there is already current transaction in this repository or repository is closed |
close | public void close() throws ModelRepositoryException(Code) | | Closes whole repository without saving any changes to any of the models.
Repository must not be in transaction at the time of this call.
All modifications to all the models will be lost
exception: ModelRepositoryException - thrown if there was a problem with the closing of the repository |
closeModel | public void closeModel(String pModelName) throws ModelRepositoryException(Code) | | Closes model in repository without saving any changes to the location specified at the time model was created or opened.
Repository must not be in transaction at the time of this call.
All modifications to the model will be lost
Parameters: pModelName - the unique name of the model. exception: ModelRepositoryException - thrown if there was a problem with the closing of the Model |
commitTransaction | public void commitTransaction() throws ModelRepositoryException(Code) | | This method is part of repository transaction mangement suite of methods.
It commits current transaction.
throws: ModelRepositoryException - if there is no current transaction in this repository or repository is closed |
containsMetaModel | public boolean containsMetaModel(String pMetaModelName) throws ModelRepositoryException(Code) | | Parameters: pMetaModelName - the unique name of the MetaModel. true if metamodel with the specified name is already loaded exception: ModelRepositoryException - thrown if there is a problem with answering the question |
containsModel | public boolean containsModel(String pModelName) throws ModelRepositoryException(Code) | | Parameters: pModelName - the unique name of the Model given to it when it was opened or created. true if model with the specified name is already loaded exception: ModelRepositoryException - thrown if there is a problem with answering the question |
copyModelElement | public RefObject copyModelElement(RefObject pSourceObject, String pTargetModelName, boolean pDeepCopy, ModelElementResolver pExternalElementResolver) throws ModelRepositoryException(Code) | | This helper method copies given object to different model and returns newly created object.
Parameters: pSourceObject - the object to copy from Parameters: pTargetModelName - the model to copy. Must be different to the model which ownssource object and also must be of the same type (same metamodel) Parameters: pDeepCopy - - if equals true - all contained objects are also copied. Associations withincopied hierarchy are copied. External associations are only copied if pExternalElementResolver is not null and its getMatchingModelElement() method has returned not null. Note that if not all external associations are copied - the model integrity may be compromised). |
createModel | public void createModel(String pModelName, File pModelRootFile, String pMetaModelName, Properties pModelStorageProperties) throws ModelRepositoryException(Code) | | Creates a new model in the model repository. This model is to be kept at the specified file location.
The metamodel of the model must have been loaded prior to this call. The created empty model can be
modified and results saved back if required.
Parameters: pModelName - the unique name caller wishes to refer to this model in the future. Must be unique name not used before in this repository session. Parameters: pModelRootFile - the file where definition of the Model shall be kept. Must refer to the non-existing xmi file in the existingand accessible directory. If model storage is partitioned - this file must refer to the root file. Locations of all otherpartitions are expected to be relative to this file. Parameters: pMetaModelName - the unique name of the MetaModel. MetaModel with this name must have been added previously to the repository. Parameters: pModelStorageProperties - model storage properties to use. null passed hereindicates that default properties should be used (default properties are set when MetaModel is openedvia ModelRepository.loadMetaModel(String,URL,String,Properties) loadMetaModel method. If default properties are indicating partititoning and model being created is not partitioned - empty properties object must be specified. exception: ModelRepositoryException - thrown if there was a problem with the loading of the Model |
duplicateModelElement | public RefObject duplicateModelElement(RefObject pSourceObject) throws ModelRepositoryException(Code) | | This helper method duplicates given object in the same model and returns newly created object.
The parent (ie. container) of the newly created ModelElement is not set
Parameters: pSourceObject - the object to copy from. |
emptyModelElement | public void emptyModelElement(RefObject pModelElement) throws ModelRepositoryException(Code) | | This helper method empties given model element, which means it deletes all
attributes and contained objects
Parameters: pModelElement - the model element to empty |
exportModel | public void exportModel(String pModelName, boolean pValidateModel, File pModelRootFile, Properties pModelStorageProperties) throws ModelRepositoryException(Code) | | Saves model at the location specified explicitly in this call.
Repository must not be in transaction at the time of this call.
All files will be saved as this is not an existing location.
Parameters: pModelName - the unique name of the model. Parameters: pValidateModel - if set to true - model will be validated before saving andin case if validation errors have been discovered - exception will be thrown andmodel will not be saved. Parameters: pModelRootFile - the file where top level definition of the Model should besaved to. If file exists it will be overwritten. If directory does not exist - it will be created. If model storage is partitioned - more files and subdirectories will be created as needed. Parameters: pModelStorageProperties - model storage properties to use. null passed hereindicates that default properties should be used (default properties are set when MetaModel is openedvia ModelRepository.loadMetaModel(String,URL,String,Properties) loadMetaModel method.If it is desired to save model in unpartitioned fashion - empty properties object must be specified. exception: ModelRepositoryException - thrown if there was a general problem with the saving the Model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
getDefaultModelExtent | public RefPackage getDefaultModelExtent() throws ModelRepositoryException(Code) | | Retrieves the RefPackage representing the outermost package of the default Model.
The model is set as default by using setDefaultModel()
All model exploration and navigation and editing can start from here
the requested RefPackage. |
getDefaultModelMetaModelName | public String getDefaultModelMetaModelName() throws ModelRepositoryException(Code) | | the name of the metamodel of the default model or null if default model is not setup |
getMetaModelExtent | public ModelPackage getMetaModelExtent(String pMetaModelName) throws ModelRepositoryException(Code) | | Retrieves the ModelPackage representing the outermost package of the specified MetaModel.
All MetaModel exploration and navigation can start from here.
Parameters: pMetaModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. the requested ModelPackage. exception: ModelRepositoryException - thrown if there is a problem with obtaining the extent |
getMetaModelName | public String getMetaModelName(String pModelName) throws ModelRepositoryException(Code) | | Retrieves the name of the MetaModel for this model
Parameters: pModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. the matching MetaModel name. |
getModelExtent | public RefPackage getModelExtent(String pModelName) throws ModelRepositoryException(Code) | | Retrieves the RefPackage representing the outermost package of the specified Model. All model exploration and navigation and editing can start from here
Parameters: pModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. the requested RefPackage. |
getModelObjectByRepositoryId | public RefBaseObject getModelObjectByRepositoryId(String pRepositoryId) throws ModelRepositoryException(Code) | | Retrieves the RefBaseObject represented by the RepositoryId (MOF Id). All model exploration and navigation and editing can start from here
Parameters: pRepositoryId - the unique repository id of the object. Object with the same name must exist in the repository. the requested RefBaseObject. |
getModelPackage | public RefPackage getModelPackage(String pModelName, MofPackage pPackageDescriptor) throws ModelRepositoryException(Code) | | Retrieves the RefPackage described by supplied package descriptor.
Parameters: pModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. Parameters: pPackageDescriptor - the descriptor of the package we are after. the requested RefPackage. exception: ModelRepositoryException - thrown if there is a problem with obtaining the package from the model |
getOwnerMetaModelName | public String getOwnerMetaModelName(RefBaseObject pModelObject) throws ModelRepositoryException(Code) | | Retrieves the name of the metamodel given object belongs to.
Parameters: pModelObject - the object from the model. the name of the metamodel exception: ModelRepositoryException - thrown if there is a problem with obtaining the name of the model |
getOwnerModelName | public String getOwnerModelName(RefBaseObject pModelObject) throws ModelRepositoryException(Code) | | Retrieves the name of the model given object belongs to.
Parameters: pModelObject - the object from the model. the name of the model exception: ModelRepositoryException - thrown if there is a problem with obtaining the name of the model |
getTopLevelModelObjects | public List getTopLevelModelObjects(String pModelName) throws ModelRepositoryException(Code) | | Retrieves the collection of the RefObjects which are at the top level
that is they are not owned by any other object.
Parameters: pModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. the list with zero or more RefObjects, which are not owned by any other object. |
isModelModified | public boolean isModelModified(String pModelName) throws ModelRepositoryException(Code) | | Checks if model has been modified and needs saving
Repository must not be in transaction at the time of this call.
Only files modified since last save will be considered.
Parameters: pModelName - the unique name of the model. exception: ModelRepositoryException - thrown if there was a general problem with checking if model needs saving or not |
listMetaModelNames | public String[] listMetaModelNames() throws ModelRepositoryException(Code) | | Lists names of the loaded MetaModels.
array of strings containg the names of the loaded MetaModels. Can be zero length array if repository is empty. exception: ModelRepositoryException - thrown if there is a problem with obtaining the list of MetaModels |
listModelNames | public String[] listModelNames() throws ModelRepositoryException(Code) | | Lists names of the loaded Models.
array of strings containg the names of the loaded Models. Can be zero length array if repository has no models loaded. exception: ModelRepositoryException - thrown if there is a problem with obtaining the list of Models |
loadMetaModel | public void loadMetaModel(String pMetaModelName, File pMetaModelFile, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties) throws ModelRepositoryException(Code) | | Loads meta model from the specified URL to the model repository. After loading
meta model becomes available and models (i.e. instances of this metamodel) can be loaded.
Parameters: pMetaModelName - the unique name caller wishes to refer to this metamodel in the future. Must be unique name not used before in this repository session. Parameters: pMetaModelFile - the file where MOF definition of the MetaModel can be loaded from. Must refer to the xmi file containing MOF model (i.e. definition of this metamodel). Parameters: pDefaultModelStorageProperties - model storage properties to use as default in case model specific properties are not supplied when model is loaded. null passed hereindicates that there is no default properties. This primarily indicates that model storage will not be partitioned by default. the package for newly loaded metamodel exception: ModelRepositoryException - thrown if there was a problem with the loading of the metamodel |
loadMetaModel | public void loadMetaModel(String pMetaModelName, InputStream pMetaModelInputStream, String pMetaModelURIString, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties) throws ModelRepositoryException(Code) | | Loads meta model from the specified URL to the model repository. After loading
meta model becomes available and models (i.e. instances of this metamodel) can be loaded.
Parameters: pMetaModelName - the unique name caller wishes to refer to this metamodel in the future. Must be unique name not used before in this repository session. Parameters: pMetaModelInputStream - the input stream where MOF definition of the MetaModel can be read from. Must refer to the xmi file containing MOF model (i.e. definition of this metamodel). Parameters: pMetaModelURIString - the unique URI string of the MOF definition of the MetaModel. Parameters: pDefaultModelStorageProperties - model storage properties to use as default in case model specific properties are not supplied when model is loaded. null passed hereindicates that there is no default properties. This primarily indicates that model storage will not be partitioned by default. the package for newly loaded metamodel exception: ModelRepositoryException - thrown if there was a problem with the loading of the metamodel |
openModel | public void openModel(String pModelName, File pModelRootFile, String pMetaModelName) throws ModelRepositoryException(Code) | | Reads in existing model from the specified file location to the model repository.
The metamodel of the model must have been loaded prior to this call. The opened model can be
modified and results saved back if required.
Parameters: pModelName - the unique name caller wishes to refer to this model in the future. Must be unique name not used before in this repository session. Parameters: pModelRootFile - the file where definition of the Model can be loaded from. Must refer to the valid and existing xmi file containing the model (i.e. definition of this Model in XMI as per MetaModel).If model storage is partitioned - this file must refer to the root file. Locations of all otherpartitions are expected to be relative to this file. Parameters: pMetaModelName - the unique name of the MetaModel. MetaModel with this name must have been added previously to the repository. exception: ModelRepositoryException - thrown if there was a problem with the loading of the Model |
rectifyModel | public void rectifyModel(String pModelName) throws ModelRepositoryException(Code) | | Attempts to correct the errors in the given model.
Note that this is just an attempt which is not guaranteed to succeed.
Repository must not be in transaction at the time of this call.
validateModel() method can be called subsequently to this method in order
to find out whether the process has worked or not.
Parameters: pModelName - the unique name of the model which must be loaded into the repository prior to this call. exception: ModelRepositoryException - thrown if there was a general problem with accessing the model. |
registerModelAssistant | public void registerModelAssistant(String pMetaModelName, ModelAssistant pAssistant) throws ModelRepositoryException(Code) | | Adds the assistant to the metamodel. Supplied assistant will be assigned to
each model of this type. Assistants registered by this method will be installed in the
order of registration, but after all assitants declared in configuration/
Parameters: pMetaModelName - - the name of metamodel to attach this assistant to Parameters: pAssistant - - the asssitant itself throws: ModelRepositoryException - thrown if there is a problem with registering the assistant |
registerModelListener | public void registerModelListener(String pModelName, ModelListener pModelListener) throws ModelRepositoryException(Code) | | Adds a listener object to the model.
Parameters: pModelName - - the name of model to attach this listener to Parameters: pModelListener - - the listener object to use throws: ModelRepositoryException - in case if there was a problem assigning the listener |
removeMetaModel | public void removeMetaModel(String pMetaModelName) throws ModelRepositoryException(Code) | | Removes MetaModel with the specified name. Also removes all Models governed by this MetaModel
Parameters: pMetaModelName - the unique name of the MetaModel. MetaModel with this name must have been added previously to the repository. exception: ModelRepositoryException - thrown if there is a problem with the removing of the MetaModel |
retrofitModelElement | public void retrofitModelElement(RefObject pSampleObject, RefObject pTargetObject, ModelElementResolver pExternalElementResolver) throws ModelRepositoryException(Code) | | This helper method changes all internals of the target object to be exactly the same as
the internals of the sample object. Similarly to the copyModelElement method the associations within copied hierarchy are copied,
but external associations are dropped if pExternalElementResolver is not given or has returned null
(note that this may make newly copied object tree invalid).
Parameters: pSampleObject - the sample object to mirror all attributes and child elements from Parameters: pTargetObject - the object which will get whole new content. Everything it has inside (Attributes and Contained objects) will be replaced. Objects must be of the same type and belong to themodel (same or different - does not matter). |
rollbackTransaction | public void rollbackTransaction() throws ModelRepositoryException(Code) | | This method is part of repository transaction mangement suite of methods.
It rolls back current transaction.
throws: ModelRepositoryException - if there is no current transaction in this repository or repository is closed |
saveDefaultModel | public void saveDefaultModel(boolean pValidateModel) throws ModelRepositoryException, ModelValidationException(Code) | | Saves default model at the location specified at the time model was created or opened.
Repository must not be in transaction at the time of this call. Only files modified since last save
will be saved.
Parameters: pValidateModel - if set to true - model will be validated before saving andin case if validation errors have been discovered - exception will be thrown andmodel will not be saved. exception: ModelRepositoryException - thrown if there was a general problem with the saving the Model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
saveDefaultModelAs | public void saveDefaultModelAs(boolean pValidateModel, File pNewModelRootFile, Properties pNewModelStorageProperties) throws ModelRepositoryException, ModelValidationException(Code) | | Saves default model at the location specified in this method call.
The location is also changed for a future (similarly to the editor's saveAs commands).
Repository must not be in transaction at the time of this call.
All files will be saved will be saved.
Parameters: pValidateModel - if set to true - model will be validated before saving andin case if validation errors have been discovered - exception will be thrown andmodel will not be saved. Parameters: pNewModelRootFile - the file where top level definition of the Model should besaved to. If file exists it will be overwritten. If directory does not exist - it will be created. If model storage is partitioned - more files and subdirectories will be created as needed. Parameters: pNewModelStorageProperties - model storage properties to use. null passed hereindicates that existing properties should be used. If it is desired to save model inunpartitioned fashion - empty properties object must be specified. exception: ModelRepositoryException - thrown if there was a general problem with the saving the Model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
saveModel | public void saveModel(String pModelName, boolean pValidateModel) throws ModelRepositoryException, ModelValidationException(Code) | | Saves model at the location specified at the time model was created or opened.
Repository must not be in transaction at the time of this call. Only files modified since last save
will be saved.
Parameters: pModelName - the unique name of the model. Parameters: pValidateModel - if set to true - model will be validated before saving andin case if validation errors have been discovered - exception will be thrown andmodel will not be saved. exception: ModelRepositoryException - thrown if there was a general problem with the saving the Model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
saveModelAs | public void saveModelAs(String pModelName, boolean pValidateModel, File pNewModelRootFile, Properties pNewModelStorageProperties) throws ModelRepositoryException, ModelValidationException(Code) | | Saves model at the location specified in this method call. The location is also
changed for a future (similarly to the editor's saveAs commands).
Repository must not be in transaction at the time of this call.
All files will be saved will be saved.
Parameters: pModelName - the unique name of the model. Parameters: pValidateModel - if set to true - model will be validated before saving andin case if validation errors have been discovered - exception will be thrown andmodel will not be saved. Parameters: pNewModelRootFile - the file where top level definition of the Model should besaved to. If file exists it will be overwritten. If directory does not exist - it will be created. If model storage is partitioned - more files and subdirectories will be created as needed. Parameters: pNewModelStorageProperties - model storage properties to use. null passed hereindicates that existing properties should be used. If it is desired to save model inunpartitioned fashion - empty properties object must be specified. exception: ModelRepositoryException - thrown if there was a general problem with the saving the Model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
searchByXPath | public List searchByXPath(String pContextModelName, String pXPathExpression) throws ModelRepositoryException(Code) | | Retrieves the collection of the Objects matching given XPath expression. This method is the same as
calling
ModelRepository.searchByXPath(RefBaseObject,String) searchByXPath(RefBaseObject pContextObject, String pXPathExpression) with
the extent of the model as a context object. Please see
ModelRepository.searchByXPath(RefBaseObject,String) searchByXPath(RefBaseObject pContextObject, String pXPathExpression) for description of how XPath expressions are constructed.
Parameters: pContextModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository. Parameters: pXPathExpression - the xpath expression See Also: ModelRepository.searchByXPath(RefBaseObject,String) See Also: searchByXPath(RefBaseObject pContextObject, String pXPathExpression) the list with matching zero or more Objects. Objects may be RefObjects if expression has matched model elements or plain java objects (eg. Strings) if expression has matched attributes |
searchByXPath | public List searchByXPath(RefBaseObject pContextObject, String pXPathExpression) throws ModelRepositoryException(Code) | | Retrieves the collection of the RefBaseObjects matching given XPath expression.
The XPath expression follows XPath 1.0 syntax with
following specific features:
- All instance objects in the model (ie. RefObject descendents) are deemed to be XPath element nodes.
- The XPath element node name is the value of the name attribute of the corresponding MOF ModelElement (the one
which describes RefObject instance). For example the XPath expression "//Package" will match all instances of the Package model element.
- All attributes of the RefObjects are deemed to be XPath attribute nodes. For example the XPath expression
"//Package[@name='system']" will match all instances of the Package model element with "name" having a value "system".
- The XPath Parent axis consists of immediate composite element of the given instance.
- The XPath Child axis consists of all instances directly contained by the given instance.
For example the XPath expression "./Package[@name='system']" will match all immediately contained instances of the
Package model element with "name" having a value "system".
- Additional XPath function is intoduced. Function reference() is taking one argument - the name of the reference.
It returns a node-set with zero or more nodes referred to by current node (or nodes).
For example the XPath expression "//Package[reference('stereotype')[@name='entity']]" will match
all instances of the Package model element which has a 'stereotype' reference whose
"name" attribute has value "entity".
Parameters: pContextObject - the object relative to which the given XPath expression should be executed. Parameters: pXPathExpression - the xpath expression. See Also: ModelRepository.searchByXPath(String,String) See Also: searchByXPath(String pContextModelName, String pXPathExpression) the list with matching zero or more Objects. Objects may be RefObjects if expression has matched model elements or plain java objects (eg. Strings) if expression has matched attributes |
searchByXPath | public List searchByXPath(Collection pContextObjects, String pXPathExpression) throws ModelRepositoryException(Code) | | Retrieves the collection of the Objects matching given XPath expression. This method is the same as
calling
ModelRepository.searchByXPath(RefBaseObject,String) searchByXPath(RefBaseObject pContextObject, String pXPathExpression) once per each
context object and combining results. Please see
ModelRepository.searchByXPath(RefBaseObject,String) searchByXPath(RefBaseObject pContextObject, String pXPathExpression) for description of how XPath expressions are constructed.
Parameters: pContextObjects - the List of the RefBaseObjects to run XPath expression against. Parameters: pXPathExpression - the xpath expression See Also: ModelRepository.searchByXPath(RefBaseObject,String) See Also: searchByXPath(RefBaseObject pContextObject, String pXPathExpression) the list with matching zero or more Objects. Objects may be RefObjects if expression has matched model elements or plain java objects (eg. Strings) if expression has matched attributes |
setDefaultModel | public String setDefaultModel(String pModelName) throws ModelRepositoryException(Code) | | Sets the default model name. This repository has a few methods
dealing with the default model, which do not require the name of the model
Parameters: pModelName - the unique name of the Model. Model with this name must have been opened or created previously in the repository.null can be passed to clear existing default model without setting a new one the name of previous default model or null if there was no default model before exception: ModelRepositoryException - thrown if there is a problem with setting default model |
unregisterModelAssistant | public void unregisterModelAssistant(String pMetaModelName, ModelAssistant pAssistant) throws ModelRepositoryException(Code) | | Removes the assistant from the metamodel. First the assistant will
be disassociated from all models it is attached to.
Parameters: pMetaModelName - - the name of metamodel to remove this assistant from Parameters: pAssistant - - the asssitant itself throws: ModelRepositoryException - thrown if there is a problem with unregistering the assistant |
unregisterModelListener | public void unregisterModelListener(String pModelName, ModelListener pModelListener) throws ModelRepositoryException(Code) | | Removes a listener object from the metamodel.
Parameters: pModelName - - the name of model to remove this listener from Parameters: pModelListener - - the listener object to remove throws: ModelRepositoryException - in case if there was a problem removing the listener |
validateModel | public void validateModel(String pModelName) throws ModelRepositoryException, ModelValidationException(Code) | | Verifies model constraints on the given model.
Repository must not be in transaction at the time of this call.
Parameters: pModelName - the unique name of the model which must be loaded into the repository prior to this call. exception: ModelRepositoryException - thrown if there was a general problem with accessing the model exception: ModelValidationException - thrown if there was one or more validation problems.Caller may use getExplanation() method offered by this exception to discover what is actually wrong |
|
|
|