[ https://issues.apache.org/jira/browse/OFBIZ-7807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rahul Singh updated OFBIZ-7807: ------------------------------- Attachment: OFBIZ-7807.patch > Enforce noninstantiability to UtilValidate class > ------------------------------------------------ > > Key: OFBIZ-7807 > URL: https://issues.apache.org/jira/browse/OFBIZ-7807 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: Trunk > Reporter: Arun Patidar > Priority: Minor > Attachments: OFBIZ-7807.patch > > > - Make class as final. > - Add a private constructor. > - Make following public variable as private; > {code} > /** boolean specifying by default whether or not it is okay for a String to be empty */ > public static final boolean defaultEmptyOK = true; > /** digit characters */ > public static final String digits = "0123456789"; > /** hex digit characters */ > public static final String hexDigits = digits + "abcdefABCDEF"; > /** lower-case letter characters */ > public static final String lowercaseLetters = "abcdefghijklmnopqrstuvwxyz"; > /** upper-case letter characters */ > public static final String uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; > /** letter characters */ > public static final String letters = lowercaseLetters + uppercaseLetters; > /** whitespace characters */ > public static final String whitespace = " \t\n\r"; > /** decimal point character differs by language and culture */ > public static final String decimalPointDelimiter = "."; > /** non-digit characters which are allowed in phone numbers */ > public static final String phoneNumberDelimiters = "()- "; > /** characters which are allowed in US phone numbers */ > public static final String validUSPhoneChars = digits + phoneNumberDelimiters; > /** characters which are allowed in international phone numbers(a leading + is OK) */ > public static final String validWorldPhoneChars = digits + phoneNumberDelimiters + "+"; > /** non-digit characters which are allowed in Social Security Numbers */ > public static final String SSNDelimiters = "- "; > /** characters which are allowed in Social Security Numbers */ > public static final String validSSNChars = digits + SSNDelimiters; > /** U.S. Social Security Numbers have 9 digits. They are formatted as 123-45-6789. */ > public static final int digitsInSocialSecurityNumber = 9; > /** U.S. phone numbers have 10 digits. They are formatted as 123 456 7890 or(123) 456-7890. */ > public static final int digitsInUSPhoneNumber = 10; > public static final int digitsInUSPhoneAreaCode = 3; > public static final int digitsInUSPhoneMainNumber = 7; > /** non-digit characters which are allowed in ZIP Codes */ > public static final String ZipCodeDelimiters = "-"; > /** our preferred delimiter for reformatting ZIP Codes */ > public static final String ZipCodeDelimeter = "-"; > /** characters which are allowed in Social Security Numbers */ > public static final String validZipCodeChars = digits + ZipCodeDelimiters; > /** U.S. ZIP codes have 5 or 9 digits. They are formatted as 12345 or 12345-6789. */ > public static final int digitsInZipCode1 = 5; > /** U.S. ZIP codes have 5 or 9 digits. They are formatted as 12345 or 12345-6789. */ > public static final int digitsInZipCode2 = 9; > /** non-digit characters which are allowed in credit card numbers */ > public static final String creditCardDelimiters = " -"; > public static final String isNotEmptyMsg = "This field cannot be empty, please enter a value."; > public static final String isStateCodeMsg = "The State Code must be a valid two character U.S. state abbreviation(like CA for California)."; > public static final String isContiguousStateCodeMsg = "The State Code must be a valid two character U.S. state abbreviation for one of the 48 contiguous United States (like CA for California)."; > public static final String isZipCodeMsg = "The ZIP Code must be a 5 or 9 digit U.S. ZIP Code(like 94043)."; > public static final String isUSPhoneMsg = "The US Phone must be a 10 digit U.S. phone number(like 415-555-1212)."; > public static final String isUSPhoneAreaCodeMsg = "The Phone Number Area Code must be 3 digits."; > public static final String isUSPhoneMainNumberMsg = "The Phone Number must be 7 digits."; > public static final String isContiguousZipCodeMsg = "Zip Code is not a valid Zip Code for one of the 48 contiguous United States ."; > public static final String isInternationalPhoneNumberMsg = "The World Phone must be a valid international phone number."; > public static final String isSSNMsg = "The SSN must be a 9 digit U.S. social security number(like 123-45-6789)."; > public static final String isEmailMsg = "The Email must be a valid email address(like [hidden email]). Please re-enter it now."; > public static final String isAnyCardMsg = "The credit card number is not a valid card number."; > public static final String isCreditCardPrefixMsg = " is not a valid "; > public static final String isCreditCardSuffixMsg = " credit card number."; > public static final String isDayMsg = "The Day must be a day number between 1 and 31. "; > public static final String isMonthMsg = "The Month must be a month number between 1 and 12. "; > public static final String isYearMsg = "The Year must be a 2 or 4 digit year number. "; > public static final String isDatePrefixMsg = "The Day, Month, and Year for "; > public static final String isDateSuffixMsg = " do not form a valid date. Please reenter them now."; > public static final String isHourMsg = "The Hour must be a number between 0 and 23."; > public static final String isMinuteMsg = "The Minute must be a number between 0 and 59."; > public static final String isSecondMsg = "The Second must be a number between 0 and 59."; > public static final String isTimeMsg = "The Time must be a valid time formed like: HH:MM or HH:MM:SS."; > public static final String isDateMsg = "The Date must be a valid date formed like: MM/YY, MM/YYYY, MM/DD/YY, or MM/DD/YYYY."; > public static final String isDateAfterToday = "The Date must be a valid date after today, and formed like: MM/YY, MM/YYYY, MM/DD/YY, or MM/DD/YYYY."; > public static final String isIntegerMsg = "The Number must be a valid unsigned whole decimal number."; > public static final String isSignedIntegerMsg = "The Number must be a valid signed whole decimal number."; > public static final String isLongMsg = "The Number must be a valid unsigned whole decimal number."; > public static final String isSignedLongMsg = "The Number must be a valid signed whole decimal number."; > public static final String isFloatMsg = "The Number must be a valid unsigned decimal number."; > public static final String isSignedFloatMsg = "The Number must be a valid signed decimal number."; > public static final String isSignedDoubleMsg = "The Number must be a valid signed decimal number."; > /** An array of ints representing the number of days in each month of the year. > * Note: February varies depending on the year */ > public static final int[] daysInMonth = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; > /** Delimiter for USStateCodes String */ > public static final String USStateCodeDelimiter = "|"; > /** Valid U.S. Postal Codes for states, territories, armed forces, etc. > * See http://www.usps.gov/ncsc/lookups/abbr_state.txt. */ > public static final String USStateCodes = "AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY|AE|AA|AE|AE|AP"; > /** Valid contiguous U.S. postal codes */ > public static final String ContiguousUSStateCodes = "AL|AZ|AR|CA|CO|CT|DE|DC|FL|GA|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY"; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) |
Free forum by Nabble | Edit this page |