MetaDone
|
Public Member Functions | |
GrasylaEngineAdaptor (Class< S > source, Class< T > supportedType, GrasylaContext context, ConcreteObject expression, Engine parent) throws BadPreCondition | |
final Class< S > | getSourceClass () |
final Class< T > | getTargetClass () |
Protected Member Functions | |
Component<?extends T > | evaluateComponent (BootstrapGrasyla grasyla) throws BadPreCondition |
abstract Component<?extends T > | adapt (Component<?extends S > source) throws BadPreCondition |
Component<?extends T > | adapt (Component<?extends S > source, Component<?extends T > existing) throws BadPreCondition |
void | disposeAdapted (Component<?extends T > comp) |
void | notifyChildChanged (Engine child, ChildComponent comp) |
void | disposeInternal () |
Private Attributes | |
final Class< S > | source |
An engine that is an adaptor between two types of components.
This engine is able to "translate" a component of a given type to a component of another type. This reduces the need to write engines for types that can be dervied from other.
<S> | The source type |
<T> | The target type |
metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.GrasylaEngineAdaptor | ( | Class< S > | source, |
Class< T > | supportedType, | ||
GrasylaContext | context, | ||
ConcreteObject | expression, | ||
Engine | parent | ||
) | throws BadPreCondition |
Initializes this engine.
source | The source type |
supportedType | The target type |
context | The context |
expression | The expression |
parent | The parent or null |
BadPreCondition |
abstract Component<? extends T> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.adapt | ( | Component<?extends S > | source | ) | throws BadPreCondition [protected, pure virtual] |
Adapts a source component into a target component.
source | The source component |
BadPreCondition |
Component<? extends T> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.adapt | ( | Component<?extends S > | source, |
Component<?extends T > | existing | ||
) | throws BadPreCondition [protected] |
Adapts a source component into a target component.
Called with an existing old target component. A subclass may override this method to reuse the old component. By default the old component is disposed and a new one is built.
source | The source component |
existing | The existing component or null |
BadPreCondition |
void metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.disposeAdapted | ( | Component<?extends T > | comp | ) | [protected] |
Disposes the adapted component.
Exists for cleaning up the adapted components that will no longer be used or are replaced by new ones.
comp | The component |
void metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.disposeInternal | ( | ) | [protected] |
Called by dispose().
It is called after clearing the children, the goal is to let subtypes clear their internal variables when disposing.
Reimplemented from metadone.client.grasyla2.GrasylaEngine.
Component<? extends T> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.evaluateComponent | ( | BootstrapGrasyla | grasyla | ) | throws BadPreCondition [protected] |
final Class<S> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.getSourceClass | ( | ) |
Gets the source type.
final Class<T> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.getTargetClass | ( | ) |
Gets the target type.
void metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.notifyChildChanged | ( | Engine | child, |
ChildComponent | comp | ||
) | [protected] |
final Class<S> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.source [private] |