class CalendarReflection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method |
GET_WEEK_YEAR |
private static java.lang.reflect.Method |
IS_WEEK_DATE_SUPPORTED |
Constructor and Description |
---|
CalendarReflection() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.reflect.Method |
getCalendarMethod(java.lang.String methodName,
java.lang.Class<?>... argTypes) |
static int |
getWeekYear(java.util.Calendar calendar)
Invoke getWeekYear() method of calendar instance.
|
(package private) static boolean |
isWeekDateSupported(java.util.Calendar calendar)
Does this calendar instance support week date?
|
private static final java.lang.reflect.Method IS_WEEK_DATE_SUPPORTED
private static final java.lang.reflect.Method GET_WEEK_YEAR
private static java.lang.reflect.Method getCalendarMethod(java.lang.String methodName, java.lang.Class<?>... argTypes)
static boolean isWeekDateSupported(java.util.Calendar calendar)
calendar
- The calendar instance.public static int getWeekYear(java.util.Calendar calendar)
If runtime is 1.7 or better and calendar instance support week year, return the value from invocation of getWeekYear().
If runtime is less than 1.7, and calendar is an instance of GregorianCalendar, return an approximation of the week year. (Approximation is good for all years after the Julian to Gregorian cutover.)
Otherwise, return the calendar instance year value.
calendar
- The calendar instance.