MetaDone
metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T > Class Reference
Inheritance diagram for metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >:
Collaboration diagram for metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >:

List of all members.

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

Detailed Description

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.

Author:
kma
Parameters:
<S>The source type
<T>The target type

Constructor & Destructor Documentation

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.

Parameters:
sourceThe source type
supportedTypeThe target type
contextThe context
expressionThe expression
parentThe parent or null
Exceptions:
BadPreCondition

Member Function Documentation

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.

Parameters:
sourceThe source component
Returns:
The target component
Exceptions:
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.

Parameters:
sourceThe source component
existingThe existing component or null
Returns:
The target component
Exceptions:
BadPreCondition
See also:
#disposeAdapted(Component)
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.

Parameters:
compThe 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.

Returns:
The source class
final Class<T> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.getTargetClass ( )

Gets the target type.

Returns:
The target class
void metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.notifyChildChanged ( Engine  child,
ChildComponent  comp 
) [protected]

Member Data Documentation

final Class<S> metadone.client.grasyla2.base.GrasylaEngineAdaptor< S, T >.source [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations