Java Doc for ModelRepository.java in  » UML » MetaBoss » com » metaboss » sdlctools » models » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » UML » MetaBoss » com.metaboss.sdlctools.models 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
final public static  StringCOMPONENT_URL
    
final public static  StringMETAMODEL_NAME_METABOSS
    
final public static  StringMETAMODEL_NAME_UML
    


Method Summary
public  voidbeginTransaction()
     This method is part of repository transaction mangement suite of methods.
public  voidclose()
     Closes whole repository without saving any changes to any of the models.
public  voidcloseModel(String pModelName)
     Closes model in repository without saving any changes to the location specified at the time model was created or opened.
public  voidcommitTransaction()
     This method is part of repository transaction mangement suite of methods.
public  booleancontainsMetaModel(String pMetaModelName)
    
Parameters:
  pMetaModelName - the unique name of the MetaModel.
public  booleancontainsModel(String pModelName)
    
Parameters:
  pModelName - the unique name of the Model given to it when it was opened or created.
public  RefObjectcopyModelElement(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  voidcreateModel(String pModelName, File pModelRootFile, String pMetaModelName, Properties pModelStorageProperties)
     Creates a new model in the model repository.
public  RefObjectduplicateModelElement(RefObject pSourceObject)
     This helper method duplicates given object in the same model and returns newly created object. The parent (ie.
public  voidemptyModelElement(RefObject pModelElement)
    
public  voidexportModel(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  RefPackagegetDefaultModelExtent()
     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  StringgetDefaultModelMetaModelName()
    
public  StringgetDefaultModelName()
    
public  ModelPackagegetMetaModelExtent(String pMetaModelName)
     Retrieves the ModelPackage representing the outermost package of the specified MetaModel.
public  StringgetMetaModelName(String pModelName)
     Retrieves the name of the MetaModel for this model
Parameters:
  pModelName - the unique name of the Model.
public  RefPackagegetModelExtent(String pModelName)
     Retrieves the RefPackage representing the outermost package of the specified Model.
public  RefBaseObjectgetModelObjectByRepositoryId(String pRepositoryId)
     Retrieves the RefBaseObject represented by the RepositoryId (MOF Id).
public  RefPackagegetModelPackage(String pModelName, MofPackage pPackageDescriptor)
     Retrieves the RefPackage described by supplied package descriptor.
Parameters:
  pModelName - the unique name of the Model.
public  StringgetOwnerMetaModelName(RefBaseObject pModelObject)
     Retrieves the name of the metamodel given object belongs to.
Parameters:
  pModelObject - the object from the model.
public  StringgetOwnerModelName(RefBaseObject pModelObject)
     Retrieves the name of the model given object belongs to.
Parameters:
  pModelObject - the object from the model.
public  ListgetTopLevelModelObjects(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  booleanisInTransaction()
     This method is part of repository transaction mangement suite of methods.
public  booleanisModelModified(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  voidloadMetaModel(String pMetaModelName, File pMetaModelFile, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties)
     Loads meta model from the specified URL to the model repository.
public  voidloadMetaModel(String pMetaModelName, InputStream pMetaModelInputStream, String pMetaModelURIString, String pMetaModelRootPackageName, Properties pDefaultModelStorageProperties)
     Loads meta model from the specified URL to the model repository.
public  voidopenModel(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  voidrectifyModel(String pModelName)
     Attempts to correct the errors in the given model.
public  voidregisterModelAssistant(String pMetaModelName, ModelAssistant pAssistant)
     Adds the assistant to the metamodel.
public  voidregisterModelListener(String pModelName, ModelListener pModelListener)
     Adds a listener object to the model.
public  voidremoveMetaModel(String pMetaModelName)
     Removes MetaModel with the specified name.
public  voidretrofitModelElement(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  voidrollbackTransaction()
     This method is part of repository transaction mangement suite of methods.
public  voidsaveDefaultModel(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  voidsaveDefaultModelAs(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  voidsaveModel(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  voidsaveModelAs(String pModelName, boolean pValidateModel, File pNewModelRootFile, Properties pNewModelStorageProperties)
     Saves model at the location specified in this method call.
public  ListsearchByXPath(String pContextModelName, String pXPathExpression)
     Retrieves the collection of the Objects matching given XPath expression.
public  ListsearchByXPath(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  ListsearchByXPath(Collection pContextObjects, String pXPathExpression)
     Retrieves the collection of the Objects matching given XPath expression.
public  StringsetDefaultModel(String pModelName)
     Sets the default model name.
public  voidunregisterModelAssistant(String pMetaModelName, ModelAssistant pAssistant)
     Removes the assistant from the metamodel.
public  voidunregisterModelListener(String pModelName, ModelListener pModelListener)
     Removes a listener object from the metamodel.
public  voidvalidateModel(String pModelName)
     Verifies model constraints on the given model.

Field Detail
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





Method Detail
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



getDefaultModelName
public String getDefaultModelName() throws ModelRepositoryException(Code)
the name 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.



isInTransaction
public boolean isInTransaction() throws ModelRepositoryException(Code)
This method is part of repository transaction mangement suite of methods. It returns true if repository is in transaction.
throws:
  ModelRepositoryException - if repository is closed



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



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.