org.apache.empire.struts2.jsp.controls
Class TextInputControl
java.lang.Object
org.apache.empire.struts2.jsp.controls.InputControl
org.apache.empire.struts2.jsp.controls.TextInputControl
- Direct Known Subclasses:
- EMailInputControl, HLinkInputControl
public class TextInputControl
- extends InputControl
Method Summary |
protected java.lang.String |
formatValue(InputControl.ValueInfo vi,
boolean appendUnit)
|
protected java.lang.String |
formatValue(java.lang.Object value,
InputControl.ValueInfo vi,
boolean hasError)
Returns the value formated as a string
this is a simple default implementation that does no type-secific formatting
Derived classes may override formatString an provide further formmatting
see TextInputControl for details |
protected java.text.DateFormat |
getDateFormat(DataType dataType,
java.util.Locale locale,
Column column)
|
protected int |
getMaxInputLength(Column col)
|
protected java.text.NumberFormat |
getNumberFormat(DataType dataType,
java.util.Locale locale,
Column column)
|
protected DataType |
getValueType(java.lang.Object value,
DataType desiredType)
|
protected void |
internalRenderText(HtmlWriter writer,
InputControl.ValueInfo vi)
this method renders a record value read only
it is internally called by renderText |
protected java.lang.Object |
parseDate(java.lang.String s,
java.text.DateFormat df)
|
protected java.lang.Object |
parseDecimal(java.lang.String s,
java.text.NumberFormat nf)
|
protected java.lang.Object |
parseInteger(java.lang.String s)
|
protected java.lang.Object |
parseValue(java.lang.String value,
java.util.Locale locale,
Column column)
this function may be overridden to parse and convert the input value
to the data type of the supplied column |
void |
renderInput(HtmlWriter writer,
InputControl.ControlInfo ci)
this method renders a record value for input |
protected java.lang.Object |
validate(java.lang.Object o,
java.util.Locale locale,
Column column,
java.lang.String s)
this function may be overridden to validate a value that has
previously been parsed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FORMAT_UNIT
public static final java.lang.String FORMAT_UNIT
- See Also:
- Constant Field Values
TextInputControl
public TextInputControl()
parseValue
protected java.lang.Object parseValue(java.lang.String value,
java.util.Locale locale,
Column column)
- Description copied from class:
InputControl
- this function may be overridden to parse and convert the input value
to the data type of the supplied column
- Overrides:
parseValue
in class InputControl
- Parameters:
value
- the value string from the request
- Returns:
- the parsed value
validate
protected java.lang.Object validate(java.lang.Object o,
java.util.Locale locale,
Column column,
java.lang.String s)
- Description copied from class:
InputControl
- this function may be overridden to validate a value that has
previously been parsed
- Overrides:
validate
in class InputControl
- Parameters:
o
- the parsed object values
- the unparsed value string. In case of an error this should be forwarded to the error function.
- Returns:
- the parsed value
formatValue
protected java.lang.String formatValue(java.lang.Object value,
InputControl.ValueInfo vi,
boolean hasError)
- Description copied from class:
InputControl
- Returns the value formated as a string
this is a simple default implementation that does no type-secific formatting
Derived classes may override formatString an provide further formmatting
see TextInputControl for details
- Overrides:
formatValue
in class InputControl
- Parameters:
value
- the value to be formattedvi
- Meta-information about the value
- Returns:
- the formatted value
formatValue
protected java.lang.String formatValue(InputControl.ValueInfo vi,
boolean appendUnit)
internalRenderText
protected void internalRenderText(HtmlWriter writer,
InputControl.ValueInfo vi)
- Description copied from class:
InputControl
- this method renders a record value read only
it is internally called by renderText
- Overrides:
internalRenderText
in class InputControl
- Parameters:
writer
- the HtmlWriter for html write-outvi
- Object holding the value and meta-information about the value
renderInput
public void renderInput(HtmlWriter writer,
InputControl.ControlInfo ci)
- Description copied from class:
InputControl
- this method renders a record value for input
- Specified by:
renderInput
in class InputControl
- Parameters:
writer
- the HtmlWriter for html write-outci
- Object holding the value and meta-information about the value and the control
getMaxInputLength
protected int getMaxInputLength(Column col)
getValueType
protected DataType getValueType(java.lang.Object value,
DataType desiredType)
getNumberFormat
protected java.text.NumberFormat getNumberFormat(DataType dataType,
java.util.Locale locale,
Column column)
getDateFormat
protected java.text.DateFormat getDateFormat(DataType dataType,
java.util.Locale locale,
Column column)
parseInteger
protected java.lang.Object parseInteger(java.lang.String s)
parseDecimal
protected java.lang.Object parseDecimal(java.lang.String s,
java.text.NumberFormat nf)
parseDate
protected java.lang.Object parseDate(java.lang.String s,
java.text.DateFormat df)
Copyright © 2008-2009 Apache Software Foundation. All Rights Reserved.