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 TypeMethodDescriptionvoid
acceptWithExtension
(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.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.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> T
getValue
(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.boolean
hasPropertyState
(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.void
setPropertyState
(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Sets adopted metadata object property state.void
setValue
(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:IMdAdoptedPropertyAccess
Gets 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:
getValue
in interfaceIMdAdoptedPropertyAccess
- Parameters:
source
- the object to get property, cannot benull
feature
- the property to get, cannot benull
propertyType
- the metadata property type, cannot benull
- Returns:
- the given property value of the given object, may be
null
if 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:IMdAdoptedPropertyAccess
Returns whether the adopted metadata object property has the provided state.- Specified by:
hasPropertyState
in interfaceIMdAdoptedPropertyAccess
- Parameters:
source
- the object to get value state, cannot benull
feature
- the property to get, cannot benull
state
- 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:IMdAdoptedPropertyAccess
Sets 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:
setValue
in interfaceIMdAdoptedPropertyAccess
- Parameters:
target
- the object to set property, cannot benull
feature
- the property to set, cannot benull
propertyType
- the metadata property type, cannot benull
newValue
- the new value of the given property, may benull
to 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:IMdAdoptedPropertyAccess
Sets adopted metadata object property state.- Specified by:
setPropertyState
in interfaceIMdAdoptedPropertyAccess
- Parameters:
target
- the object to set property state, cannot benull
feature
- the property to set state, cannot benull
state
- the metadata property state, cannot benull
-
acceptWithExtension
public void acceptWithExtension(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action) Description copied from interface:IMdAdoptedPropertyAccess
Applies the provided action to the object extension.- Specified by:
acceptWithExtension
in interfaceIMdAdoptedPropertyAccess
- Parameters:
target
- the object to set property state, cannot benull
action
- 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:IMdAdoptedPropertyAccess
Applies the provided action to the object extension.- Specified by:
applyToExtension
in interfaceIMdAdoptedPropertyAccess
- Parameters:
target
- the object to set property state, cannot benull
action
- 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 benull
originalFeature
- the property to check, cannot benull
propertyType
- 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 benull
originalFeature
- the property to get extension property for, cannot benull
- Returns:
- the extension model object and according property, never
null
-