MetaDone
|
Public Member Functions | |
UpdaterSelfEngine (GrasylaContext context, ConcreteObject expression, Engine parent) throws BadPreCondition | |
Protected Member Functions | |
ConcreteProperty<?> | getSelf () throws BadPreCondition |
Component<?extends MutableValue > | evaluateComponent (BootstrapGrasyla grasyla) throws BadPreCondition |
void | activate () |
Private Attributes | |
final MutableValue | value |
Creates an MutableValue for a self.
The expression denotes an reference of type RefType#SELF. Otherwise the engine is skipped. Moreover, the object must be a ConcreteProperty.
none
none
A MutableValue.
metadone.client.grasyla2.ref.UpdaterSelfEngine.UpdaterSelfEngine | ( | GrasylaContext | context, |
ConcreteObject | expression, | ||
Engine | parent | ||
) | throws BadPreCondition |
Initializes this engine.
context | The context |
expression | The expression |
parent | The parent or null |
BadPreCondition |
References metadone.client.grasyla2.ref.UpdaterSelfEngine.getSelf(), metadone.client.grasyla2.ref.RefSpecEngine.isSelf(), and metadone.client.grasyla2.GrasylaEngineFactory.SKIP.
void metadone.client.grasyla2.ref.UpdaterSelfEngine.activate | ( | ) | [protected] |
Component<? extends MutableValue> metadone.client.grasyla2.ref.UpdaterSelfEngine.evaluateComponent | ( | BootstrapGrasyla | grasyla | ) | throws BadPreCondition [protected] |
ConcreteProperty<?> metadone.client.grasyla2.ref.UpdaterSelfEngine.getSelf | ( | ) | throws BadPreCondition [protected] |
Gets the concerned object.
BadPreCondition |
Referenced by metadone.client.grasyla2.ref.UpdaterSelfEngine.UpdaterSelfEngine().
final MutableValue metadone.client.grasyla2.ref.UpdaterSelfEngine.value [private] |
new MutableValue() { @SuppressWarnings("unchecked") @Override public boolean setValue(Object value) throws BadPreCondition { ConcreteProperty cp = getSelf(); value = ClassUtil.convert(cp.getType(), value); if (value == null) return false; cp.setValue(value); return true; } @Override public Object getValue() { try { return getSelf().getValue(); } catch (BadPreCondition e) { logger.error("Failed to get 'self' value", e); return null; } } }