Package org.eclipse.epsilon.emc.plainxml
Class PlainXmlModel
- All Implemented Interfaces:
AutoCloseable,IOperationContributorProvider,IModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected Documentprotected static final Stringprotected Fileprotected Stringprotected PlainXMLOperationContributorstatic final Stringstatic final Stringprotected Stringprotected StringFields inherited from class org.eclipse.epsilon.eol.models.CachedModel
allContentsCache, kindCache, PROPERTY_CACHED, PROPERTY_CONCURRENT, typeCacheFields inherited from class org.eclipse.epsilon.eol.models.Model
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Element>voidbind(String sourceTag, String sourceAttribute, String targetTag, String targetAttribute, boolean many) voidcollectAllElements(Node root, Collection<Element> elements) createInstance(String type, Collection<Object> parameters) protected ElementcreateInstanceInModel(String type) protected booleandeleteElementInModel(Object instance) Returns true iff the given instance was deleted from the model.protected voidprotected Collection<Element>getAllOfKindFromModel(String type) protected Collection<Element>getAllOfTypeFromModel(String type) protected Collection<String>getAllTypeNamesOf(Object instance) Returns the fully qualified names of every type to which the given object conforms.protected ObjectgetCacheKeyForType(String type) Returns an identity for the given type, which will be used byCachedModelas a key for the memoization of model elements by type.getElementById(String id) getElementId(Object instance) getEnumerationValue(String enumeration, String label) getFile()getRoot()getTypeNameOf(Object instance) Returns a string representing the type of the instance object.getUri()getXml()booleanbooleanisInstantiable(String type) booleanisLoaded()Convenience method for determining when a model has been loaded.booleanisModelElement(Object instance) Used to test whether a Java object can be contained by this model.voidload(StringProperties properties, IRelativePathResolver resolver) protected voidbooleanUsed to test whether an object is contained in this model.voidsetElementId(Object instance, String newId) voidvoidsetIdAttributeName(String idAttributeName) voidvoidvoidbooleanstore()booleanbooleantagMatches(Element element, String name) Methods inherited from class org.eclipse.epsilon.eol.models.CachedModel
addToCache, allContents, clearCache, createInstance, deleteElement, dispose, getAllOfKind, getAllOfKindOrType, getAllOfType, initCaches, isCachingEnabled, isConcurrent, load, removeFromCache, setCachingEnabled, setConcurrent, wrapMethods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.models.IModel
checkAmbiguity, close
-
Field Details
-
idAttributeName
-
document
-
uri
-
file
-
xml
-
operationContributor
-
createdElements
-
bindings
-
ELEMENT_TYPE
- See Also:
-
DEFAULT_NEW_TAG_NAME
- See Also:
-
PROPERTY_FILE
- See Also:
-
PROPERTY_URI
- See Also:
-
-
Constructor Details
-
PlainXmlModel
public PlainXmlModel()
-
-
Method Details
-
getRoot
-
setRoot
-
allContentsFromModel
- Specified by:
allContentsFromModelin classCachedModel<Element>
-
getBindings
-
getUri
-
setUri
-
getXml
-
setXml
-
getFile
-
setFile
-
getDocument
-
bind
-
isLoaded
public boolean isLoaded()Description copied from class:CachedModelConvenience method for determining when a model has been loaded.- Overrides:
isLoadedin classCachedModel<Element>- Returns:
- Whether the cache has been populated.
- Since:
- 1.6
-
createInstanceInModel
protected Element createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstanceInModelin classCachedModel<Element>- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
createInstance
public Element createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstancein interfaceIModel- Overrides:
createInstancein classModel- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
deleteElementInModel
Description copied from class:CachedModelReturns true iff the given instance was deleted from the model.- Specified by:
deleteElementInModelin classCachedModel<Element>- Throws:
EolRuntimeException
-
collectAllElements
-
getAllOfKindFromModel
protected Collection<Element> getAllOfKindFromModel(String type) throws EolModelElementTypeNotFoundException - Specified by:
getAllOfKindFromModelin classCachedModel<Element>- Throws:
EolModelElementTypeNotFoundException
-
getAllOfTypeFromModel
protected Collection<Element> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException - Specified by:
getAllOfTypeFromModelin classCachedModel<Element>- Throws:
EolModelElementTypeNotFoundException
-
tagMatches
-
disposeModel
protected void disposeModel()- Specified by:
disposeModelin classCachedModel<Element>
-
getElementById
- Specified by:
getElementByIdin interfaceIModel
-
getElementId
- Specified by:
getElementIdin interfaceIModel
-
setElementId
- Specified by:
setElementIdin interfaceIModel
-
setIdAttributeName
-
getIdAttributeName
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException - Specified by:
getEnumerationValuein interfaceIModel- Throws:
EolEnumerationValueNotFoundException
-
getTypeNameOf
Description copied from interface:IModelReturns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.- Specified by:
getTypeNameOfin interfaceIModel- Parameters:
instance- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
getCacheKeyForType
Description copied from class:CachedModelReturns an identity for the given type, which will be used byCachedModelas a key for the memoization of model elements by type.- Specified by:
getCacheKeyForTypein classCachedModel<Element>- Throws:
EolModelElementTypeNotFoundException
-
getAllTypeNamesOf
Description copied from class:CachedModelReturns the fully qualified names of every type to which the given object conforms. The values are used by byCachedModelfor the memoization of model elements by their kind (CachedModel.getAllOfKind(String)).- Specified by:
getAllTypeNamesOfin classCachedModel<Element>
-
getTypeOf
-
hasType
-
isInstantiable
- Specified by:
isInstantiablein interfaceIModel
-
isModelElement
Description copied from interface:IModelUsed to test whether a Java object can be contained by this model. For example, EMF models can contain instances of EObject, but not instances of just Object.- Specified by:
isModelElementin interfaceIModel- Overrides:
isModelElementin classModel- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
loadModel
- Specified by:
loadModelin classCachedModel<Element>- Throws:
EolModelLoadingException
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
loadin interfaceIModel- Overrides:
loadin classCachedModel<Element>- Throws:
EolModelLoadingException
-
owns
Description copied from interface:IModelUsed to test whether an object is contained in this model. -
store
-
store
public boolean store() -
getOperationContributor
- Specified by:
getOperationContributorin interfaceIOperationContributorProvider
-