PropertyConverter
public class TimeConverter extends NumberConverter
TimeFormats
, to avoid creation and
parsing of timeformats every time one is used.Constructor | Description |
---|---|
TimeConverter() |
Modifier and Type | Method | Description |
---|---|---|
Object |
toObject(String pString,
Class pType,
String pFormat) |
Converts the string to a time, using the given format for parsing.
|
String |
toString(Object pObject,
String pFormat) |
Converts the object to a string, using the given format
|
getFormat
public Object toObject(String pString, Class pType, String pFormat) throws ConversionException
toObject
in interface PropertyConverter
toObject
in class NumberConverter
pString
- the string to convert.pType
- the type to convert to. PropertyConverter
implementations may choose to ignore this parameter.pFormat
- the format used for parsing. PropertyConverter
implementations may choose to ignore this parameter. Also,
implementations that require a parser format, should provide a default
format, and allow null
as the format argument.com.twelvemonkeys.util.Time
ConversionException
Time
,
TimeFormat
public String toString(Object pObject, String pFormat) throws ConversionException
toString
in interface PropertyConverter
toString
in class NumberConverter
pObject
- the object to convert.pFormat
- the format used for parsing. PropertyConverter
implementations may choose to ignore this parameter. Also,
implementations that require a parser format, should provide a default
format, and allow null
as the format argument.ConversionException
- if the object is not a subclass of
com.twelvemonkeys.util.Time
Time
,
TimeFormat
Copyright © 2018. All rights reserved.