|
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
This class validates objects of type String.
Field Summary | |
protected char[] |
compiled_mask_ch
|
protected int[] |
compiled_mask_sym
|
protected Object |
defaultValue
|
protected String |
mask
|
protected String |
mask_chars
|
protected int |
mask_length
|
protected int |
num_editable_pos
|
protected int |
num_mask_match
|
protected String |
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 |
Fields inherited from interface com.klg.jclass.field.validate.JCValidator |
DOWN, UP |
Constructor Summary | |
JCStringValidator()
Constructs a JCStringValidator . |
|
JCStringValidator(Locale locale,
String mask,
int num_match,
String place_holder_chars,
ListModel picklist,
boolean match_picklist,
String valid_chars,
String invalid_chars,
boolean allow_null,
Object default_value)
Constructs a JCStringValidator with the values specified. |
Method Summary | |
protected Object |
addIncrement(Object current)
|
void |
changeText(com.klg.jclass.field.validate.TextEvent e)
Processes all changes in the text field. |
protected void |
compileMask()
This routine compiles the mask into 2 arrays. |
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)
Since the 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
JCField . |
String |
format(Object obj)
Formats the text. |
String |
formatForEdit(Object obj)
Generates a String representation of the given object for use in edit mode. |
Object |
getDefaultValue()
Returns the default value for the field. |
int |
getFirstValidCursorPosition()
Returns the first valid cursor position in the text field. |
int |
getLastValidInputCharPosition(String text)
Returns the last valid input character in text. |
String |
getMask()
Returns the current mask. |
String |
getMaskChars()
Returns the mask characters used. |
int |
getNextCursorPosition(int current_position,
boolean direction)
Gets the next non-literal cursor position. |
int |
getNumMaskMatch()
Returns the number of characters to match with the mask. |
String |
getParsedMask()
Returns a String with only literals in the correct position. |
String |
getPlaceHolderChars()
Returns the placeholder String. |
protected Class[] |
getSupportedClasses()
Creates a list of classes supported by the validator. |
boolean |
hasEditFormat()
Returns true if the validator has a different edit format. |
boolean |
inRange(Object value)
Checks if the value is in the valid range. |
protected boolean |
internalValidate(Object obj)
This does the actual validation for the validate method. |
protected boolean |
isValidChar(StringBuffer buffer,
int string_position,
int actual_position)
This function checks to see if the character entered is valid. |
Object |
parse(Class class_type,
String text)
Validates the text after the text field loses focus. |
void |
setCursor(com.klg.jclass.field.validate.TextCursorEvent e)
Moves the cursor to a valid cursor position. |
void |
setDefaultValue(Object default_value)
Sets the default value for the field. |
void |
setMask(String mask)
Sets the mask to be used. |
void |
setMaskChars(String mask_chars)
Sets the mask characters to be used. |
void |
setNumMaskMatch(int num_mask_match)
Sets the number of characters to match with the mask from left to right. |
void |
setPlaceHolderChars(String place_holder_chars)
Sets the placeholder String, which specifies the characters to use instead of an empty mask. |
protected Object |
subtractIncrement(Object current)
|
boolean |
validate(Object obj)
Validates the value in the field. |
Methods inherited from class com.klg.jclass.field.validate.AbstractValidator |
calculateSpinability, checkValidInvalid, compareValues, convertCase, createPopupComponent, getAllowNull, getCasePolicy, getInvalidChars, getItem, getLocale, getMatchPickList, getMax, getMin, getNextValue, getPickList, getPickListIndex, getPreviousValue, getSpinPolicy, getValidChars, inferSubField, isClassSupported, isValidChar, setAllowNull, setCasePolicy, setInvalidChars, setLocale, 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 |
protected int[] compiled_mask_sym
protected char[] compiled_mask_ch
protected int mask_length
protected int num_editable_pos
protected String mask
protected String place_holder_chars
protected String mask_chars
protected int num_mask_match
protected Object defaultValue
Constructor Detail |
public JCStringValidator()
JCStringValidator
.
public JCStringValidator(Locale locale, String mask, int num_match, String place_holder_chars, ListModel picklist, boolean match_picklist, String valid_chars, String invalid_chars, boolean allow_null, Object default_value)
JCStringValidator
with the values specified.
allow_null
- default_value
- invalid_chars
- locale
- mask
- match_picklist
- num_match
- picklist
- place_holder_chars
- valid_chars
- Method Detail |
protected Class[] getSupportedClasses()
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
JCField
.
copyValue
in interface JCValidator
copyValue
in class AbstractValidator
value
-
public void setNumMaskMatch(int num_mask_match)
num_mask_match
- getNumMaskMatch()
public int getNumMaskMatch()
setNumMaskMatch(int)
public void setMask(String mask)
# - Any digit, minus sign, comma, decimal point, or
plus sign.
mask
- setMaskChars(java.lang.String)
,
getMask()
public String getMask()
setMask(java.lang.String)
public void setPlaceHolderChars(String place_holder_chars)
place_holder_chars
- getPlaceHolderChars()
public String getPlaceHolderChars()
setPlaceHolderChars(java.lang.String)
public void setMaskChars(String mask_chars)
# - Any digit, minus sign, comma, decimal point, or
plus sign.
mask_chars
- getMaskChars()
public String getMaskChars()
setMaskChars(java.lang.String)
public String getParsedMask()
setMask(java.lang.String)
public boolean inRange(Object value)
inRange
in class AbstractValidator
value
-
protected void compileMask()
protected boolean isValidChar(StringBuffer buffer, int string_position, int actual_position)
actual_position
- buffer
- string_position
-
public int getNextCursorPosition(int current_position, boolean direction)
current_position
- direction
-
public void changeText(com.klg.jclass.field.validate.TextEvent e)
changeText
in interface JCValidator
changeText
in class AbstractValidator
e
- public void setCursor(com.klg.jclass.field.validate.TextCursorEvent e)
setCursor
in interface JCValidator
setCursor
in class AbstractValidator
e
- public int getLastValidInputCharPosition(String text)
placeHolderChars
by counting the length backward.
text
-
public Object parse(Class class_type, String text)
parse
in interface JCValidator
parse
in class AbstractValidator
class_type
- text
-
public boolean validate(Object obj)
validate
in interface JCValidator
validate
in class AbstractValidator
obj
-
protected boolean internalValidate(Object obj)
parseAndValidate
called any
subclass' validate method, which is incorrect. The
parseAndValidate
method in this class must call the validate
method in this class.
obj
-
public String format(Object obj)
format
in interface JCValidator
format
in class AbstractValidator
obj
-
public int getFirstValidCursorPosition()
getFirstValidCursorPosition
in interface JCValidator
getFirstValidCursorPosition
in class AbstractValidator
public String formatForEdit(Object obj)
formatForEdit
in interface JCValidator
formatForEdit
in class AbstractValidator
obj
-
public boolean hasEditFormat()
true
if the validator has a different edit format.
hasEditFormat
in interface JCValidator
hasEditFormat
in class AbstractValidator
true
if the validator has a different edit formatprotected Object addIncrement(Object current)
addIncrement
in class AbstractValidator
protected Object subtractIncrement(Object current)
subtractIncrement
in class AbstractValidator
public Object convertToSupported(Object obj)
convertFromSupported()
method.
convertToSupported
in class AbstractValidator
obj
-
convertFromSupported(java.lang.Object, java.lang.Class)
public Object convertFromSupported(Object from, Class class_type)
convertFromSupported
in class AbstractValidator
from
- class_type
-
convertToSupported(java.lang.Object)
public Object getDefaultValue()
public void setDefaultValue(Object default_value)
default_value
-
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |