input
stringlengths
10
828
output
stringlengths
5
107
public map get action map return collections unmodifiable map h action
return a map of the validator actions in this result
public field get field return this field
returns the field that was validated
protected map get msg map return h msgs
returns a map of string msg names to msg objects
public string get method params return method params
gets the method parameters for the method
protected map get var map return h vars
returns a map of string var names to var objects
public void set method params string method params this method params method params this method parameter list clear string tokenizer st new string tokenizer method params while st has more tokens string value st next token trim if value null value length 0 this method parameter list add value
sets the method parameters for the method
public short validate string value return short parse value string null locale null
p validate convert a code short code using the default
public short validate string value string pattern return short parse value pattern locale null
p validate convert a code short code using the
public short validate string value locale locale return short parse value string null locale
p validate convert a code short code using the
public short validate string value string pattern locale locale return short parse value pattern locale
p validate convert a code short code using the
public boolean is in range short value short min short max return value min value max
check if the value is within a specified range
public boolean is in range short value short min short max return is in range value short value min max
check if the value is within a specified range
public boolean min value short value short min return value min
check if the value is greater than or equal to a minimum
public boolean min value short value short min return min value value short value min
check if the value is greater than or equal to a minimum
public boolean max value short value short max return value max
check if the value is less than or equal to a maximum
public string get js function name return js function name
gets the javascript function name
public boolean max value short value short max return max value value short value max
check if the value is less than or equal to a maximum
protected object process parsed value object value format formatter long long value number value long value if long value short min value long value short max value return null else return new short short long value
p perform further validation and convert the code number code to
public void set js function name string js function name this js function name js function name
sets the javascript function name
public big decimal validate string value return big decimal parse value string null locale null
p validate convert a code big decimal code using the default
public big decimal validate string value string pattern return big decimal parse value pattern locale null
p validate convert a code big decimal code using the
public big decimal validate string value locale locale return big decimal parse value string null locale
p validate convert a code big decimal code using the
public big decimal validate string value string pattern locale locale return big decimal parse value pattern locale
p validate convert a code big decimal code using the
public void set js function string js function if javascript null throw new illegal state exception cannot call set js function after calling set javascript this js function js function
sets the fully qualified class path of the javascript function
public boolean is in range big decimal value double min double max return value double value min value double value max
check if the value is within a specified range
public boolean min value big decimal value double min return value double value min
check if the value is greater than or equal to a minimum
public boolean max value big decimal value double max return value double value max
check if the value is less than or equal to a maximum
protected object process parsed value object value format formatter big decimal decimal null if value instanceof long decimal big decimal value of long value long value else decimal new big decimal value to string int scale determine scale number format formatter if scale 0 decimal decimal set scale scale big decimal round down return decimal
convert the parsed value to a code big decimal code
public calendar validate string value return calendar parse value string null locale null time zone null
p validate convert a code calendar code using the default
public void set javascript string javascript if js function null throw new illegal state exception cannot call set javascript after calling set js function this javascript javascript
sets the javascript equivalent of the java class and method
public calendar validate string value time zone time zone return calendar parse value string null locale null time zone
p validate convert a code calendar code using the specified
public calendar validate string value string pattern return calendar parse value pattern locale null time zone null
p validate convert a code calendar code using the specified
public calendar validate string value string pattern time zone time zone return calendar parse value pattern locale null time zone
p validate convert a code calendar code using the specified
protected void init this load javascript function
initialize based on set
public calendar validate string value locale locale return calendar parse value string null locale time zone null
p validate convert a code calendar code using the specified
public calendar validate string value locale locale time zone time zone return calendar parse value string null locale time zone
p validate convert a code calendar code using the specified
public calendar validate string value string pattern locale locale return calendar parse value pattern locale time zone null
p validate convert a code calendar code using the specified pattern
public calendar validate string value string pattern locale locale time zone time zone return calendar parse value pattern locale time zone
p validate convert a code calendar code using the specified
public int compare dates calendar value calendar compare return compare value compare calendar date
p compare dates day month and year not time
public int compare weeks calendar value calendar compare return compare value compare calendar week of year
p compare weeks week and year
public int compare months calendar value calendar compare return compare value compare calendar month
p compare months month and year
public int compare quarters calendar value calendar compare return compare quarters value compare 1
p compare quarters quarter and year
public int compare quarters calendar value calendar compare int month of first quarter return super compare quarters value compare month of first quarter
p compare quarters quarter and year
public int compare years calendar value calendar compare return compare value compare calendar year
p compare years
protected object process parsed value object value format formatter return date format formatter get calendar
p convert the parsed code date code to a code calendar code
public float validate string value return float parse value string null locale null
p validate convert a code float code using the default
public float validate string value string pattern return float parse value pattern locale null
p validate convert a code float code using the
public float validate string value locale locale return float parse value string null locale
p validate convert a code float code using the
private string generate js function string buffer js name new string buffer org apache commons validator javascript js name append validate js name append name substring 0 1 to upper case js name append name substring 1 name length return js name to string
used to generate the javascript name when it is not specified
public float validate string value string pattern locale locale return float parse value pattern locale
p validate convert a code float code using the
public boolean is in range float value float min float max return value min value max
check if the value is within a specified range
public boolean is in range float value float min float max return is in range value float value min max
check if the value is within a specified range
public boolean min value float value float min return value min
check if the value is greater than or equal to a minimum
public boolean min value float value float min return min value value float value min
check if the value is greater than or equal to a minimum
public boolean max value float value float max return value max
check if the value is less than or equal to a maximum
public boolean max value float value float max return max value value float value max
check if the value is less than or equal to a maximum
protected object process parsed value object value format formatter double double value number value double value if double value 0 if double value float min value return null if double value float max value return null else if double value 0 double pos double double value 1 if pos double float min value return null if pos double float max value return null return new float float double value
p perform further validation and convert the code number code to
public boolean is valid string email if email null return false matcher ascii matcher match ascii pattern matcher email if ascii matcher matches return false check the whole email address structure matcher email matcher email pattern matcher email if email matcher matches return false if email ends with return false if is valid user email matcher group 1 return false if is valid domain email matcher group 2 return false return true
p checks if a field has a valid e mail address
protected boolean is valid domain string domain see if domain is an ip address in brackets matcher ip domain matcher ip domain pattern matcher domain if ip domain matcher matches inet address validator inet address validator inet address validator get instance return inet address validator is valid ip domain matcher group 1 else domain is symbolic name domain validator domain validator domain validator get instance allow local return domain validator is valid domain
returns true if the domain component of an email address is valid
public boolean is valid string value string pattern locale locale object parsed value parse value pattern locale time zone null return parsed value null false true
p validate using the specified code locale code
public string format object value time zone time zone return format value string null locale null time zone
p format an object into a code string code using
public string to string string buffer results new string buffer validator action results append name results append n return results to string
returns a string representation of the object
public string format object value string pattern time zone time zone return format value pattern locale null time zone
p format an object into a code string code using
public string format object value locale locale time zone time zone return format value string null locale time zone
p format an object into a code string code using
public string format object value string pattern locale locale return format value pattern locale time zone null
p format an object using the specified pattern and or
private void load validation method throws validator exception if this validation method null return try this validation method this validation class get method this method this parameter classes catch no such method exception e throw new validator exception no such validation method e get message
load the method object for the configured validation method name
public string format object value string pattern locale locale time zone time zone date format formatter date format get format pattern locale if time zone null formatter set time zone time zone else if value instanceof calendar formatter set time zone calendar value get time zone return format value formatter
p format an object using the specified pattern and or
protected string format object value format formatter if value null return null else if value instanceof calendar value calendar value get time return formatter format value
p format a value with the specified code date format code
protected object parse string value string pattern locale locale time zone time zone value value null null value trim if value null value length 0 return null date format formatter date format get format pattern locale if time zone null formatter set time zone time zone return parse value formatter
p checks if the value is valid against a specified pattern
protected format get format string pattern locale locale date format formatter null boolean use pattern pattern null pattern length 0 if use pattern formatter date format get format locale else if locale null formatter new simple date format pattern else date format symbols symbols new date format symbols locale formatter new simple date format pattern symbols formatter set lenient false return formatter
p returns a code date format code for the specified i pattern i
private object get validation class instance throws validator exception if modifier is static this validation method get modifiers this instance null else if this instance null try this instance this validation class new instance catch instantiation exception e string msg couldn t create instance of this classname e get message throw new validator exception msg catch illegal access exception e string msg couldn t create instance of this classname e get message throw new validator exception msg return this instance
return an instance of the validation class or null if the validation
protected int compare time calendar value calendar compare int field int result 0 compare hour result calculate compare result value compare calendar hour of day if result 0 field calendar hour field calendar hour of day return result compare minute result calculate compare result value compare calendar minute if result 0 field calendar minute return result compare second result calculate compare result value compare calendar second if result 0 field calendar second return result compare milliseconds if field calendar millisecond return calculate compare result value compare calendar millisecond throw new illegal argument exception invalid field field
p compares a calendar time value to another indicating whether it is
protected int compare quarters calendar value calendar compare int month of first quarter int value quarter calculate quarter value month of first quarter int compare quarter calculate quarter compare month of first quarter if value quarter compare quarter return 1 else if value quarter compare quarter return 1 else return 0
p compares a calendars quarter value to another indicating whether it is
private int calculate quarter calendar calendar int month of first quarter add year int year calendar get calendar year int month calendar get calendar month 1 int relative month month month of first quarter month month of first quarter month 12 month of first quarter int quarter relative month 3 1 adjust the year if the quarter doesn t start in january if month month of first quarter year return year 10 quarter
p calculate the quarter for the specified calendar
private int calculate compare result calendar value calendar compare int field int difference value get field compare get field if difference 0 return 1 else if difference 0 return 1 else return 0
p compares the field from two calendars indicating whether the field for the
private boolean is valid object result if result instanceof boolean boolean valid boolean result return valid boolean value else return result null
if the result object is a code boolean code it will return its
public integer validate string value return integer parse value string null locale null
p validate convert an code integer code using the default
public integer validate string value string pattern return integer parse value pattern locale null
p validate convert an code integer code using the
public integer validate string value locale locale return integer parse value string null locale
p validate convert an code integer code using the
public integer validate string value string pattern locale locale return integer parse value pattern locale
p validate convert a code integer code using the
public boolean is in range int value int min int max return value min value max
check if the value is within a specified range
public boolean is in range integer value int min int max return is in range value int value min max
check if the value is within a specified range
private class loader get class loader map params validator v validator params get validator validator param return v get class loader
returns the class loader set in the validator contained in the parameter
public boolean min value int value int min return value min
check if the value is greater than or equal to a minimum
public boolean min value integer value int min return min value value int value min
check if the value is greater than or equal to a minimum
public boolean max value int value int max return value max
check if the value is less than or equal to a maximum
public boolean max value integer value int max return max value value int value max
check if the value is less than or equal to a maximum
protected object process parsed value object value format formatter long long value number value long value if long value integer min value long value integer max value return null else return new integer int long value
p perform further validation and convert the code number code to
private boolean only return errors map params validator v validator params get validator validator param return v get only return errors
returns the only return errors setting in the validator contained in the
public boolean is valid string domain string groups domain regex match domain if groups null groups length 0 return is valid tld groups 0 else if allow local if hostname regex is valid domain return true return false
returns true if the specified code string code parses
public boolean is valid tld string tld if allow local is valid local tld tld return true return is valid infrastructure tld tld is valid generic tld tld is valid country code tld tld
returns true if the specified code string code matches any
private log get log if log null log log factory get log validator action class return log
accessor method for log instance
public boolean is valid infrastructure tld string i tld return infrastructure tld list contains chomp leading dot i tld to lower case
returns true if the specified code string code matches any
public double validate string value return double parse value string null locale null
p validate convert a code double code using the default
public double validate string value string pattern return double parse value pattern locale null
p validate convert a code double code using the
public boolean is valid generic tld string g tld return generic tld list contains chomp leading dot g tld to lower case
returns true if the specified code string code matches any
public double validate string value locale locale return double parse value string null locale
p validate convert a code double code using the
public double validate string value string pattern locale locale return double parse value pattern locale
p validate convert a code double code using the
public boolean is valid country code tld string cc tld return country code tld list contains chomp leading dot cc tld to lower case
returns true if the specified code string code matches any
public boolean is in range double value double min double max return value min value max
check if the value is within a specified range