public abstract class AbstractDateInput extends ParseAbstractInput<java.util.Date> implements BoundedDateInput, FormatHintInput
Inputs that parse to java Date objects.
sub-classes may be constrained to generate values that are constrained to day/hour/min boundaries.
This class uses a series of DateFormats applied in turn so as to support multiple formats
the first format should be the one compatible with the format defined in the standard for the corresponding Html5 input.
However getHintIndex() specifies the format that should be suggested to a user when
defaulting to a text input| Modifier and Type | Field and Description |
|---|---|
static java.util.Date |
DEFAULT_MAX_DATE |
validatorsUSE_DATE_INPUT| Constructor and Description |
|---|
AbstractDateInput() |
AbstractDateInput(long resolution) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
convert(java.lang.Object v)
Perform any supported type conversions to to generate a value of the
target type
|
java.lang.String |
formatRange(java.util.Date n)
format step/range values as used by the input into compatible to the way they are
presented.
|
protected java.text.DateFormat |
getDateFormat(java.lang.String format) |
java.lang.String |
getFormatHint() |
abstract java.lang.String[] |
getFormats() |
protected int |
getHintIndex()
Which of the available formats in
getFormats()
should be used as the hint text. |
java.util.Date |
getMax()
Maximum valid value
null value implies no maximum
|
java.util.Date |
getMin()
Minimum valid value.
|
java.lang.String |
getString(java.util.Date date)
simple format of a date
|
java.lang.String |
getType()
get the type tag to emit for
the corresponding html5 type.
|
java.util.Date |
parseValue(java.lang.String v)
Parse a String into the correct type for this input.
|
java.util.Date |
setMax(java.util.Date val)
set the maximum value
|
java.util.Date |
setMin(java.util.Date val)
Set the minimum value
|
accept, getBoxWidth, getMaxResultLength, getSingle, setBoxWidth, setMaxResultLength, setSinglegetValue, setKey, setValueaddValidator, getKey, getPrettyString, getString, removeValidator, validate, validateInnerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInstance, getInstancegetString, parseaccept, addValidator, getKey, getPrettyString, getValue, isEmpty, removeValidator, setKey, setValue, validatepublic AbstractDateInput()
public AbstractDateInput(long resolution)
protected java.text.DateFormat getDateFormat(java.lang.String format)
public abstract java.lang.String[] getFormats()
public java.util.Date parseValue(java.lang.String v)
throws ParseException
ParseInputInput.getString(Object) method.parseValue in interface ParseInput<java.util.Date>v - ParseExceptionpublic java.lang.String getString(java.util.Date date)
getString in interface Input<java.util.Date>getString in class BaseInput<java.util.Date>date - Date to formatParseInputprotected int getHintIndex()
getFormats()
should be used as the hint text.public java.lang.String getFormatHint()
getFormatHint in interface FormatHintInputpublic java.util.Date convert(java.lang.Object v)
throws TypeError
Inputpublic java.lang.String getType()
HTML5InputgetType in interface HTML5Inputpublic java.util.Date getMin()
BoundedInputgetMin in interface BoundedInput<java.util.Date>public java.util.Date getMax()
BoundedInputgetMax in interface BoundedInput<java.util.Date>public java.util.Date setMin(java.util.Date val)
BoundedInputsetMin in interface BoundedInput<java.util.Date>public java.util.Date setMax(java.util.Date val)
BoundedInputsetMax in interface BoundedInput<java.util.Date>public java.lang.String formatRange(java.util.Date n)
BoundedInputformatRange in interface BoundedInput<java.util.Date>