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`

>      <osd:transform class="com.foo.MyTransformation" />

where `com.foo.MyTransformation` is the fully qualified name of the class extending `NodeDataTransformer`. It is also possible to set additional JavaBean properties:

>      <osd:transform class="com.foo.MyTransformation">
>              <param1>...</param1>
>              <param2>...</param2>
>      </osd:transform>

where `param1` and `param2` are JavaBean properties of the specified class.

For more information, see the JavaBean specification.

### Life cycle

1. 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(...)` and `setParam2(...)`);
2. During the operational phase, the method `transformOnExport(Object, NodeDataTransformerContext)` is called for each value to export to an archive.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NodeDataTransformer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Object`
  `transformOnExport(Object rawValue, NodeDataTransformerContext aContext)`
  Method called when exporting an archive or performing a D3 broadcast.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NodeDataTransformer

    public NodeDataTransformer()

- ## Method Details

  - ### 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 a `computed value node`, or the current value is the `inherit 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`, a `List` must be returned.