|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AadlPropertyValue
Interface encapsulating an actual evaluated property value for a specific property of a specific component in a specific mode. The main purpose of this interface is to deal with the fact that value can be non-existent or undefined, and to deal with the fact that the value may be a list or a scalar.
A property value may not exist if the component for which it was looked
up does not exist in the particular mode used to look up the value. In
such cases exists()
returns false
. A property value
may be undefined if no value is ever associated with the property. In such
cases isNotPresent()
returns true
. An existent,
defined property may be a list, in which case isList()
returns
true
. It is not possible to determine if the value is a list
by using the getValue()
method because it always returns a list.
When isList()
is false
the list has a length of one.
The list returned by getValue()
is of PropertyValue
objects.
The shortcut method getScalarValue()
may be used when isList()
is
false
to directly obtain a single PropertyValue
object.
The methods preEvaluate(PropertyHolder)
and
evaluate(PropertyHolder, Map)
are used by the property lookup
algorithms and should not be used otherwise.
Method Summary | |
---|---|
AadlPropertyValue |
evaluate(PropertyHolder context,
java.util.Map modes)
Evaluate a property value in the given context and with the given mode bindings. |
boolean |
exists()
Does the value exist at all? |
java.util.List |
getDefiningAssociations()
Get the property associations/property declaration that determines this value. |
PropertyValue |
getScalarValue()
Get the scalar value of the property. |
java.util.List |
getValue()
Get the value of the property. |
AadlPropertyValue |
instantiate(ComponentInstance root)
Update the property value so that it makes sense in an instance model. |
boolean |
isList()
Is the value a list value? |
boolean |
isNotPresent()
Is the value not present. |
java.util.Set |
preEvaluate(PropertyHolder context)
Determine which modes this value may depend on. |
Method Detail |
---|
boolean exists()
true if the value exists.- See Also:
isNotPresent()
boolean isNotPresent()
true
if the value is "not present". A non
existent property value is not "not present", and thus this
returns false
if the exists()
is false
.boolean isList()
true
if the value is a list. Returns false
if exists()
or isNotPresent()
is true
.java.util.List getValue()
null
.
If isList()
is false
then this list is a
one-element list, whose first (and only) element is the property
value. Otherwise, the returned list is the property value.PropertyValue getScalarValue()
null
.
java.lang.UnsupportedOperationException
- Thrown if isList()
is true.java.util.Set preEvaluate(PropertyHolder context) throws InvalidModelException
context
- The element this value comes from.
InvalidModelException
- Thrown if the property value cannot
be pre-evaluated because the model is incomplete or malformed.AadlPropertyValue evaluate(PropertyHolder context, java.util.Map modes) throws InvalidModelException
context
- The element any property references should be looked up
against.modes
- A map from ComponentImpl
to Mode
defining the mode
bindings to use for the evaluation.
InvalidModelException
- Thrown if the property value cannot
be evaluated because the model is incomplete or malformed.AadlPropertyValue instantiate(ComponentInstance root) throws InvalidModelException
root
- The component instance to be used as the root of subcomponent
paths. (This is also the component whose declared modes may be
used in any in modes clauses.)
InvalidModelException
- Thrown if the property value cannot
be instantiated because the model is incomplete or malformed.java.util.List getDefiningAssociations()
isNotPresent()
is true
because the value actually be defined to be a reference to another
property value and that property value might be undefined.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |