Docmosis API 4.5.0

com.docmosis.template.population.format
Class BooleanDataFormatter

java.lang.Object
  extended bycom.docmosis.template.population.format.BooleanDataFormatter
All Implemented Interfaces:
DataFormatter, Serializable

public class BooleanDataFormatter
extends Object
implements DataFormatter, Serializable

A Convenience DataFormatter that will render String values for booleans. If applied to the Boolean class and a null value is encountered, null is returned.

See Also:
Serialized Form

Field Summary
static BooleanDataFormatter BOOLEAN_DINGBATS_TICK_CROSS_DATA_FORMATTER
          A Convenience DataFormatter that will render Dingbats tick and cross values for booleans.
static BooleanDataFormatter BOOLEAN_WINGDINGS_TICK_CROSS_BOX_DATA_FORMATTER
          A Convenience DataFormatter that will render WingDings tick, cross and empty box values for Booleans.
static BooleanDataFormatter BOOLEAN_WINGDINGS_TICK_CROSS_DATA_FORMATTER
          A Convenience DataFormatter that will render WingDings tick and cross values for booleans.
static BooleanDataFormatter BOOLEAN_Y_N_DATA_FORMATTER
          A Convenience DataFormatter that will render Y, N values for booleans.
static BooleanDataFormatter BOOLEAN_yes_no_DATA_FORMATTER
          A Convenience DataFormatter that will render yes, no values for booleans.
static BooleanDataFormatter BOOLEAN_Yes_No_DATA_FORMATTER
          A Convenience DataFormatter that will render Yes, No values for booleans.
static BooleanDataFormatter BOOLEAN_YES_NO_DATA_FORMATTER
          A Convenience DataFormatter that will render YES, NO values for booleans.
 
Constructor Summary
BooleanDataFormatter(String yes, String no)
           
BooleanDataFormatter(String yes, String no, String nullValue)
           
 
Method Summary
 String format(Class type, Object value, String fieldName, Class delegateClass)
          Format the given value and return a String to display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_Y_N_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_Y_N_DATA_FORMATTER
A Convenience DataFormatter that will render Y, N values for booleans. If applied to the Boolean class and a null value is encountered, null is returned.


BOOLEAN_Yes_No_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_Yes_No_DATA_FORMATTER
A Convenience DataFormatter that will render Yes, No values for booleans. If applied to the Boolean class and a null value is encountered, null is returned.


BOOLEAN_YES_NO_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_YES_NO_DATA_FORMATTER
A Convenience DataFormatter that will render YES, NO values for booleans. If applied to the Boolean class and a null value is encountered, null is returned.


BOOLEAN_yes_no_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_yes_no_DATA_FORMATTER
A Convenience DataFormatter that will render yes, no values for booleans. If applied to the Boolean class and a null value is encountered, null is returned.


BOOLEAN_WINGDINGS_TICK_CROSS_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_WINGDINGS_TICK_CROSS_DATA_FORMATTER
A Convenience DataFormatter that will render WingDings tick and cross values for booleans. If applied to the Boolean class and a null value is encountered, null is returned. The field being populated in the template must be a font that can display WingDings.


BOOLEAN_WINGDINGS_TICK_CROSS_BOX_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_WINGDINGS_TICK_CROSS_BOX_DATA_FORMATTER
A Convenience DataFormatter that will render WingDings tick, cross and empty box values for Booleans. If applied to the Boolean class and a null value is encountered, the empty box wingding is returned. The field being populated in the template must be a font that can display WingDings.


BOOLEAN_DINGBATS_TICK_CROSS_DATA_FORMATTER

public static final BooleanDataFormatter BOOLEAN_DINGBATS_TICK_CROSS_DATA_FORMATTER
A Convenience DataFormatter that will render Dingbats tick and cross values for booleans. If applied to the Boolean class and a null value is encountered, null is returned. The field being populated in the template must be a font that can display DingBats.

Constructor Detail

BooleanDataFormatter

public BooleanDataFormatter(String yes,
                            String no)

BooleanDataFormatter

public BooleanDataFormatter(String yes,
                            String no,
                            String nullValue)
Method Detail

format

public String format(Class type,
                     Object value,
                     String fieldName,
                     Class delegateClass)
Description copied from interface: DataFormatter
Format the given value and return a String to display. The class type and fieldName are given to provide more information to the method. Returning null is acceptable.

Specified by:
format in interface DataFormatter
Parameters:
type - the Class of the object to be formatted
value - the value being formatted
fieldName - the name of the field in the template that the value is destined to populate.
delegateClass - the class of the delegate currently being interrogated. This information may be useful when wanting to format the same types of information differently in the context of different delegate objects.
Returns:
the formatted String. Null may be returned which will be blank in the template.

Docmosis API 4.5.0

Copyright © 2014 Docmosis Pty Ltd. All Rights Reserved.