de.espirit.firstspirit.forms
Interface FormField<T>

Type Parameters:
T - Type of value, see FormField.get(), FormField.getType(), and FormField.validate(Object).

public interface FormField<T>

Language specific property container of a form's field.

Since:
4.2.404

Method Summary
 T get()
          Provides the current value of the field.
 String getName()
          Returns the name of the field.
 Class<T> getType()
          Get the type of the field's value.
 boolean isDefault()
          Indicates that the value is set to default.
 boolean isEmpty()
          Indicates that the value of this field is empty.
 boolean isSet()
          Indicates that the value of this field is set.
 void set(Object value)
          Set the value of this field.
 void setToDefault()
          Set the field to its default value.
 void validate(T value)
          Validate the given value.
 

Method Detail

getName

String getName()
Returns the name of the field.

Returns:
The field's name.
Since:
4.2.404

getType

Class<T> getType()
Get the type of the field's value.

Returns:
The field's type.
Since:
4.2.404

isSet

boolean isSet()
Indicates that the value of this field is set.

Returns:
true, iff field is set.
Since:
4.2.404

isEmpty

boolean isEmpty()
Indicates that the value of this field is empty.

Returns:
true, iff field evaluates to empty.
Since:
4.2.404

isDefault

boolean isDefault()
Indicates that the value is set to default.

Returns:
true, iff field is set to default.
Since:
4.2.404

get

@Nullable
T get()
Provides the current value of the field.

Returns:
The field's value.
Since:
4.2.404

set

void set(Object value)
         throws InappropriateValueException,
                UnsupportedOperationException
Set the value of this field.

Parameters:
value - The value to be set.
Throws:
InappropriateValueException - If the given value is not appropriate for this field.
UnsupportedOperationException - If the field does not support setting its value.
Since:
4.2.404

setToDefault

void setToDefault()
                  throws UnsupportedOperationException
Set the field to its default value.

Throws:
UnsupportedOperationException - If the field does not support setting its value.
Since:
4.2.404

validate

void validate(T value)
              throws InappropriateValueException
Validate the given value.

Parameters:
value - The value to validate.
Throws:
InappropriateValueException - If the value is not valid.
Since:
4.2.404


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480