Class MdAdoptedPropertyAccess
java.lang.Object
com._1c.g5.v8.dt.internal.md.extension.MdAdoptedPropertyAccess
- All Implemented Interfaces:
IMdAdoptedPropertyAccess
Implementation of
IMdAdoptedPropertyAccess.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptWithExtension(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action) Applies the provided action to the object extension.<T> Optional<T>applyToExtension(org.eclipse.emf.ecore.EObject target, Function<ObjectExtension, T> action) Applies the provided action to the object extension.protected org.eclipse.emf.ecore.EStructuralFeaturecheckProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature, MdPropertyType propertyType) Checks that property usage is valid for the given object and property type.protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EStructuralFeature> getExtensionProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature) Returns the extension model object and according property for the requested by client property and the given object.<T> TgetValue(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType) Gets the given property value of the given object and the given metadata property type.booleanhasPropertyState(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Returns whether the adopted metadata object property has the provided state.voidsetPropertyState(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Sets adopted metadata object property state.voidsetValue(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType, Object newValue) Sets the given property value to the given object and the given metadata property type.
-
Constructor Details
-
MdAdoptedPropertyAccess
public MdAdoptedPropertyAccess()
-
-
Method Details
-
getValue
public <T> T getValue(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType) Description copied from interface:IMdAdoptedPropertyAccessGets the given property value of the given object and the given metadata property type.Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.
- Specified by:
getValuein interfaceIMdAdoptedPropertyAccess- Parameters:
source- the object to get property, cannot benullfeature- the property to get, cannot benullpropertyType- the metadata property type, cannot benull- Returns:
- the given property value of the given object, may be
nullif the value actually isnull
-
hasPropertyState
public boolean hasPropertyState(org.eclipse.emf.ecore.EObject source, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Description copied from interface:IMdAdoptedPropertyAccessReturns whether the adopted metadata object property has the provided state.- Specified by:
hasPropertyStatein interfaceIMdAdoptedPropertyAccess- Parameters:
source- the object to get value state, cannot benullfeature- the property to get, cannot benullstate- the metadata property state to check, cannot benull- Returns:
- whether the adopted metadata object property has the provided state
-
setValue
public void setValue(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType propertyType, Object newValue) Description copied from interface:IMdAdoptedPropertyAccessSets the given property value to the given object and the given metadata property type.Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.
- Specified by:
setValuein interfaceIMdAdoptedPropertyAccess- Parameters:
target- the object to set property, cannot benullfeature- the property to set, cannot benullpropertyType- the metadata property type, cannot benullnewValue- the new value of the given property, may benullto erase property value
-
setPropertyState
public void setPropertyState(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Description copied from interface:IMdAdoptedPropertyAccessSets adopted metadata object property state.- Specified by:
setPropertyStatein interfaceIMdAdoptedPropertyAccess- Parameters:
target- the object to set property state, cannot benullfeature- the property to set state, cannot benullstate- the metadata property state, cannot benull
-
acceptWithExtension
public void acceptWithExtension(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action) Description copied from interface:IMdAdoptedPropertyAccessApplies the provided action to the object extension.- Specified by:
acceptWithExtensionin interfaceIMdAdoptedPropertyAccess- Parameters:
target- the object to set property state, cannot benullaction- the action to apply, cannot benull
-
applyToExtension
public <T> Optional<T> applyToExtension(org.eclipse.emf.ecore.EObject target, Function<ObjectExtension, T> action) Description copied from interface:IMdAdoptedPropertyAccessApplies the provided action to the object extension.- Specified by:
applyToExtensionin interfaceIMdAdoptedPropertyAccess- Parameters:
target- the object to set property state, cannot benullaction- the action to apply, cannot benull- Returns:
- the optional result of the action
-
checkProperty
protected org.eclipse.emf.ecore.EStructuralFeature checkProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature, MdPropertyType propertyType) Checks that property usage is valid for the given object and property type. Returns the validated property to provide an ability to construct fluent code.- Parameters:
originalObject- the object to check property, cannot benulloriginalFeature- the property to check, cannot benullpropertyType- the metadata property type, cannot benull- Returns:
- the valid property that was validated, never
null
-
getExtensionProperty
protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EStructuralFeature> getExtensionProperty(org.eclipse.emf.ecore.EObject originalObject, org.eclipse.emf.ecore.EStructuralFeature originalFeature) Returns the extension model object and according property for the requested by client property and the given object.- Parameters:
originalObject- the object to get extension object property, cannot benulloriginalFeature- the property to get extension property for, cannot benull- Returns:
- the extension model object and according property, never
null
-