|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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.
Nested Class Summary | |
class |
JCDateTimeValidator.DateChooser
|
class |
JCDateTimeValidator.DateTimeChooser
|
class |
JCDateTimeValidator.DateTimePopup
|
class |
JCDateTimeValidator.TimeSpin
|
protected class |
JCDateTimeValidator.WorkingCalendar
|
Field Summary | |
protected 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 String |
default_format
|
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, 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_SUBFIELD, SPIN_WRAP, UPPERCASE, valid_chars |
Fields inherited from interface com.klg.jclass.field.validate.JCValidator |
DOWN, UP |
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. |
com.klg.jclass.field.validate.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(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, getLastValidInputCharPosition, 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 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 String default_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)
JCDateTimeValidator
with the values specified.
allow_null
- default_detail
- default_value
- edit_formats
- format
- locale
- mask_input
- place_holder_chars
- 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)
JCDateTimeValidator
with the values specified.
allow_null
- default_detail
- default_value
- edit_formats
- format
- locale
- mask_input
- millenniumThreshold
- place_holder_chars
- Method Detail |
protected Class[] getSupportedClasses()
getSupportedClasses
in class JCStringValidator
public String getDefaultFormat(Locale l)
Mask
for the validator given a specific locale.
l
-
public String getDefaultFormat()
Mask
for the validator.
public int getDefaultDetail()
setDefaultDetail(int)
public void setDefaultDetail(int detail)
FULL
, LONG
, MEDIUM
(default), or SHORT
.
detail
- getDefaultDetail()
public String[] getDefaultEditFormats(Locale l)
EditFormats
for the validator.
l
-
public String[] getDefaultEditFormats()
EditFormats
for the validator.
public String[] getEditFormats()
editFormats
used to attempt to parse user input.
editFormats
setEditFormats(java.lang.String[])
public void setEditFormats(String[] formats)
editFormats
used in the attempt to parse user input.
formats
- getDefaultEditFormats(java.util.Locale)
,
getEditFormats()
,
addEditFormat(java.lang.String)
public void inferSubField(int selection_start, int selection_end)
inferSubField
in interface JCValidator
inferSubField
in class AbstractValidator
selection_start
- selection_end
- public int getIncrement()
public void setIncrement(int increment)
increment
- public int getIncrementField()
incrementField
operated on by the currently set increment value.
incrementField
operated on by the currently set increment valueCalendar.set(int, int)
public void setIncrementField(int field)
incrementField
operated on by the increment.
field
- Calendar.set(int, int)
public int getMilleniumThreshold()
setMilleniumThreshold(int)
public void setMilleniumThreshold(int threshold)
MilleniumThreshold
, which is a value used for interpreting 2 digit
years. Any 2 digit date less than the threshold is considered to be after the
year 2000, while any value greater than or equal to the threshold is
considered to be after the year 1900. The default is 69 so that,
for example, '96 --> 1996 and '10 == 2010.
threshold
- valid values are 0 through 100protected Object addIncrement(Object current)
addIncrement
in class JCStringValidator
protected Object subtractIncrement(Object current)
subtractIncrement
in class JCStringValidator
public void setLocale(Locale locale)
setLocale
in class AbstractValidator
locale
- AbstractValidator.setLocale(java.util.Locale)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone zone)
zone
- public boolean inRange(Object value)
true
for the
DateTime
validator. This method is used internally. You should
not have to call it.
inRange
in class JCStringValidator
value
-
public void addEditFormat(String edit_format)
edit_format
- setEditFormats(java.lang.String[])
public boolean getMaskInput()
getFormat()
public void setMaskInput(boolean mask_input)
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 |
format
- public Object parse(Class class_type, String text)
Object
if successful.
parse
in interface JCValidator
parse
in class JCStringValidator
class_type
- sets which class object the text should be converted totext
- text to be converted to an object
public Object copyValue(Object value)
clone()
method is protected in the Object
class,
we cannot actually clone a generic object without knowing what it is; therefore
the validator must provide this routine to do the copying for JClass Field.
copyValue
in interface JCValidator
copyValue
in class JCStringValidator
value
-
public boolean validate(Object obj)
validate
in interface JCValidator
validate
in class JCStringValidator
obj
-
protected boolean internal_validate(JCDateTimeValidator.WorkingCalendar cal)
public String format(Object obj)
format
in interface JCValidator
format
in class JCStringValidator
obj
-
public static boolean isLeap(int year)
year
- the year to check (for example, 1997)
public static int dayOfYear(int year, int month, int day)
year
- the year (for example, 1997)month
- 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 (for example, 1997)month
- the month (0 to 11)
public static int monthOfYear(int year, int day_of_year)
year
- the year to use (for example, 1997)day_of_year
- the day of the year (1 to 366)
public static int dayOfMonthOfYear(int year, int day_of_year)
year
- day_of_year
-
public static int daysInYear(int year)
year
-
public static int dayOfWeek(int year, int month, int day)
year
- month
- day
-
public static int weekOfYear(int year, int day_of_year)
year
- yearday_of_year
- day
public static int weekOfMonth(int year, int month, int day)
year
- yearmonth
- monthday
- day
public Object convertToSupported(Object obj)
convertFromSupported()
method.
convertToSupported
in class JCStringValidator
obj
-
convertFromSupported(java.lang.Object, java.lang.Class)
public Object convertFromSupported(Object from, Class class_type)
convertFromSupported
in class JCStringValidator
from
- class_type
-
convertToSupported(java.lang.Object)
public Object getDefaultValue()
getDefaultValue
in interface JCValidator
getDefaultValue
in class JCStringValidator
public void setDefaultValue(Object default_value)
setDefaultValue
in class JCStringValidator
default_value
- public com.klg.jclass.field.validate.PopupFieldEditor createPopupComponent()
createPopupComponent
in interface JCValidator
createPopupComponent
in class AbstractValidator
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |