public class ModelInstanceImpl extends Object implements ModelInstance
Constructor and Description |
---|
ModelInstanceImpl(ModelImpl model,
ModelBuilder modelBuilder,
DomDocument document) |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones 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 type)
Find all elements of a type.
|
<T extends ModelElementInstance> |
newInstance(Class<T> type)
Creates a new instance of type class.
|
<T extends ModelElementInstance> |
newInstance(ModelElementType type)
Creates a new instance of type.
|
ModelElementType |
registerGenericType(String namespaceUri,
String localName) |
void |
setDocumentElement(ModelElementInstance modelElement)
Updates the document element.
|
public ModelInstanceImpl(ModelImpl model, ModelBuilder modelBuilder, DomDocument document)
public DomDocument getDocument()
ModelInstance
DomDocument
.getDocument
in interface ModelInstance
public ModelElementInstance getDocumentElement()
ModelInstance
ModelElement
corresponding to the document
element of this model or null if no document element exists.getDocumentElement
in interface ModelInstance
public void setDocumentElement(ModelElementInstance modelElement)
ModelInstance
setDocumentElement
in interface ModelInstance
modelElement
- the new document element to setpublic <T extends ModelElementInstance> T newInstance(Class<T> type)
ModelInstance
newInstance
in interface ModelInstance
T
- instance typetype
- the class of the type to createpublic <T extends ModelElementInstance> T newInstance(ModelElementType type)
ModelInstance
newInstance
in interface ModelInstance
T
- instance typetype
- the type to createpublic Model getModel()
ModelInstance
getModel
in interface ModelInstance
public ModelElementType registerGenericType(String namespaceUri, String localName)
public <T extends ModelElementInstance> T getModelElementById(String id)
ModelInstance
getModelElementById
in interface ModelInstance
id
- the id of the elementpublic Collection<ModelElementInstance> getModelElementsByType(ModelElementType type)
ModelInstance
getModelElementsByType
in interface ModelInstance
type
- the type of the elementspublic <T extends ModelElementInstance> Collection<T> getModelElementsByType(Class<T> referencingClass)
ModelInstance
getModelElementsByType
in interface ModelInstance
referencingClass
- the type class of the elementsCopyright © 2018. All rights reserved.