@ValueSemantics
Collects all the value-type specific customization attributes.
API
@interface ValueSemantics {
public final static int AS_DAY_BEFORE; (1)
String provider() default ""; (2)
int maxTotalDigits() default 65; (3)
int minIntegerDigits() default 1; (4)
int maxFractionalDigits() default 30; (5)
int minFractionalDigits() default 0; (6)
FormatStyle dateFormatStyle() default FormatStyle.MEDIUM; (7)
FormatStyle timeFormatStyle() default FormatStyle.MEDIUM; (8)
TimePrecision timePrecision() default TimePrecision.SECOND; (9)
TimeZoneTranslation timeZoneTranslation() default TimeZoneTranslation.TO_LOCAL_TIMEZONE; (10)
int dateRenderAdjustDays() default 0; (11)
}
1 | AS_DAY_BEFORE
eg. @ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE) |
2 | provider
Allows to select ValueSemanticsProvider (s) by qualifier. |
3 | maxTotalDigits
If associated with a Number , the maximum number of total digits accepted for this number.Can be omitted, if Column#precision() is used.default = 65 |
4 | minIntegerDigits
If associated with a Number , the minimum number of integer digits required for this number.default = 1 |
5 | maxFractionalDigits
If associated with a BigDecimal , the maximum number of fractional digits accepted for this number.Can be omitted, if Column#scale() is used.default = 30 |
6 | minFractionalDigits
If associated with a BigDecimal , the minimum number of fractional digits required for this number.default = 0 |
7 | dateFormatStyle
If associated with a temporal date value, the rendering style of a localized date. |
8 | timeFormatStyle
If associated with a temporal time value, the rendering style of a localized time. |
9 | timePrecision
If associated with a temporal time value, the time of day precision, used for editing a time field in the UI.default = TimePrecision#SECOND |
10 | timeZoneTranslation
If associated with a temporal value, that has time-zone or time-offset information, the rendering mode, as to whether to transform the rendered value to the user’s local/current time-zone or not.default = TimeZoneTranslation#TO_LOCAL_TIMEZONE |
11 | dateRenderAdjustDays
If associated with a date or date-time value, instructs whether the date should be rendered as n days after the actually stored date. For negative n its days before respectively. |
Members
provider
Allows to select ValueSemanticsProvider (s) by qualifier.
maxTotalDigits
If associated with a Number , the maximum number of total digits accepted for this number.Can be omitted, if Column#precision() is used.default = 65
minIntegerDigits
If associated with a Number , the minimum number of integer digits required for this number.default = 1
maxFractionalDigits
If associated with a BigDecimal , the maximum number of fractional digits accepted for this number.Can be omitted, if Column#scale() is used.default = 30
minFractionalDigits
If associated with a BigDecimal , the minimum number of fractional digits required for this number.default = 0
timePrecision
If associated with a temporal time value, the time of day precision, used for editing a time field in the UI.default = TimePrecision#SECOND
timeZoneTranslation
If associated with a temporal value, that has time-zone or time-offset information, the rendering mode, as to whether to transform the rendered value to the user’s local/current time-zone or not.default = TimeZoneTranslation#TO_LOCAL_TIMEZONE
dateRenderAdjustDays
If associated with a date or date-time value, instructs whether the date should be rendered as n days after the actually stored date. For negative n its days before respectively.
This is intended to be used so that an exclusive end date of an interval can be rendered as 1 day before the actual value stored.
For example:
public LocalDate getStartDate() { ... } @ValueSemantics(dateRenderAdjustDays = ValueSemantics.AS_DAY_BEFORE) public LocalDate getEndDate() { ... }
Here, the interval of the [1-may-2013,1-jun-2013) would be rendered as the dates 1-may-2013 for the start date but using 31-may-2013 (the day before) for the end date. What is stored In the domain object, itself, however, the value stored is 1-jun-2013.