Package org.eclipse.epsilon.eol.models
Class ModelRepository
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.ModelRepository
-
public class ModelRepository extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModelRepository.AmbiguousEnumerationValue
Special return value that can be used bygetEnumerationValue(String)
to signal that a certain enumeration reference is ambiguous.static class
ModelRepository.TypeAmbiguityCheckResult
-
Constructor Summary
Constructors Constructor Description ModelRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModel(IModel model)
void
addModels(Collection<? extends IModel> models)
void
addModels(IModel... models)
ModelRepository.TypeAmbiguityCheckResult
checkAmbiguity(String typeName)
Returns a result that indicates (1) whether the specified type is ambiguous (i.e.void
dispose()
protected String
getEnumeration(String enumerationAndLabel)
Object
getEnumerationValue(String modelAndEnumerationAndLabel)
Resolves the enumeration literal corresponding to a given label of the form(MODEL '!')? TYPE? '#' LABEL
.protected String
getLabel(String enumerationAndLabel)
protected String
getMetaClassName(String modelAndMetaClass)
IModel
getModelByName(String modelName)
IModel
getModelByNameSafe(String modelName)
protected String
getModelName(String modelAndMetaClass)
List<IModel>
getModels()
IModel
getOwningModel(Object instance)
ModelRepositoryTransactionSupport
getTransactionSupport()
void
removeModel(IModel model)
String
toString()
-
-
-
Method Detail
-
getTransactionSupport
public ModelRepositoryTransactionSupport getTransactionSupport()
-
addModels
public void addModels(IModel... models)
-
addModels
public void addModels(Collection<? extends IModel> models)
- Parameters:
models
-- Since:
- 1.6
-
addModel
public void addModel(IModel model)
-
removeModel
public void removeModel(IModel model)
-
getModelByName
public IModel getModelByName(String modelName) throws EolModelNotFoundException
- Throws:
EolModelNotFoundException
-
checkAmbiguity
public ModelRepository.TypeAmbiguityCheckResult checkAmbiguity(String typeName)
Returns a result that indicates (1) whether the specified type is ambiguous (i.e. more than oneIModel
in this repository has the type), and (2) the set of models that do have this type.
-
getEnumerationValue
public Object getEnumerationValue(String modelAndEnumerationAndLabel) throws EolModelNotFoundException, EolEnumerationValueNotFoundException
Resolves the enumeration literal corresponding to a given label of the form(MODEL '!')? TYPE? '#' LABEL
.- Returns:
- The enumeration literal if unambiguous, or an
ModelRepository.AmbiguousEnumerationValue
if it is ambiguous. - Throws:
EolModelNotFoundException
EolEnumerationValueNotFoundException
-
dispose
public void dispose()
-
-