public class DateTimeDatatype extends AbstractDatatype<Calendar>
Datatype.Builtin, Datatype.Default
Modifier and Type | Field and Description |
---|---|
protected String[] |
readFormats |
protected String |
writeFormat |
Constructor and Description |
---|
DateTimeDatatype(String[] readFormats,
String writeFormat) |
Modifier and Type | Method and Description |
---|---|
protected Date |
getDateValue(String value,
String[] formats) |
String |
getString(Calendar value)
Transforms a value supported by this datatype into a string representation.
|
protected TimeZone |
getTimeZone() |
protected String |
normalizeTimeZone(String value) |
Calendar |
valueOf(String s)
Transforms a string representation into a value of the supported type.
|
getBuiltin, getDisplayString, getValueType, isHandlingJavaType, isValid, setBuiltin, toString
public Calendar valueOf(String s) throws InvalidValueException
Datatype
valueOf
in interface Datatype<Calendar>
valueOf
in class AbstractDatatype<Calendar>
s
- The string representation of a value.null
if the string was null
or empty.InvalidValueException
- If the string couldn't be parsed.public String getString(Calendar value) throws InvalidValueException
Datatype
This method calls Datatype.isValid(Object)
before converting the value, it throws
an exception if validation fails.
getString
in interface Datatype<Calendar>
getString
in class AbstractDatatype<Calendar>
value
- The value to transform.null
.InvalidValueException
protected TimeZone getTimeZone()
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.