|
JClass 4.5.0 API Documentation |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.field.validate.AbstractValidator | +--com.klg.jclass.field.validate.JCStringValidator | +--com.klg.jclass.field.validate.JCDateTimeValidator
The JCDateTimeValidator
is used to validate calendar objects.
Inner Class Summary | |
protected class |
JCDateTimeValidator.DateTimeChooser
|
Field Summary | |
protected com.klg.jclass.field.validate.JCDateTimeValidator.WorkingCalendar |
cal
|
protected Vector |
compiled_edit_formats
|
protected com.klg.jclass.field.validate.DateFormat |
compiled_format
|
protected String |
date_format
|
protected int |
default_detail
|
protected Object |
defaultValue
|
protected Vector |
edit_formats
|
static int |
FULL
Detail level of the default format for date/time validators. |
protected int |
increment_field
|
static int |
LONG
Detail level of the default format for date/time validators. |
protected boolean |
mask_input
|
static int |
MEDIUM
Detail level of the default format for date/time validators. |
protected int |
millenium_threshold
|
protected String |
original_format
|
static int |
SHORT
Detail level of the default format for date/time validators. |
protected int |
spin_policy
|
protected Class[] |
supportedClasses
|
protected DateFormatSymbols |
symbols
|
protected TimeZone |
tz
|
Fields inherited from class com.klg.jclass.field.validate.JCStringValidator |
compiled_mask_ch,
compiled_mask_sym,
defaultValue,
mask,
mask_chars,
mask_length,
num_editable_pos,
num_mask_match,
place_holder_chars |
Fields inherited from class com.klg.jclass.field.validate.AbstractValidator |
abstractInitializing,
allow_null,
AS_IS,
case_policy,
increment,
invalid_chars,
li,
locale,
LOWERCASE,
match_picklist,
max,
min,
NOT_FOUND,
picklist,
SPIN_FIELD,
spin_policy,
SPIN_SUBFIELD,
SPIN_WRAP,
supportedClasses,
UPPERCASE,
valid_chars |
Constructor Summary | |
JCDateTimeValidator()
Creates a JCDateTimeValidator. |
|
JCDateTimeValidator(Locale locale,
String format,
String place_holder_chars,
String[] edit_formats,
boolean mask_input,
int default_detail,
boolean allow_null,
Object default_value)
Creates a JCDateTimeValidator with the values specified. |
|
JCDateTimeValidator(Locale locale,
String format,
String place_holder_chars,
String[] edit_formats,
boolean mask_input,
int default_detail,
boolean allow_null,
Object default_value,
int millenniumThreshold)
Creates a JCDateTimeValidator with the values specified. |
Method Summary | |
void |
addEditFormat(String edit_format)
Adds the specified format to the edit format list. |
protected Object |
addIncrement(Object current)
|
Object |
convertFromSupported(Object from,
Class class_type)
Converts the supported type to the type supported by the validator. |
Object |
convertToSupported(Object obj)
Converts the specified type (if possible) to the type supported by the validator. |
Object |
copyValue(Object value)
Creates a new instance of the object with the same value. |
PopupFieldEditor |
createPopupComponent()
Returns the popup component for this validator. |
static int |
dayOfMonthOfYear(int year,
int day_of_year)
Calculates the month, day_of_month, given year and day_of_year; returns day. |
static int |
dayOfWeek(int year,
int month,
int day)
Returns the 1 based day of week. |
static int |
dayOfYear(int year,
int month,
int day)
Calculates the day of year from month, day, and year. |
static int |
daysInMonth(int month,
int year)
Calculates the number of days in a given month. |
static int |
daysInYear(int year)
Returns how many days in a year. |
String |
format(Object obj)
Generates a String representation of the given object. |
int |
getDefaultDetail()
Returns the detail level of the default format. |
String[] |
getDefaultEditFormats()
Sets/restores the default EditFormats for the validator. |
String[] |
getDefaultEditFormats(Locale l)
Gets the default EditFormats for the validator. |
String |
getDefaultFormat()
Gets the default Mask for the validator. |
String |
getDefaultFormat(Locale l)
Gets the default Mask for the validator given a specific locale. |
Object |
getDefaultValue()
Returns the default value for the field. |
String[] |
getEditFormats()
Returns the list of editFormats used to attempt to parse user input. |
String |
getFormat()
Returns the mask currently being used to display the date/time values. |
int |
getIncrement()
Gets the number by which to spin the values in numeric spin fields. |
int |
getIncrementField()
Returns the incrementField operated on by the currently set increment value. |
boolean |
getMaskInput()
Gets the flag that controls whether or not to force the user to input data that exactly matches the format. |
int |
getMilleniumThreshold()
Returns millenium threshold. |
protected Class[] |
getSupportedClasses()
Creates a list of classes supported by the validator. |
TimeZone |
getTimeZone()
Gets the time zone to be used by the validator. |
void |
inferSubField(int selection_start,
int selection_end)
Infers the sub-field in the currently selected region that will be selected. |
boolean |
inRange(Object value)
Checks if the value is in the valid range. |
protected boolean |
internal_validate(com.klg.jclass.field.validate.JCDateTimeValidator.WorkingCalendar cal)
|
static boolean |
isLeap(int year)
Checks whether the given year is a leap year. |
static int |
monthOfYear(int year,
int day_of_year)
Calculates the month, given the year and day_of_year; returns month. |
Object |
parse(Class class_type,
String text)
Validates the specified text, and returns a new Object if successful. |
void |
setDefaultDetail(int detail)
Specifies the detail level of the default format. |
void |
setDefaultValue(Object default_value)
Sets the default value for the field. |
void |
setEditFormats(String[] formats)
Sets the list of editFormats used in the attempt to parse user input. |
void |
setFormat(String format)
Sets the format to use to display the date/time values. |
void |
setIncrement(int increment)
Sets the number by which to spin the values in numeric spin fields. |
void |
setIncrementField(int field)
Sets the value of the incrementField operated on by the increment. |
void |
setLocale(Locale locale)
Sets the default locale. |
void |
setMaskInput(boolean mask_input)
Sets the flag that controls whether or not to force the user to input data that exactly matches the format. |
void |
setMilleniumThreshold(int threshold)
Sets the MilleniumThreshold, which is a value used for interpreting 2 digit years. |
void |
setTimeZone(TimeZone zone)
Sets the time zone to be used by the validator. |
protected Object |
subtractIncrement(Object current)
|
boolean |
validate(Object obj)
Validates the given object. |
static int |
weekOfMonth(int year,
int month,
int day)
Returns the 1 based week of month. |
static int |
weekOfYear(int year,
int day_of_year)
Returns the 1 based week of year. |
Methods inherited from class com.klg.jclass.field.validate.JCStringValidator |
changeText,
compileMask,
formatForEdit,
getFirstValidCursorPosition,
getMask,
getMaskChars,
getNextCursorPosition,
getNumMaskMatch,
getParsedMask,
getPlaceHolderChars,
hasEditFormat,
internalValidate,
isValidChar,
setCursor,
setMask,
setMaskChars,
setNumMaskMatch,
setPlaceHolderChars |
Methods inherited from class com.klg.jclass.field.validate.AbstractValidator |
calculateSpinability,
checkValidInvalid,
compareValues,
convertCase,
getAllowNull,
getCasePolicy,
getInvalidChars,
getItem,
getLocale,
getMatchPickList,
getMax,
getMin,
getNextValue,
getPickList,
getPickListIndex,
getPreviousValue,
getSpinPolicy,
getValidChars,
isClassSupported,
isValidChar,
setAllowNull,
setCasePolicy,
setInvalidChars,
setMatchPickList,
setMax,
setMin,
setPickList,
setRange,
setSpinPolicy,
setValidChars,
spinDown,
spinUp |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int FULL
public static final int LONG
public static final int MEDIUM
public static final int SHORT
protected Class[] supportedClasses
protected boolean mask_input
protected String date_format
protected com.klg.jclass.field.validate.DateFormat compiled_format
protected TimeZone tz
protected com.klg.jclass.field.validate.JCDateTimeValidator.WorkingCalendar cal
protected DateFormatSymbols symbols
protected Vector edit_formats
protected Vector compiled_edit_formats
protected int increment_field
protected int millenium_threshold
protected int default_detail
protected int spin_policy
protected String original_format
protected Object defaultValue
Constructor Detail |
public JCDateTimeValidator()
public JCDateTimeValidator(Locale locale, String format, String place_holder_chars, String[] edit_formats, boolean mask_input, int default_detail, boolean allow_null, Object default_value)
public JCDateTimeValidator(Locale locale, String format, String place_holder_chars, String[] edit_formats, boolean mask_input, int default_detail, boolean allow_null, Object default_value, int millenniumThreshold)
Method Detail |
protected Class[] getSupportedClasses()
public String getDefaultFormat(Locale l)
public String getDefaultFormat()
public int getDefaultDetail()
setDefaultDetail(int)
public void setDefaultDetail(int detail)
getDefaultDetail()
public String[] getDefaultEditFormats(Locale l)
public String[] getDefaultEditFormats()
public String[] getEditFormats()
setEditFormats(java.lang.String[])
public void setEditFormats(String[] formats)
getDefaultEditFormats(java.util.Locale)
,
getEditFormats()
,
addEditFormat(java.lang.String)
public void inferSubField(int selection_start, int selection_end)
public int getIncrement()
public void setIncrement(int increment)
public int getIncrementField()
Calendar.set(int, int)
public void setIncrementField(int field)
Calendar.set(int, int)
public int getMilleniumThreshold()
setMilleniumThreshold(int)
public void setMilleniumThreshold(int threshold)
threshold
- valid values are 0 through 100protected Object addIncrement(Object current)
protected Object subtractIncrement(Object current)
public void setLocale(Locale locale)
AbstractValidator.setLocale(java.util.Locale)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone zone)
public boolean inRange(Object value)
public void addEditFormat(String edit_format)
setEditFormats(java.lang.String[])
public boolean getMaskInput()
getFormat()
public void setMaskInput(boolean mask_input)
setFormat(java.lang.String)
public String getFormat()
setFormat(java.lang.String)
public void setFormat(String format)
Symbol(s) | Meaning |
---|---|
y | Year within the current century (1 or 2 digits) |
yy | Year within the current century (2 digits) |
yyyy | Year including century (4 digits) |
M | numeric month of year (1 or 2 digits) |
MM | numeric month of year (2 digits) |
MMM | abbreviated month name |
MMMM | full month name |
EEEE | Day of the Week (full name) |
EE | Day of the Week (abbreviated) |
d | numeric day of month (1 or 2 digits) |
dd | numeric day of month (2 digits) |
h | hour of day (1-12) (1 or 2 digits) |
hh | hour of day (1-12) (2 digits) |
H | hour of day (0-23) (1 or 2 digits) |
HH | hour of day (0-23) (2 digits) |
m | minute (1 or 2 digits) |
mm | minute (2 digits) |
s | second (1 or 2 digits) |
ss | second (2 digits) |
a | AM/PM representation |
p | AM/PM representation |
z | time zone abbreviation |
zz | time zone abbreviation |
zzzz | time zone (full name) |
D | Day in year (1, 2, or 3 digits) |
DDD | Day in year (3 digits) |
\\ | Next character is a literal |
public Object parse(Class class_type, String text)
c
- sets which class object the text should be converted totext
- text to be converted to an objectpublic Object copyValue(Object value)
public boolean validate(Object obj)
obj
- object to be checkedprotected boolean internal_validate(com.klg.jclass.field.validate.JCDateTimeValidator.WorkingCalendar cal)
public String format(Object obj)
public static boolean isLeap(int year)
year
- The year to check. i.e. "1997"public static int dayOfYear(int year, int month, int day)
year
- The year i.e. 1997month
- The month (0 to 11)day
- The day of the month (0 to 31)public static int daysInMonth(int month, int year)
year
- The year to use. i.e. "1997"month
- The month (0 to 11)public static int monthOfYear(int year, int day_of_year)
year
- The year to use. i.e. "1997"day_of_year
- The day of the year (1 to 366)public static int dayOfMonthOfYear(int year, int day_of_year)
public static int daysInYear(int year)
public static int dayOfWeek(int year, int month, int day)
public static int weekOfYear(int year, int day_of_year)
public static int weekOfMonth(int year, int month, int day)
public Object convertToSupported(Object obj)
convertFromSupported(java.lang.Object, java.lang.Class)
public Object convertFromSupported(Object from, Class class_type)
convertToSupported(java.lang.Object)
public Object getDefaultValue()
public void setDefaultValue(Object default_value)
public PopupFieldEditor createPopupComponent()
|
Copyright© 1999-2000 KL Group Inc. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |