Package org.eclipse.epsilon.emc.emf
Class EmfPropertySetter
java.lang.Object
org.eclipse.epsilon.eol.execute.introspection.AbstractPropertySetter
org.eclipse.epsilon.emc.emf.EmfPropertySetter
- All Implemented Interfaces:
IPropertySetter,IReflectivePropertySetter
- Direct Known Subclasses:
XmlPropertySetter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerce(Object target, String property, Object value, IEolContext context) Coerces the given value such that it is permitted for this property.booleanconforms(Object target, String property, Object value, IEolContext context) Indicates whether the specified value is permitted for this property.protected voidcopyCollectionValues(Collection<?> source, Collection<Object> target) protected org.eclipse.emf.ecore.EObjectgetEObject(Object object, String property, Object value, IEolContext context) voidinvoke(Object target, String property, Object value, IEolContext context) Sets a property on a given object to the specified value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.execute.introspection.IPropertySetter
invoke, invokeMethods inherited from interface org.eclipse.epsilon.eol.execute.introspection.IReflectivePropertySetter
coerce, conforms
-
Constructor Details
-
EmfPropertySetter
public EmfPropertySetter()
-
-
Method Details
-
coerce
public Object coerce(Object target, String property, Object value, IEolContext context) throws EolIllegalPropertyException Description copied from interface:IReflectivePropertySetterCoerces the given value such that it is permitted for this property. For example, in EMF single values can be stored in many-valued features only when they are first stored in a collection.- Specified by:
coercein interfaceIReflectivePropertySetter- Throws:
EolIllegalPropertyException- when getObject is not a valid model object or when getProperty is not a property that getObject knows about.
-
conforms
public boolean conforms(Object target, String property, Object value, IEolContext context) throws EolIllegalPropertyException Description copied from interface:IReflectivePropertySetterIndicates whether the specified value is permitted for this property. For example, the value "John Doe" would conform for a string-typed property with lowerbound invalid input: '<'= 1 and upperbound >= 1. The precise semantics of conformance differ between types of model.- Specified by:
conformsin interfaceIReflectivePropertySetter- Throws:
EolIllegalPropertyException- when getObject is not a valid model object or when getProperty is not a property that getObject knows about.
-
invoke
public void invoke(Object target, String property, Object value, IEolContext context) throws EolRuntimeException Description copied from interface:IPropertySetterSets a property on a given object to the specified value.- Specified by:
invokein interfaceIPropertySetter- Parameters:
target- The model element to update.property- The name of the property of the model element.value- The new value of the property.context- The execution context.- Throws:
EolRuntimeException- If anything goes wrong in updating the value.
-
copyCollectionValues
-
getEObject
protected org.eclipse.emf.ecore.EObject getEObject(Object object, String property, Object value, IEolContext context) throws EolIllegalPropertyException - Throws:
EolIllegalPropertyException
-