Package com.orchestranetworks.service
Class NodeDataTransformer
java.lang.Object
com.orchestranetworks.service.NodeDataTransformer
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.MyTransformation
is
the fully qualified name of the class extending NodeDataTransformer
.
It is also possible to set additional JavaBean properties:
where<osd:transform class="com.foo.MyTransformation"> <param1>...</param1> <param2>...</param2> </osd:transform>
param1
and param2
are 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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
transformOnExport
(Object rawValue, NodeDataTransformerContext aContext) Method called when exporting an archive or performing a D3 broadcast.
-
Constructor Details
-
NodeDataTransformer
public NodeDataTransformer()
-
-
Method Details
-
transformOnExport
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
, aList
must be returned.
-