Package com._1c.g5.v8.dt.md.extension
Interface IMdAdoptedPropertyAccess
- All Known Implementing Classes:
MdAdoptedPropertyAccess
public interface IMdAdoptedPropertyAccess
Metadata adopted property access support allows clients to get and set adopted metadata objects properties.
Instead of manual metadata model object manipulations IMdAdoptedPropertySupport performs actions
with respect to 1C:Enterprise runtime properties versions and property types restrictions, and internal
extension values management.
-
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.<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.
-
Method Details
-
getValue
<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.Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.
- 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 - Throws:
UnsupportedPropertyTypeException- if the given object does not support the given property typeClassCastException- if the returned property value is not a generic type of the method call
-
hasPropertyState
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.- 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
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.Actual value may be various: simple primitive value, reference, list or a map of values, based on actual metadata model content.
- 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- Throws:
UnsupportedPropertyTypeException- if the given object does not support the given property typeClassCastException- if the givennewValuetype does not match with the real type of the given property
-
setPropertyState
void setPropertyState(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState state) Sets adopted metadata object property state.- Parameters:
target- the object to set property state, cannot benullfeature- the property to set state, cannot benullstate- the metadata property state, cannot benull- Throws:
UnsupportedPropertyTypeException- if the given object does not support the given property type
-
acceptWithExtension
Applies the provided action to the object extension.- Parameters:
target- the object to set property state, cannot benullaction- the action to apply, cannot benull
-
applyToExtension
<T> Optional<T> applyToExtension(org.eclipse.emf.ecore.EObject target, Function<ObjectExtension, T> action) Applies the provided action to the object extension.- Parameters:
target- the object to set property state, cannot benullaction- the action to apply, cannot benull- Returns:
- the optional result of the action
-