Class ConcreteTransformationService
- java.lang.Object
-
- org.soulwing.prospecto.runtime.listener.ConcreteTransformationService
-
- All Implemented Interfaces:
TransformationService
public class ConcreteTransformationService extends Object implements TransformationService
ATransformationService
implementation.- Author:
- Carl Harris
-
-
Field Summary
Fields Modifier and Type Field Description static ConcreteTransformationService
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
valueToExtract(Object owner, Object modelValue, ViewNode node, ScopedViewContext context)
Derives the value to extract for a model property.Object
valueToInject(ViewEntity ownerEntity, Class<?> type, Object viewValue, ViewNode node, ScopedViewContext context)
Derives the value to inject for a model property.
-
-
-
Field Detail
-
INSTANCE
public static final ConcreteTransformationService INSTANCE
-
-
Method Detail
-
valueToExtract
public Object valueToExtract(Object owner, Object modelValue, ViewNode node, ScopedViewContext context) throws Exception
Description copied from interface:TransformationService
Derives the value to extract for a model property.Property listeners on the view context are first allowed to transform the value as desired. Then a value type converter (if available) is used to converter the transformed model value to its view representation.
- Specified by:
valueToExtract
in interfaceTransformationService
- Parameters:
owner
- owner of the property in the modelmodelValue
- value of the property in model representationnode
- associated view nodecontext
- view context- Returns:
- derived view property value
- Throws:
Exception
-
valueToInject
public Object valueToInject(ViewEntity ownerEntity, Class<?> type, Object viewValue, ViewNode node, ScopedViewContext context) throws Exception
Description copied from interface:TransformationService
Derives the value to inject for a model property.The view value is first converted to an instance of the model data type. Then property listeners on the view context are allowed to transform the value as desired to arrive at the resulting derived value.
- Specified by:
valueToInject
in interfaceTransformationService
- Parameters:
ownerEntity
- view entity representing the owner of the propertytype
- property type in the modelviewValue
- value of the property in view representationnode
- associated view nodecontext
- view context- Returns:
- derived model property value
- Throws:
Exception
-
-