net.coderazzi.filters.parser
Class Types

java.lang.Object
  extended by net.coderazzi.filters.parser.Types

public class Types
extends Object

Default Types.StringTypeFormat instances, supporting all the basic java types
It also includes support for Comparator of Date instances.
The default IFilterTextParser is automatically configured to use these Types.StringTypeFormat instances, when created by the TableFilterHeader.
Users can add any Types.StringTypeFormat or Comparator definitions, as the class is used as a singleton.

Author:
Luis M Pena - lu@coderazzi.net

Nested Class Summary
static class Types.BooleanTypeFormat
          Factory to build boolean objects
static class Types.ByteTypeFormat
          Factory to build byte objects
static class Types.CharacterTypeFormat
          Factory to build character objects
static class Types.DoubleTypeFormat
          Factory to build double objects
static class Types.FloatTypeFormat
          Factory to build float objects
static class Types.IntegerTypeFormat
          Factory to build integer objects
static class Types.LongTypeFormat
          Factory to build long objects
static class Types.ShortTypeFormat
          Factory to build short objects
static class Types.StringTypeFormat
          Factory to build string objects
 
Constructor Summary
Types()
           
 
Method Summary
static void configure(IFilterTextParser textParser)
          Configures the passed IFilterTextParser to use the given Comparator and Types.StringTypeFormat definitions
static Comparator<?> getComparator(Class<?> c)
          Returns the Comparator for the given class
static Format getFormat(Class<?> c)
          Returns the Types.StringTypeFormat for the given class
static void setComparator(Class<?> c, Comparator<?> format)
          Defines the Comparator for the given class
static void setFormat(Class<?> c, Format format)
          Defines the Types.StringTypeFormat for the given class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Types

public Types()
Method Detail

getFormat

public static Format getFormat(Class<?> c)
Returns the Types.StringTypeFormat for the given class


setFormat

public static void setFormat(Class<?> c,
                             Format format)
Defines the Types.StringTypeFormat for the given class


getComparator

public static Comparator<?> getComparator(Class<?> c)
Returns the Comparator for the given class


setComparator

public static void setComparator(Class<?> c,
                                 Comparator<?> format)
Defines the Comparator for the given class


configure

public static void configure(IFilterTextParser textParser)
Configures the passed IFilterTextParser to use the given Comparator and Types.StringTypeFormat definitions