|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DeliveryContext
serves as the developer's "window to the outer-world".
All the parameters needed to make the versioning decisions in the application scope of a given module or a component
should be registered in its DeliveryContext
. During application runtime,
the DeliveryContext
is used to acquire property values needed during instantiation
of queries out of the pre-defined query templates. With a properly configured DeliveryContext
the developer does not need to care about retrieving property values and/or fall-back (default-value)
policies as all this should be already built-in in the DeliveryContext
.
Remarks: The main purpose of using derived (mapped) properties in the DeliveryContext
is to transform raw (typically domain-specific -- e.g. UAProf) meta-data into pre-processed application-specific
properties which better correspond to the inherent logic of the application. The transformations in such a case
are typically value adding (information adding): e.g. canonicalization, hierarchical classification. Alternatively, the usage of the
property mappings can be as simple as property renaming (aliasing) due to the need to use multiple overlapping vocabularies (namespaces).
Method Summary | |
java.lang.Object |
getValue(Property prop)
Returns the current value of the specified Property .
|
java.lang.Object |
getValue(java.lang.String uniqueName)
Returns the current value of the specified property. |
ValueProvider |
getValueProvider(Property prop)
Returns the ValueProvider for the specified Property . |
boolean |
hasValue(Property prop)
Checks whether the specified Property has value in the current state of the delivery context. |
boolean |
hasValue(java.lang.String uniqueName)
Checks whether the property of the specified uniqueName has value in the current state of the delivery context. |
void |
registerProperty(Property prop,
ValueProvider vp)
Registers a leaf property and its associated value provider. |
Methods inherited from interface cz.cuni.versatile.api.PropertyRegistry |
getProperties, getProperty, getPropertyMapping, hasProperty, hasProperty, isMappedProperty, registerProperty, unregisterProperty |
Method Detail |
public void registerProperty(Property prop, ValueProvider vp)
Property
has already been registered, it redefines the Property
For registering a derived (mapped) property to the DeliveryContext
use PropertyRegistry.registerProperty(Property, PropertyMapping)
;
the property being registered must be in the range set of the PropertyMapping
and
consequently, all the properties of the mapping's domain set must be already registered in the delivery context.
prop
- a Property
to registervp
- ValueProvider
for the Property
PropertyRegistry.registerProperty(Property, PropertyMapping)
public ValueProvider getValueProvider(Property prop) throws UnregisteredPropertyException, PropertyKindException
ValueProvider
for the specified Property
.
prop
- a Property
instance
ValueProvider
for the specified Property
UnregisteredPropertyException
- in case the property is not registered
PropertyKindException
- in case there is no ValueProvider
registered for the given Property
public boolean hasValue(Property prop) throws UnregisteredPropertyException
Property
has value in the current state of the delivery context.
prop
- a Property
instance
true
if the property can be evaluated, false
if the property value is undefined
UnregisteredPropertyException
- in case the specified Property
in not registeredValueProvider.hasValue()
public boolean hasValue(java.lang.String uniqueName) throws UnregisteredPropertyException
uniqueName
has value in the current state of the delivery context.
uniqueName
- a unique identifier of the property
true
if the property can be evaluated, false
if the property value is undefined
UnregisteredPropertyException
- in case the specified Property
in not registeredValueProvider.hasValue()
public java.lang.Object getValue(Property prop) throws UnregisteredPropertyException, UndefinedPropertyValueException
Property
.
In case of a leaf property it directly invokes its ValueProvider
.
In case of a derived property it builds a dependency tree based on its potentially nested) property mappings
and proceeds with a recursive bottom-up evaluation starting with the leaf properties.
prop
- a Property
instance
Property
UnregisteredPropertyException
- in case the specified Property
in not registered
UndefinedPropertyValueException
- in case the property value is undefinedpublic java.lang.Object getValue(java.lang.String uniqueName) throws UnregisteredPropertyException, UndefinedPropertyValueException
ValueProvider
.
In case of a derived property it builds a dependency tree based on its potentially nested) property mappings
and proceeds with a recursive bottom-up evaluation starting with the leaf properties.
uniqueName
- a unique identifier of the property
UnregisteredPropertyException
- in case the property of the specified uniqueName
in not registered
UndefinedPropertyValueException
- in case the property value is undefined
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |