Package com.orchestranetworks.service
Class NodeDataTransformer
- java.lang.Object
-
- com.orchestranetworks.service.NodeDataTransformer
-
public abstract class NodeDataTransformer extends Object
This class allows the transformation of data. It can be used for anonymization purposes.Definition in the data model
The transformation class must be declared under the element
xs:annotation/xs:appinfo
where<osd:transform class="com.foo.MyTransformation" />
com.foo.MyTransformationis the fully qualified name of the class extendingNodeDataTransformer. It is also possible to set additional JavaBean properties:
where<osd:transform class="com.foo.MyTransformation"> <param1>...</param1> <param2>...</param2> </osd:transform>param1andparam2are JavaBean properties of the specified class.For more information, see the JavaBean specification.
Life cycle
- When the data model is loaded, the specified class is instantiated
through its default constructor and the JavaBean property
setters are called (in the example above,
setParam1(...)andsetParam2(...)); - During the operational phase, the method
transformOnExport(Object, NodeDataTransformerContext)is called for each value to export to an archive.
- When the data model is loaded, the specified class is instantiated
through its default constructor and the JavaBean property
setters are called (in the example above,
-
-
Constructor Summary
Constructors Constructor Description NodeDataTransformer()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ObjecttransformOnExport(Object rawValue, NodeDataTransformerContext aContext)Method called when exporting an archive or performing a D3 broadcast.
-
-
-
Method Detail
-
transformOnExport
public abstract Object transformOnExport(Object rawValue, NodeDataTransformerContext aContext)
Method called when exporting an archive or performing a D3 broadcast.This method is not called if the current node is not a
terminal node, is acomputed value node, or the current value is theinherit indicator.Otherwise, this method is called for each value of the associated node to be exported.
- Parameters:
rawValue- the value as it is persisted in the repository.aContext- can be used to access other local values or to know more about the execution context.- Returns:
- the value to be exported. It must comply with the rules for
mapping data types.
For instance, if the associated node has
maxOccurs > 1, aListmust be returned.
-
-