Class DateContext
- All Implemented Interfaces:
TypeContext<Date>
This
TypeContext deals with the old Date. There is another implementation that
tries to deal with the newer date time API – TemporalContext.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DatePartprivate static final DateStyleprivate final DatePartprivate final DateStyleFields inherited from class FormatContext
NBSP -
Constructor Summary
ConstructorsConstructorDescriptionDateContext(DatePart part) DateContext(DatePart part, DateStyle style, Locale locale) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureFormat(Format format, Object object) Will force the object to conform to the context's specification.getPart()getStyle()getUnit()protected StringhandleFormatException(Format format, Object object) protected DatehandleParseException(Format format, String string) static FormatwithFormat(DatePart part, DateStyle style, Locale locale) Methods inherited from class FormatContext
format, format, getFormat, isConfigured, parse, withFormat
-
Field Details
-
DEFAULT_PART
-
DEFAULT_STYLE
-
myPart
-
myStyle
-
-
Constructor Details
-
DateContext
public DateContext() -
DateContext
-
DateContext
-
-
Method Details
-
toFormat
-
enforce
Description copied from interface:TypeContextWill force the object to conform to the context's specification. The default implementation formats aStringand then parses that back to an object (of the original type). -
getPart
-
getStyle
-
getUnit
-
withFormat
-
configureFormat
- Specified by:
configureFormatin classFormatContext<Date>
-
handleFormatException
- Specified by:
handleFormatExceptionin classFormatContext<Date>
-
handleParseException
- Specified by:
handleParseExceptionin classFormatContext<Date>
-