Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are several required methods to implement in order to create a view converter:

Anchor
getName
getName

public String getName()

This defines the name that will be shown to the user when applying this converter.

...

 

Styleclass
ClasstopLink

top

 



Anchor
acceptsNativeType
acceptsNativeType

 

public boolean acceptsNativeType(int type)

This method returns whether or not this converter will accept a field of the type specified by the “type” argument. This argument will be one of UserInputParameters.TYPE_* (ie. TYPE_NUMERIC, TYPE_TEXT, etc.).

...

Styleclass
ClasstopLink

top

...

Anchor
getReturnType
getReturnType

public abstract int getReturnType()

...

Styleclass
ClasstopLink

top

...

Anchor
convertObj
convertObj
 

public Object convertObject(Object data) throws Exception

...

 

Code Block
languagejava
@Override
public Object convertObject(Object data) {
   if (data == null) return null;
   try {
      return new BigDecimal((String)data);
   }  catch (NumberFormatException e) {
      return null;
   }
}

Styleclass
ClasstopLink

top


Anchor
convertObjReverse
 
convertObjReverse

public Object convertObjectReverse(Object data) throws Exception

This method is used in order for Yellowfin to retrieve the initial values of a converted data set after-the-fact. It should perform the opposite conversion which was applied in convertObject and will receive an object of the type specified as the return type of this Converter.

...