public class MModelServices extends java.lang.Object implements IMModelServices
IMModelServices
.Constructor and Description |
---|
MModelServices(ICoreSession session) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<? extends MObject> |
findByAtt(MClass metaclass,
java.lang.String att,
java.lang.Object val)
Get elements in the model from a metaclass, a meta attribute name and its value.
|
java.util.Collection<? extends MObject> |
findByClass(MClass metaclass)
Get all elements in the model from their metaclass.
|
MObject |
findById(MClass metaclass,
java.lang.String id)
Get an element in the model from its id and metaclass.
|
MObject |
findByRef(MRef ref)
Get an element in the model from an
MRef . |
java.util.List<NoteType> |
findNoteTypes(java.lang.String moduleName,
java.lang.String ownerName,
java.lang.String noteTypeName,
MClass metaclass)
Find note types by name and metaclass
|
java.util.List<ResourceType> |
findResourceTypes(java.lang.String moduleName,
java.lang.String ownerName,
java.lang.String resourceTypeName,
MClass metaclass)
Find resource types by name and metaclass
|
java.util.List<Stereotype> |
findStereotypes(java.lang.String moduleName,
java.lang.String stereotypeName,
MClass metaclass)
Find stereotypes by name and metaclass
|
java.util.List<Stereotype> |
findStereotypes(java.lang.String moduleName,
java.lang.String stereotypeName,
java.lang.String metaclass)
Deprecated.
|
java.util.List<TagType> |
findTagTypes(java.lang.String moduleName,
java.lang.String ownerName,
java.lang.String tagTypeName,
MClass metaclass)
Find tag types by name and metaclass
|
java.lang.String |
getCompositionPath(MObject mObject) |
IElementConfigurator |
getElementConfigurer() |
IElementNamer |
getElementNamer() |
MMetamodel |
getMetamodel() |
IModelFactoryService |
getModelFactory()
Get the model object creation factory.
|
NoteType |
getNoteType(java.lang.String moduleName,
java.lang.String ownerName,
java.lang.String noteTypeName,
MClass metaclass)
Find a note type by name and metaclass.
|
ResourceType |
getResourceType(java.lang.String moduleName,
java.lang.String ownerName,
java.lang.String resourceTypeName,
MClass metaclass)
Find a resource type by name and metaclass.
|
Stereotype |
getStereotype(java.lang.String moduleName,
java.lang.String stereotypeName,
MClass metaclass)
Find a stereotype by name and metaclass.
|
Stereotype |
getStereotype(java.lang.String moduleName,
java.lang.String stereotypeName,
java.lang.String metaclass)
Deprecated.
|
TagType |
getTagType(java.lang.String moduleName,
java.lang.String ownerType,
java.lang.String tagTypeName,
MClass metaclass)
Find a tag type by name and metaclass.
|
void |
invalidateProject(java.lang.Object object)
Invalidate the service and prevent further usage.
|
public MModelServices(ICoreSession session)
session
- a core modeling session.public java.util.Collection<? extends MObject> findByAtt(MClass metaclass, java.lang.String att, java.lang.Object val)
IMModelServices
If Element
is given, every elements in the model will be checked.
findByAtt
in interface IMModelServices
metaclass
- the metaclass to look for.att
- the name of the meta attribute to check the value in.val
- the value to look for in the attribute.null
.public java.util.Collection<? extends MObject> findByClass(MClass metaclass)
IMModelServices
findByClass
in interface IMModelServices
metaclass
- the metaclass to look for.public MObject findById(MClass metaclass, java.lang.String id)
IMModelServices
findById
in interface IMModelServices
metaclass
- the java interface of the metaclass to look for.id
- the id to look for.public MObject findByRef(MRef ref) throws UnknownMetaclassException
IMModelServices
MRef
.findByRef
in interface IMModelServices
ref
- a model object reference.UnknownMetaclassException
- when the reference's metaclass can't be resolved as a MClass
public java.lang.String getCompositionPath(MObject mObject)
getCompositionPath
in interface IMModelServices
public IElementConfigurator getElementConfigurer()
getElementConfigurer
in interface IMModelServices
public IElementNamer getElementNamer()
getElementNamer
in interface IMModelServices
public MMetamodel getMetamodel()
getMetamodel
in interface IMModelServices
public IModelFactoryService getModelFactory()
IMModelServices
getModelFactory
in interface IMModelServices
public java.util.List<NoteType> findNoteTypes(java.lang.String moduleName, java.lang.String ownerName, java.lang.String noteTypeName, MClass metaclass)
IMModelServices
findNoteTypes
in interface IMModelServices
moduleName
- the name of the module owing the note type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerName
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.noteTypeName
- the note type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any note type.metaclass
- the metaclass .public java.util.List<ResourceType> findResourceTypes(java.lang.String moduleName, java.lang.String ownerName, java.lang.String resourceTypeName, MClass metaclass)
IMModelServices
findResourceTypes
in interface IMModelServices
moduleName
- the name of the module owing the resource type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerName
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.resourceTypeName
- the resource type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any resource type.metaclass
- the metaclass .public java.util.List<Stereotype> findStereotypes(java.lang.String moduleName, java.lang.String stereotypeName, MClass metaclass)
IMModelServices
findStereotypes
in interface IMModelServices
moduleName
- the name of the module owing the stereotype, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.stereotypeName
- the stereotype name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any stereotype.metaclass
- the metaclass .@Deprecated public java.util.List<Stereotype> findStereotypes(java.lang.String moduleName, java.lang.String stereotypeName, java.lang.String metaclass) throws UnknownMetaclassException
IMModelServices
findStereotypes
in interface IMModelServices
moduleName
- the name of the module owing the stereotype, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.stereotypeName
- the stereotype name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any stereotype.metaclass
- the metaclass name. Using a qualified name is strongly recommended.UnknownMetaclassException
- if the metaclass name does not match an existing metaclass.public java.util.List<TagType> findTagTypes(java.lang.String moduleName, java.lang.String ownerName, java.lang.String tagTypeName, MClass metaclass)
IMModelServices
findTagTypes
in interface IMModelServices
moduleName
- the name of the module owing the tag type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerName
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.tagTypeName
- the tag type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any tag type.metaclass
- the metaclass.public NoteType getNoteType(java.lang.String moduleName, java.lang.String ownerName, java.lang.String noteTypeName, MClass metaclass) throws ElementNotUniqueException
IMModelServices
getNoteType
in interface IMModelServices
moduleName
- the name of the module owing the note type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerName
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.noteTypeName
- the note type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any note type.metaclass
- a metaclass the note type must be applicable to.null
is no element matches the given parameters.ElementNotUniqueException
- when resolution is ambiguous and several note types match the given parameterspublic ResourceType getResourceType(java.lang.String moduleName, java.lang.String ownerName, java.lang.String resourceTypeName, MClass metaclass) throws ElementNotUniqueException
IMModelServices
getResourceType
in interface IMModelServices
moduleName
- the name of the module owing the resource type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerName
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.resourceTypeName
- the resource type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any resource type.metaclass
- a metaclass the resource type must be applicable to.null
is no element matches the given parameters.ElementNotUniqueException
- when resolution is ambiguous and several resource types match the given parameterspublic Stereotype getStereotype(java.lang.String moduleName, java.lang.String stereotypeName, MClass metaclass) throws ElementNotUniqueException
IMModelServices
getStereotype
in interface IMModelServices
moduleName
- the name of the module owing the stereotype, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.stereotypeName
- the stereotype name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any stereotype.metaclass
- a metaclass the stereotype must be applicable to.null
is no element matches the given parameters.ElementNotUniqueException
- when resolution is ambiguous and several stereotypes match the given parameters@Deprecated public Stereotype getStereotype(java.lang.String moduleName, java.lang.String stereotypeName, java.lang.String metaclass) throws ElementNotUniqueException, UnknownMetaclassException
IMModelServices
getStereotype
in interface IMModelServices
moduleName
- the name of the module owing the stereotype, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.stereotypeName
- the stereotype name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any stereotype.metaclass
- a metaclass the stereotype must be applicable to.null
is no element matches the given parameters.ElementNotUniqueException
- when resolution is ambiguous and several stereotypes match the given parametersUnknownMetaclassException
- when metaclass can't be resolved as a MClass
public TagType getTagType(java.lang.String moduleName, java.lang.String ownerType, java.lang.String tagTypeName, MClass metaclass) throws ElementNotUniqueException
IMModelServices
getTagType
in interface IMModelServices
moduleName
- the name of the module owing the tag type, or a regular expression for module name matching. null
or ""
are interpreted as ".*"
, i.e. any module.ownerType
- the name of the Stereotype
or MetaclassReference
owning the type. Cannot be null
.tagTypeName
- the tag type name, or a regular expression. null
or ""
are interpreted as ".*"
, i.e. any tag type.metaclass
- a metaclass the tag type must be applicable to.null
is no element matches the given parameters.ElementNotUniqueException
- when resolution is ambiguous and several tag types match the given parameterspublic void invalidateProject(java.lang.Object object)
object
- a dummy parameter