|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.aadl.model.properties.ModalPropertyValueAccumulatorImpl
public abstract class ModalPropertyValueAccumulatorImpl
Nested Class Summary | |
---|---|
protected static class |
ModalPropertyValueAccumulatorImpl.DefaultPAWrapper
|
protected class |
ModalPropertyValueAccumulatorImpl.ModalAssociations
|
class |
ModalPropertyValueAccumulatorImpl.NonExistentPropertyException
|
protected static class |
ModalPropertyValueAccumulatorImpl.PAWrapper
Wraps a reference to the PropertyAssociation as used by the ModeAssocNode. |
Field Summary | |
---|---|
static ModeContext |
NOT_MODAL
Value for the mode index that indicates the particular association isn't modal. |
protected PropertyHolder |
propHolder
The property holder for which the property value is being looked up. |
static java.util.List |
VALUE_UNDEFINED
Constant for marking a value as undefined. |
Constructor Summary | |
---|---|
ModalPropertyValueAccumulatorImpl(boolean list,
PropertyHolder ctx)
Create a new property value accumulate with the given propHolder. |
Method Summary | |
---|---|
void |
addDefaultValue(AadlPropertyValue defValue)
Accumulate a default value. |
java.util.Set |
addLocalContainedPropertyAssociations(PropertyHolder target,
PropertyHolder container,
PropertyDefinition pn)
Accumulate the associations for the given property as found in the contained property associations of the target's containing component. |
java.util.Set |
addLocalContainedPropertyAssociations(PropertyHolder target,
PropertyHolder container,
PropertyDefinition pn,
java.util.List targetExistsInModes,
ModeContext modeContext)
Accumulate the associations for the given property as found in the contained property associations of the target's containing component. |
java.util.Set |
addPropertyAssociations(PropertyHolder ph,
PropertyDefinition pn)
Accumulate the associations for the given property as found in the immediate properties attribute of the given property holder. |
java.util.Set |
addPropertyAssociations(PropertyHolder ph,
PropertyDefinition pn,
java.util.List compExistsInModes,
ModeContext modeContext)
Accumulate the associations for the given property as found in the immediate properties attribute of the given property holder. |
protected abstract ModalPropertyValueAccumulatorImpl.ModalAssociations |
createModalAssociations(PropertyHolder ph)
|
protected abstract ModalPropertyValueAccumulatorImpl.ModalAssociations |
createModalAssociations(PropertyHolder ph,
java.util.List inModes)
|
protected abstract ModeContext |
fixModeContext(ModeContext mc)
Given a mode context from an element along the lookup path, convert it to be compatible with the context ( propHolder ) of the current
property lookup. |
java.util.Collection |
getAllModeBindings()
Get all the mode contexts that are applicable to this value. |
java.util.Collection |
getAllValues()
Get all the values the property value could have. |
java.util.Set |
getModeContexts()
Get the components whose modes may affect this value. |
ModeContext[] |
getModeContextsAsArray()
Get the components whose modes may affect this value. |
AadlPropertyValue |
getValue()
Get the property value in the empty mode context. |
AadlPropertyValue |
getValue(java.util.Map modes)
Get the property value based on the given mode settings. |
boolean |
isModal()
Query if the property value may depend on modes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.List VALUE_UNDEFINED
public static final ModeContext NOT_MODAL
protected final PropertyHolder propHolder
value(...)
construct.
Constructor Detail |
---|
public ModalPropertyValueAccumulatorImpl(boolean list, PropertyHolder ctx)
ctx
- The binding propHolder for the property being constructed.Method Detail |
---|
public final void addDefaultValue(AadlPropertyValue defValue) throws InvalidModelException
ModalPropertyValueAccumulator
addDefaultValue
in interface ModalPropertyValueAccumulator
defValue
- The default property value.
InvalidModelException
- Thrown if the default property value cannot
be added because the model is incompletepublic final java.util.Set addPropertyAssociations(PropertyHolder ph, PropertyDefinition pn, java.util.List compExistsInModes, ModeContext modeContext) throws InvalidModelException
ModalPropertyValueAccumulator
addPropertyAssociations
in interface ModalPropertyValueAccumulator
ph
- The property holder whose properties attribute is of interestpn
- The property definitioncompExistsInModes
- The modes in which the element that the properties are
associated with exist. This is a superset of the modes that
the property association might exist for. May be
null
if the properties are not associated with
a sub element of a component implementation.modeContext
- An abstraction of the model element whose modes are the domain for this
assocation.
InvalidModelException
- Thrown if the properties clause of
given property holder is incomplete.public java.util.Set addPropertyAssociations(PropertyHolder ph, PropertyDefinition pn) throws InvalidModelException
ModalPropertyValueAccumulator
addPropertyAssociations
in interface ModalPropertyValueAccumulator
ph
- The property holder whose properties attribute is of interestpn
- The property definition
InvalidModelException
- Thrown if the properties clause of
given property holder is incomplete.public final java.util.Set addLocalContainedPropertyAssociations(PropertyHolder target, PropertyHolder container, PropertyDefinition pn, java.util.List targetExistsInModes, ModeContext modeContext) throws InvalidModelException
ModalPropertyValueAccumulator
addLocalContainedPropertyAssociations
in interface ModalPropertyValueAccumulator
target
- The property holder whose property values are being looked upcontainer
- The containing component of target
, whose
contained property associations are of interest.pn
- The property definitiontargetExistsInModes
- The modes in which target
exists. This is a superset of the modes that
the property association might exist for. May be
null
if the properties are not associated with
a sub element of a component implementation.modeContext
- An abstraction of the model element whose modes are the domain for this
assocation.
InvalidModelException
- Thrown if the properties clause of
given property holder is incomplete.public java.util.Set addLocalContainedPropertyAssociations(PropertyHolder target, PropertyHolder container, PropertyDefinition pn) throws InvalidModelException
ModalPropertyValueAccumulator
addLocalContainedPropertyAssociations
in interface ModalPropertyValueAccumulator
target
- The property holder whose property values are being looked upcontainer
- The containing component of target
, whose
contained property associations are of interest.pn
- The property definition
InvalidModelException
- Thrown if the properties clause of given property holder
is incomplete.protected abstract ModalPropertyValueAccumulatorImpl.ModalAssociations createModalAssociations(PropertyHolder ph, java.util.List inModes)
protected abstract ModalPropertyValueAccumulatorImpl.ModalAssociations createModalAssociations(PropertyHolder ph)
protected abstract ModeContext fixModeContext(ModeContext mc)
propHolder
) of the current
property lookup.
mc
- The input mode context; non-null
.
null
.public final boolean isModal()
ModalPropertyValue
ModalPropertyValue.getModeContexts()
is not empty.
isModal
in interface ModalPropertyValue
true
iff the propery value depends on modes.public final java.util.Set getModeContexts()
ModalPropertyValue
getModeContexts
in interface ModalPropertyValue
ModeContext
objects.public final ModeContext[] getModeContextsAsArray()
ModalPropertyValue
getModeContextsAsArray
in interface ModalPropertyValue
public final AadlPropertyValue getValue() throws InvalidModelException
ModalPropertyValue
getValue
in interface ModalPropertyValue
InvalidModelException
- thrown if an error in the model prevents the successful
lookup of the property value. This exception is primarily
of interest to the OSATE implementation which catches it
during certain operations to report that the model has
errors. (There are a few cases where the error can only
be detected by looking up the property value.)public final AadlPropertyValue getValue(java.util.Map modes) throws InvalidModelException
ModalPropertyValue
getValue
in interface ModalPropertyValue
modes
- The mode settings to use as a map from ModeContext
objects to Mode
objects.
The domain of the mapping is given by the
ModalPropertyValue.getModeContexts()
method.
InvalidModelException
- thrown if an error in the model prevents the successful
lookup of the property value. This exception is primarily
of interest to the OSATE implementation which catches it
during certain operations to report that the model has
errors. (There are a few cases where the error can only
be detected by looking up the property value.)public final java.util.Collection getAllModeBindings()
ModalPropertyValue
ModalPropertyValue.getModeContexts()
.
getAllModeBindings
in interface ModalPropertyValue
Map
s, enumerating all the possible
combinations of modes that apply to the lookup of the value.public final java.util.Collection getAllValues() throws InvalidModelException
ModalPropertyValue
getAllValues
in interface ModalPropertyValue
ReflectiveAadlPropertyValue
objects, one for each valid combination of modes as determined by
the mode contexts
.
InvalidModelException
- thrown if an error in the model prevents the successful
lookup of the property value. This exception is primarily
of interest to the OSATE implementation which catches it
during certain operations to report that the model has
errors. (There are a few cases where the error can only
be detected by looking up the property value.)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |