public interface ModelInstance
Modifier and Type | Method and Description |
---|---|
ModelInstance |
clone()
Copies the model instance but not the model.
|
DomDocument |
getDocument()
Returns the wrapped
DomDocument . |
ModelElementInstance |
getDocumentElement()
Returns the
ModelElement corresponding to the document
element of this model or null if no document element exists. |
Model |
getModel()
Returns the underlying model.
|
<T extends ModelElementInstance> |
getModelElementById(String id)
Find a unique element of the model by id.
|
<T extends ModelElementInstance> |
getModelElementsByType(Class<T> referencingClass)
Find all elements of a type.
|
Collection<ModelElementInstance> |
getModelElementsByType(ModelElementType referencingType)
Find all elements of a type.
|
<T extends ModelElementInstance> |
newInstance(Class<T> type)
Creates a new instance of type class.
|
<T extends ModelElementInstance> |
newInstance(Class<T> type,
String id)
Creates a new instance of type class with user-defined id.
|
<T extends ModelElementInstance> |
newInstance(ModelElementType type)
Creates a new instance of type.
|
<T extends ModelElementInstance> |
newInstance(ModelElementType type,
String id)
Creates a new instance of type with user-defined id.
|
void |
setDocumentElement(ModelElementInstance documentElement)
Updates the document element.
|
ValidationResults |
validate(Collection<ModelElementValidator<?>> validators)
Validate semantic properties of this model instance using a collection of validators.
|
DomDocument getDocument()
DomDocument
.ModelElementInstance getDocumentElement()
ModelElement
corresponding to the document
element of this model or null if no document element exists.void setDocumentElement(ModelElementInstance documentElement)
documentElement
- the new document element to set<T extends ModelElementInstance> T newInstance(Class<T> type)
T
- instance typetype
- the class of the type to create<T extends ModelElementInstance> T newInstance(Class<T> type, String id)
T
- instance typetype
- the class of the type to createid
- identifier of new element instance<T extends ModelElementInstance> T newInstance(ModelElementType type)
T
- instance typetype
- the type to create<T extends ModelElementInstance> T newInstance(ModelElementType type, String id)
T
- instance typetype
- the type to createid
- identifier of new element instanceModel getModel()
<T extends ModelElementInstance> T getModelElementById(String id)
id
- the id of the elementCollection<ModelElementInstance> getModelElementsByType(ModelElementType referencingType)
referencingType
- the type of the elements<T extends ModelElementInstance> Collection<T> getModelElementsByType(Class<T> referencingClass)
referencingClass
- the type class of the elementsModelInstance clone()
ValidationResults validate(Collection<ModelElementValidator<?>> validators)
ValidationResults
object which is returned by this method.validators
- the validators to executeCopyright © 2019. All rights reserved.