|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.rim.device.api.ui.text.TextFilter
|
+--net.rim.device.api.ui.text.IPTextFilter
Filters out characters not used in IP\Port text strings
| Field Summary | ||
static int |
NO_PORTS
A constant indicating that no ports are allowed in the string. |
|
static int |
NUMERIC_IP_ONLY
A constant indicating that if set, IP addresses can only consist of numeric characters. |
|
| Fields inherited from class net.rim.device.api.ui.text.TextFilter |
ADN_SIM_PHONE, DC_PHONE, DEFAULT, DEFAULT_SMART_PHONE, EMAIL, FDN_SIM_PHONE, HEXADECIMAL, INTEGER, LOWERCASE, NUMERIC, PHONE, PIN_ADDRESS, REAL_NUMERIC, SIM_PHONE, SMS_PHONE, STYLE_SHIFT, UPPERCASE, URL, VOICEMAIL_PHONE |
| Constructor Summary | ||
IPTextFilter()
Constructs new IPTextFilter object with no parameters. |
||
IPTextFilter(int flag)
Constructs new IPTextFilter object. |
||
| Method Summary | ||
char |
convert(char character,
int status)
Retrieves filtered version of provided character. |
|
boolean |
validate(AbstractString text)
Determines if provided string contains valid characters. |
|
boolean |
validate(char character)
Validates character for use with this filter. |
|
| Methods inherited from class net.rim.device.api.ui.text.TextFilter |
get |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NO_PORTS
public static final int NUMERIC_IP_ONLY
| Constructor Detail |
public IPTextFilter()
public IPTextFilter(int flag)
Takes an argument that specifies if UDP ports are allowed.
flag - | Method Detail |
public char convert(char character,
int status)
TextFilterThis method may not return a character valid for this filter; however, it may return 0 to indicate that the provided character is not valid.
For example, an UppercaseTextFilter would convert any lower case character to its
upper case equivalent. However, if passed a number it could either leave the number
unchanged to be filtered by TextFilter.validate(char), or convert it to \u0000.
convert in class TextFilterpublic boolean validate(AbstractString text)
TextFilter The default implementation of this method returns true if each
character is valid within the field (determined by invoking
TextFilter.validate(char). This is useful for upper case or lower case
filters, for example, but filters that rely on character position must
override this method.
validate in class TextFilterpublic boolean validate(char character)
TextFilterThis only considers if it is in the correct set of characters.
validate in class TextFilter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.