Using a Data Helper

The Data Helper may be required under the following circumstances:

Your Data Loader is based on the DataLoader interface or introspection.

AND the return object class has only primitive attributes, but does not follow the Java Bean naming conventions.

OR the return object class has a hierarchy.

The Data Helper class must implement the inetsoft.uql.object.DataHelper interface, which defines the following two methods:

public XTypeNode[] getAttributes(Class cls)
Given a class, this method should return an array of field types. Each type can be a primitive type such as those below, or a more complex type that represents an object tree:

string (inetsoft.uql.schema.StringType)

integer (inetsoft.uql.schema.IntegerType)

date (inetsoft.uql.schema.DateType)

etc.

public Object getValue(Object obj, String name)
This method returns the value of a field. The name is the name of the field, and the obj parameter is the data object.

The Data Helper overrides the introspection in two ways.

At design time, introspection is not used to discover object fields. Instead, the getAttributes() method is called on the Data Helper to find the fields.

At runtime, field values are returned using the getValue() method of the Data Helper, instead of calling the “getter” method on the data object itself.

<< Data Loader based on DataLoader2 interface © 1996-2013 InetSoft Technology Corporation (v11.5) 6.4.2 Leveraging JavaBean Properties >>