Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.gammastream.validity
Class GSVStringMethods  view GSVStringMethods download GSVStringMethods.java

java.lang.Object
  extended bycom.gammastream.validity.GSVStringMethods

public class GSVStringMethods
extends java.lang.Object

This class provides a set of predefined rules for performing validation on Strings. These rules are part of the default set of 'QuickRules'.


Field Summary
static java.lang.String EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static java.lang.String GREATER_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static java.lang.String GREATER_THAN
          For programatic purposes, we include this constant which is used for the compareTo method.
static java.lang.String LESS_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static java.lang.String LESS_THAN
          For programatic purposes, we include this constant which is used for the compareTo method.
static java.lang.String NOT_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
 
Constructor Summary
GSVStringMethods()
           
 
Method Summary
static boolean compareTo(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Performs a string comparision using the specified params dictionary.
static boolean contains(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies that the attribute contains the specified string.
static boolean endsWith(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies that the attribute ends with the specified string.
static boolean isAlphabetic(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies that the attribute contains only alphabetic characters.
static boolean isAlphaNumeric(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies that the attribute contains only letters or numbers.
static boolean isStringEmpty(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Determines whether the specified attribute is empty.
static boolean isValidEmailAddress(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies the attribute is a valid email address.
static boolean isValidURL(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies the attribute is a valid url.
static boolean length(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Determines whether the specified string is of a specified length.
static boolean startsWith(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          Verifies that the attribute starts with the specified string.
static boolean stripHTML(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          One of the many 'mutators' which never fail, unless of course, an exception is thrown.
static boolean toLowerCase(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          One of the many 'mutators' which never fail, unless of course, an exception is thrown.
static boolean toUpperCase(java.lang.Object object, java.lang.Object attribute, java.lang.String key, NSDictionary params)
          One of the many 'mutators' which never fail, unless of course, an exception is thrown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUAL

public static final java.lang.String EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

NOT_EQUAL

public static final java.lang.String NOT_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

GREATER_THAN

public static final java.lang.String GREATER_THAN
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

GREATER_EQUAL

public static final java.lang.String GREATER_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

LESS_THAN

public static final java.lang.String LESS_THAN
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

LESS_EQUAL

public static final java.lang.String LESS_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values
Constructor Detail

GSVStringMethods

public GSVStringMethods()
Method Detail

isStringEmpty

public static final boolean isStringEmpty(java.lang.Object object,
                                          java.lang.Object attribute,
                                          java.lang.String key,
                                          NSDictionary params)
Determines whether the specified attribute is empty.
An empty String is defined as a String that contains at least one non-white-space character.
(i.e. This method will return true if the attribute only contains spaces, CRs, NLs, etc.)


toUpperCase

public static final boolean toUpperCase(java.lang.Object object,
                                        java.lang.Object attribute,
                                        java.lang.String key,
                                        NSDictionary params)
One of the many 'mutators' which never fail, unless of course, an exception is thrown.
A mutator simply modifies (or mutates) the attribute is some way.
In this case, it converts the String to all upper case characters.


toLowerCase

public static final boolean toLowerCase(java.lang.Object object,
                                        java.lang.Object attribute,
                                        java.lang.String key,
                                        NSDictionary params)
One of the many 'mutators' which never fail, unless of course, an exception is thrown.
A mutator simply modifies (or mutates) the attribute is some way.
In this case, it converts the String to all lower case characters.


length

public static final boolean length(java.lang.Object object,
                                   java.lang.Object attribute,
                                   java.lang.String key,
                                   NSDictionary params)
Determines whether the specified string is of a specified length. (i.e. 'x' characters long)

The required key-value pairs include:
"Operator" = One of the defined operator constants.
"RightOperand" = A number representing the number of characters one is interested.


contains

public static final boolean contains(java.lang.Object object,
                                     java.lang.Object attribute,
                                     java.lang.String key,
                                     NSDictionary params)
Verifies that the attribute contains the specified string.

The required key-value pairs include:
"Contains" = The string of interest.


endsWith

public static final boolean endsWith(java.lang.Object object,
                                     java.lang.Object attribute,
                                     java.lang.String key,
                                     NSDictionary params)
Verifies that the attribute ends with the specified string.

The required key-value pairs include:
"EndsWith" = The string of interest.


startsWith

public static final boolean startsWith(java.lang.Object object,
                                       java.lang.Object attribute,
                                       java.lang.String key,
                                       NSDictionary params)
Verifies that the attribute starts with the specified string.

The required key-value pairs include:
"StartsWith" = The string of interest.


isAlphabetic

public static final boolean isAlphabetic(java.lang.Object object,
                                         java.lang.Object attribute,
                                         java.lang.String key,
                                         NSDictionary params)
Verifies that the attribute contains only alphabetic characters. (i.e. 'a'-'z' || 'A'-'Z')


isAlphaNumeric

public static final boolean isAlphaNumeric(java.lang.Object object,
                                           java.lang.Object attribute,
                                           java.lang.String key,
                                           NSDictionary params)
Verifies that the attribute contains only letters or numbers. (i.e. 'a'-'z' || 'A'-'Z' || '0'-'9')


stripHTML

public static final boolean stripHTML(java.lang.Object object,
                                      java.lang.Object attribute,
                                      java.lang.String key,
                                      NSDictionary params)
One of the many 'mutators' which never fail, unless of course, an exception is thrown.
A mutator simply modifies (or mutates) the attribute is some way.
In this case, it strips any HTML out of the String.
HTML is considered anything (and including) '<' and '>'.


compareTo

public static final boolean compareTo(java.lang.Object object,
                                      java.lang.Object attribute,
                                      java.lang.String key,
                                      NSDictionary params)
Performs a string comparision using the specified params dictionary.

The required key-value pairs include:
"Operator" = The specified operator string. (i.e. "==", "!=", ">", ">=", "<", or "<=" )
"RightOperand" = The String to compare the attribute to.


isValidURL

public static final boolean isValidURL(java.lang.Object object,
                                       java.lang.Object attribute,
                                       java.lang.String key,
                                       NSDictionary params)
Verifies the attribute is a valid url. (Proper Syntax)
The validator will verify, 'http', 'ftp', 'mailto', 'telnet', and 'file' urls.


isValidEmailAddress

public static final boolean isValidEmailAddress(java.lang.Object object,
                                                java.lang.Object attribute,
                                                java.lang.String key,
                                                NSDictionary params)
Verifies the attribute is a valid email address. (Proper Syntax)