Package com._1c.g5.v8.dt.md.extension
Interface IMdAdoptedPropertyAccess
-
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.<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.
-
-
-
Method Detail
-
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 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
- 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 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
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 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- Throws:
UnsupportedPropertyTypeException
- if the given object does not support the given property typeClassCastException
- if the givennewValue
type 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 benull
feature
- the property to set state, cannot benull
state
- the metadata property state, cannot benull
- Throws:
UnsupportedPropertyTypeException
- if the given object does not support the given property type
-
acceptWithExtension
void acceptWithExtension(org.eclipse.emf.ecore.EObject target, Consumer<ObjectExtension> action)
Applies the provided action to the object extension.- Parameters:
target
- the object to set property state, cannot benull
action
- 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 benull
action
- the action to apply, cannot benull
- Returns:
- the optional result of the action
-
-