net.rim.device.api.ui.text
Class IPTextFilter

java.lang.Object
  |
  +--net.rim.device.api.ui.text.TextFilter
        |
        +--net.rim.device.api.ui.text.IPTextFilter

public class IPTextFilter
extends TextFilter

Filters out characters not used in IP\Port text strings

Since:
JDE 3.6.0

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

NO_PORTS

public static final int NO_PORTS
A constant indicating that no ports are allowed in the string.
Since:
JDE 3.6.0

NUMERIC_IP_ONLY

public static final int NUMERIC_IP_ONLY
A constant indicating that if set, IP addresses can only consist of numeric characters.
Since:
JDE 3.6.0
Constructor Detail

IPTextFilter

public IPTextFilter()
Constructs new IPTextFilter object with no parameters.
Since:
JDE 3.6.0

IPTextFilter

public IPTextFilter(int flag)
Constructs new IPTextFilter object.

Takes an argument that specifies if UDP ports are allowed.

Parameters:
flag -  
Since:
JDE 3.6.0
Method Detail

convert

public char convert(char character,
                    int status)
Description copied from class: TextFilter
Retrieves filtered version of provided character.

This 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.

Overrides:
convert in class TextFilter
Since:
JDE 4.0.2

validate

public boolean validate(AbstractString text)
Description copied from class: TextFilter
Determines if provided string contains valid characters.

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.

Overrides:
validate in class TextFilter
Since:
JDE 4.0.2

validate

public boolean validate(char character)
Description copied from class: TextFilter
Validates character for use with this filter.

This only considers if it is in the correct set of characters.

Overrides:
validate in class TextFilter
Since:
JDE 4.0.2


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.