public class TimeZonePropertyType extends PropertyType<TimeZone>
java.util.TimeZone. | Constructor Example | Comments | ||
|---|---|---|---|
Property<TimeZone> A_PROPERTY = |
No default value. | ||
Property<TimeZone> A_PROPERTY = |
Default value is GMT timezone. | ||
| Type of value(s) | Examples | Result | Comments |
| Valid | Europe/Copenhagen | TimeZone.getTimeZone("Europe/Copenhagen") | Validate successfully. |
| Valid | Europe/Copenhagen | TimeZone.getTimeZone("Europe/Copenhagen") | Validate successfully. |
| Valid | America/Los_Angeles | TimeZone.getTimeZone("America/Los_Angeles") | Validate successfully. |
| Invalid | cow | null |
Validate will throw an exception. The resulting value is null. |
| Invalid | horse | null |
|
| Invalid | «empty string» | null |
|
| Invalid | «empty string after trim» | null |
|
| Invalid | null |
defaultValue OR null |
Validate will throw an exception. Return default value if set, otherwise null. |
TimeZone,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static TimeZone |
DEFAULT_TIMEZONE |
static String |
DEFAULT_TIMEZONE_ID |
static String |
TYPE
The type name string constant of TimeZonePropertyType
|
| Constructor and Description |
|---|
TimeZonePropertyType()
Returns TimeZonePropertyType where the default value is
null. |
TimeZonePropertyType(TimeZone defaultValue)
Returns TimeZonePropertyType with default value.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getRestrictions()
Gets a detailed description of the PropertyType with any constraints that might influence the validation.
|
String |
toString(String propertyName,
TimeZone t)
Converts a typed to the string representation.
|
TimeZone |
validateValue(String propertyName,
String value)
Converts the string representation of to a typed value.
|
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toType, validate, validateConstraints, validateNullTypepublic static final String TYPE
public static final String DEFAULT_TIMEZONE_ID
public static final TimeZone DEFAULT_TIMEZONE
public TimeZonePropertyType()
null.public TimeZonePropertyType(TimeZone defaultValue)
defaultValue - default value returned if property value is undefined.public List<String> getRestrictions()
PropertyTypegetRestrictions in class PropertyType<TimeZone>public String toString(String propertyName, TimeZone t) throws PropertyException
PropertyTypetoString in class PropertyType<TimeZone>propertyName - the name of the property used for logging purposes.t - the type T.PropertyException - if conversion failed in validation.PropertyType.validate(String, String)public TimeZone validateValue(String propertyName, String value) throws PropertyException
PropertyTypevalidateValue in class PropertyType<TimeZone>propertyName - the name of the property used for logging purposes. To uniquely identify the Property with validation issues.value - the string representation of the propertyPropertyException - if the conversion failed.