org.jreform.internal
Class InputImpl<T>

java.lang.Object
  extended by org.jreform.internal.AbstractInputControl<T>
      extended by org.jreform.internal.InputImpl<T>
All Implemented Interfaces:
Input<T>, InputControl<T>, MessageOnError
Direct Known Subclasses:
CheckboxImpl, RadioImpl, SelectImpl

 class InputImpl<T>
extends AbstractInputControl<T>
implements Input<T>

Author:
armandino (at) gmail.com

Field Summary
private  T value
           
private  String valueAttribute
           
 
Constructor Summary
InputImpl(InputDataType<T> type, String name, Criterion<T>... criteria)
           
 
Method Summary
 String getStringValue()
          Returns the string representation of the value as returned by getValue().toString() or an empty string if the value is null.
 T getValue()
          Returns this input's value.
 String getValueAttribute()
          Returns the value attribute or an empty string if it's null.
 void setValue(T value)
          Sets this input's value.
 void setValueAttribute(String input)
          Sets this input's value attribute.
 String toString()
           
(package private)  boolean validate(javax.servlet.http.HttpServletRequest req)
          Validates this input's value attribute(s).
 
Methods inherited from class org.jreform.internal.AbstractInputControl
getCriteria, getInputName, getOnError, getType, isGroupInput, isRequired, isValid, setGroupInput, setOnError, setRequired, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jreform.InputControl
getInputName, getType, isRequired, isValid
 
Methods inherited from interface org.jreform.MessageOnError
getOnError, setOnError
 

Field Detail

value

private T value

valueAttribute

private String valueAttribute
Constructor Detail

InputImpl

InputImpl(InputDataType<T> type,
          String name,
          Criterion<T>... criteria)
Method Detail

getValue

public final T getValue()
Description copied from interface: Input
Returns this input's value.

Specified by:
getValue in interface Input<T>

setValue

public final void setValue(T value)
Description copied from interface: Input
Sets this input's value.

Specified by:
setValue in interface Input<T>

getValueAttribute

public final String getValueAttribute()
Returns the value attribute or an empty string if it's null.

Specified by:
getValueAttribute in interface Input<T>

setValueAttribute

public final void setValueAttribute(String input)
Description copied from interface: Input
Sets this input's value attribute.

Specified by:
setValueAttribute in interface Input<T>

getStringValue

public final String getStringValue()
Returns the string representation of the value as returned by getValue().toString() or an empty string if the value is null.

Specified by:
getStringValue in interface InputControl<T>

validate

boolean validate(javax.servlet.http.HttpServletRequest req)
Description copied from class: AbstractInputControl
Validates this input's value attribute(s).

Specified by:
validate in class AbstractInputControl<T>

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2007-2008 jReform