net.rim.device.api.ui.text
Class URLTextFilter
java.lang.Object
|
+--net.rim.device.api.ui.text.TextFilter
|
+--net.rim.device.api.ui.text.URLTextFilter
- public class URLTextFilter
- extends TextFilter
Filters out characters not usable in URL text strings.
This filter accepts all characters except those disallowed by RFC 2396.
|
Constructor Summary |
URLTextFilter()
Constructs a new URLTextFilter instance. |
|
Method Summary |
char |
convert(char character,
int status)
Passes character through URL text filter.
|
boolean |
validate(char character)
Determines if character is a valid URL string character.
|
URLTextFilter
public URLTextFilter()
- Constructs a new URLTextFilter instance.
convert
public char convert(char character,
int status)
- Passes character through URL text filter.
- Overrides:
convert in class TextFilter
- Parameters:
character - Character to translate.status - Ignored.- Returns:
- Returns provided character, unless provided character was a
space character. In this case, if it was a SHIFTed space, this method
returns a forward slash; otherwise it returns a period.
- Since:
- JDE 3.7.0
validate
public boolean validate(char character)
- Determines if character is a valid URL string character.
URL delimiters are
< > "
URL unwise characters are
{ } | \ ^ [ ] `
Note: Despite the fact that they are included in RFC 2396, the "%" and
"#" characters are allowed by the filter.
- Overrides:
validate in class TextFilter
- Parameters:
character - Character to test.- Returns:
- False if passed a space, control, delimiter, or unwise URL
character (see description); otherwise, true.
- Since:
- JDE 3.7.0
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.