org.barracudamvc.core.forms
Class FormType

java.lang.Object
  extended by org.barracudamvc.core.forms.FormType

public abstract class FormType
extends Object

This class defines all valid FormTypes. Currently we support:

Since:
1.0
Version:
%I%, %G%
Author:
Chris Webb , Diez Roggisch , Iman L. Crawford , Christian Cryder , Jacob Kjome

Field Summary
static FormType BIG_DECIMAL
           
static FormType BOOLEAN
           
static FormType DATE
           
static Locale DEFAULT_LOCALE
           
static FormType DOUBLE
           
static FormType FLOAT
           
static FormType INTEGER
           
static FormType LONG
           
static FormType SHORT
           
static FormType STRING
           
static FormType TIME
          Time type definition
static FormType TIMESTAMP
           
 
Constructor Summary
protected FormType()
          Protected constructor to prevent external instantiation.
 
Method Summary
abstract  Class getFormClass()
          Returns the class associated with this particular form type.
abstract  Object[] getTypeArray(int size)
          create an array of the FormType's type - if heterogenous types are returned, an array of Object will be returned.
 Object parse(String origVal)
          Parses an object based on the specific form type.
abstract  Object parse(String origVal, Locale loc)
          Parses an object based on the specific form type.
 String toString()
          Returns a string representation of this particular formt type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LOCALE

public static final Locale DEFAULT_LOCALE

STRING

public static FormType STRING

BOOLEAN

public static FormType BOOLEAN

INTEGER

public static FormType INTEGER

LONG

public static FormType LONG

SHORT

public static FormType SHORT

DOUBLE

public static FormType DOUBLE

FLOAT

public static FormType FLOAT

BIG_DECIMAL

public static FormType BIG_DECIMAL

DATE

public static FormType DATE

TIMESTAMP

public static FormType TIMESTAMP

TIME

public static FormType TIME
Time type definition

Since:
saw_061203_2
Constructor Detail

FormType

protected FormType()
Protected constructor to prevent external instantiation. Cannot be private because we would be unable to call the constructor from a sub-class.

Method Detail

getFormClass

public abstract Class getFormClass()
Returns the class associated with this particular form type.


parse

public Object parse(String origVal)
             throws ParseException
Parses an object based on the specific form type.

Throws:
ParseException

parse

public abstract Object parse(String origVal,
                             Locale loc)
                      throws ParseException
Parses an object based on the specific form type.

Throws:
ParseException

getTypeArray

public abstract Object[] getTypeArray(int size)
create an array of the FormType's type - if heterogenous types are returned, an array of Object will be returned.


toString

public String toString()
Returns a string representation of this particular formt type.

Overrides:
toString in class Object


Copyright © 2006 BarracudaMVC.org All Rights Reserved.