Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.makumba.commons.formatters
Class FieldFormatter

    java.lang.Object
      org.makumba.commons.formatters.FieldFormatter

Direct Known Subclasses:
  dateFormatter, FieldEditor, FieldViewer, intEnumFormatter, ptrFormatter

    public class FieldFormatter

extends Object

Formats a specific field. Subclasses of this class are handling the different kind of fields.

Author:
  Cristian Bogdan, Stefan Baebler, Frederik Habilis, Rudolf Mayer

Field Summary
`(package private) static Object` | `dummy`
`(package private) static String[]` | `params`
`(package private) static String[][]` | `paramValues`
`(package private) Hashtable<String,Hashtable<String,Object>>` | `validParams`

Constructor Summary
`protected` | `FieldFormatter()` Don't use this, use getInstance()

Method Summary
`void` | `checkParam(RecordFormatter rf, int fieldIndex, String name, String val)`
`void` | `checkParams(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)`
`boolean` | `equals(String s1, String s2)`
`String` | `format(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)` Format the object to pure text.
`String` | `formatNotNull(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)` Formats the not-null-object to pure text.
`String` | `formatNull(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)` Format the null-object to pure text.
`String[]` | `getAcceptedParams()`
`String[][]` | `getAcceptedValue()`
`String` | `getDefaultValueFormat(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)` Gets the formatted default value, used if real value is null.
`String` | `getEmptyValueFormat(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)` Gets the formatted empty value, used if real value is empty.
`String` | `getExpr(RecordFormatter rf, int fieldIndex)`
`static FieldFormatter` | `getInstance()`
`int` | `getIntParam(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams, String name)`
`String` | `getIntParamString(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams, String name)`
`void` | `initExpr(RecordFormatter rf, int fieldIndex, String s)`
`String` | `resetValueFormat(RecordFormatter rf, int fieldIndex, String s, Dictionary<String,Object> formatParams)` Chooses between the real (formatted) value and possible replacements (default, empty).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### params

    static String[] params

### paramValues

    static String[][] paramValues

### dummy

    static Object dummy

### validParams

    Hashtable<String,Hashtable<String,Object>> validParams

Constructor Detail

### FieldFormatter

    protected FieldFormatter()

  Don't use this, use getInstance()

Method Detail

### getAcceptedParams

    public String[] getAcceptedParams()

### getAcceptedValue

    public String[][] getAcceptedValue()

### getInstance

    public static FieldFormatter getInstance()

### getExpr

    public String getExpr(RecordFormatter rf,
                          int fieldIndex)

### initExpr

    public void initExpr(RecordFormatter rf,
                         int fieldIndex,
                         String s)

### checkParams

    public void checkParams(RecordFormatter rf,
                            int fieldIndex,
                            Dictionary<String,Object> formatParams)

### checkParam

    public void checkParam(RecordFormatter rf,
                           int fieldIndex,
                           String name,
                           String val)

### format

    public String format(RecordFormatter rf,
                         int fieldIndex,
                         Object o,
                         Dictionary<String,Object> formatParams)

  Format the object to pure text. If text-format is blank, try the "empty" replacer value.

  Parameters:
    `rf` - TODO
    `fieldIndex` - TODO

### formatNull

    public String formatNull(RecordFormatter rf,
                             int fieldIndex,
                             Dictionary<String,Object> formatParams)

  Format the null-object to pure text. Try the "default" format parameter.

  Parameters:
    `rf` - TODO
    `fieldIndex` - TODO

### formatNotNull

    public String formatNotNull(RecordFormatter rf,
                                int fieldIndex,
                                Object o,
                                Dictionary<String,Object> formatParams)

  Formats the not-null-object to pure text. To be over-ridden by subclasses.

### getIntParam

    public int getIntParam(RecordFormatter rf,
                           int fieldIndex,
                           Dictionary<String,Object> formatParams,
                           String name)

### getIntParamString

    public String getIntParamString(RecordFormatter rf,
                                    int fieldIndex,
                                    Dictionary<String,Object> formatParams,
                                    String name)

### getDefaultValueFormat

    public String getDefaultValueFormat(RecordFormatter rf,
                                        int fieldIndex,
                                        Dictionary<String,Object> formatParams)

  Gets the formatted default value, used if real value is null. Returns blank if not set.

### getEmptyValueFormat

    public String getEmptyValueFormat(RecordFormatter rf,
                                      int fieldIndex,
                                      Dictionary<String,Object> formatParams)

  Gets the formatted empty value, used if real value is empty. Returns blank if not set.

### resetValueFormat

    public String resetValueFormat(RecordFormatter rf,
                                   int fieldIndex,
                                   String s,
                                   Dictionary<String,Object> formatParams)

  Chooses between the real (formatted) value and possible replacements (default, empty).

### equals

    public boolean equals(String s1,
                          String s2)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Docs generated on 2009-02-25 14:20