Java Doc for UtilValidate.java in  » ERP-CRM-Financial » SourceTap-CRM » org » ofbiz » base » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » SourceTap CRM » org.ofbiz.base.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ofbiz.base.util.UtilValidate

UtilValidate
public class UtilValidate (Code)
General input/data validation methods Utility methods for validating data, especially input. See detailed description below.
author:
   David E. Jones
version:
   $Revision: 1.5 $
since:
   1.0
since:
  
SUMMARY
since:
  

since:
  
This is a set of meethods for validating input. Functions are provided to validate:
since:
  
- U.S. and international phone/fax numbers
since:
  
- U.S. ZIP codes(5 or 9 digit postal codes)
since:
  
- U.S. Postal Codes(2 letter abbreviations for names of states)
since:
  
- U.S. Social Security Numbers(abbreviated as SSNs)
since:
  
- email addresses
since:
  
- dates(entry of year, month, and day and validity of combined date)
since:
  
- credit card numbers
since:
  

since:
  
Supporting utility functions validate that:
since:
  
- characters are Letter, Digit, or LetterOrDigit
since:
  
- strings are a Signed, Positive, Negative, Nonpositive, or Nonnegative integer
since:
  
- strings are a Float or a SignedFloat
since:
  
- strings are Alphabetic, Alphanumeric, or Whitespace
since:
  
- strings contain an integer within a specified range
since:
  

since:
  
Other utility functions are provided to:
since:
  
- remove from a string characters which are/are not in a "bag" of selected characters
since:
  
- strip whitespace/leading whitespace from a string
since:
  

since:
  
==============================================================================
since:
  
NOTE: This code was adapted from the Netscape JavaScript form validation code,
since:
  
usually found in "FormChek.js". Credit card verification functions Originally
since:
   since:
  
==============================================================================


Field Summary
final public static  StringContiguousUSStateCodes
     Valid contiguous U.S.
final public static  StringSSNDelimiters
    
final public static  StringUSStateCodeDelimiter
    
final public static  StringUSStateCodes
     Valid U.S.
final public static  StringZipCodeDelimeter
    
final public static  StringZipCodeDelimiters
    
final public static  StringcreditCardDelimiters
    
final public static  int[]daysInMonth
     An array of ints representing the number of days in each month of the year.
final public static  StringdecimalPointDelimiter
    
final public static  booleandefaultEmptyOK
    
final public static  Stringdigits
    
final public static  intdigitsInSocialSecurityNumber
     U.S.
final public static  intdigitsInUSPhoneAreaCode
    
final public static  intdigitsInUSPhoneMainNumber
    
final public static  intdigitsInUSPhoneNumber
     U.S.
final public static  intdigitsInZipCode1
     U.S.
final public static  intdigitsInZipCode2
     U.S.
final public static  StringisAnyCardMsg
    
final public static  StringisContiguousStateCodeMsg
    
final public static  StringisContiguousZipCodeMsg
    
final public static  StringisCreditCardPrefixMsg
    
final public static  StringisCreditCardSuffixMsg
    
final public static  StringisDateAfterToday
    
final public static  StringisDateMsg
    
final public static  StringisDatePrefixMsg
    
final public static  StringisDateSuffixMsg
    
final public static  StringisDayMsg
    
final public static  StringisEmailMsg
    
final public static  StringisFloatMsg
    
final public static  StringisHourMsg
    
final public static  StringisIntegerMsg
    
final public static  StringisInternationalPhoneNumberMsg
    
final public static  StringisLongMsg
    
final public static  StringisMinuteMsg
    
final public static  StringisMonthMsg
    
final public static  StringisNotEmptyMsg
    
final public static  StringisSSNMsg
    
final public static  StringisSecondMsg
    
final public static  StringisSignedDoubleMsg
    
final public static  StringisSignedFloatMsg
    
final public static  StringisSignedIntegerMsg
    
final public static  StringisSignedLongMsg
    
final public static  StringisStateCodeMsg
    
final public static  StringisTimeMsg
    
final public static  StringisUSPhoneAreaCodeMsg
    
final public static  StringisUSPhoneMainNumberMsg
    
final public static  StringisUSPhoneMsg
    
final public static  StringisYearMsg
    
final public static  StringisZipCodeMsg
    
final public static  Stringletters
    
final public static  StringlowercaseLetters
    
final public static  Stringmodule
    
final public static  StringphoneNumberDelimiters
    
final public static  StringuppercaseLetters
    
final public static  StringvalidSSNChars
    
final public static  StringvalidUSPhoneChars
    
final public static  StringvalidWorldPhoneChars
    
final public static  StringvalidZipCodeChars
    
final public static  Stringwhitespace
    


Method Summary
public static  StringappendCheckDigit(String stPassed)
    
public static  booleanareEqual(Object obj, Object obj2)
    
public static  booleancharInString(char c, String s)
     Returns true if single character c(actually a string) is contained within string s.
public static  intdaysInFebruary(int year)
     Given integer argument year, returns number of days in February of that year.
public static  StringgetCardType(String ccPassed)
    
public static  intgetLuhnCheckDigit(String stPassed)
    
public static  intgetLuhnSum(String stPassed)
    
public static  booleanisAlphabetic(String s)
     Returns true if string s is letters only.
public static  booleanisAlphanumeric(String s)
     Returns true if string s is English letters (A ..
public static  booleanisAmericanExpress(String cc)
    
public static  booleanisAnyCard(String ccPassed)
    
public static  booleanisCardMatch(String cardType, String cardNumberPassed)
    
public static  booleanisCarteBlanche(String cc)
    
public static  booleanisContiguousStateCode(String s)
     Return true if s is a valid contiguous U.S.
public static  booleanisContiguousZipCode(String s)
     Returns true if string s is a valid contiguous U.S.
public static  booleanisCreditCard(String stPassed)
    
public static  booleanisDate(String year, String month, String day)
     isDate returns true if string arguments year, month, and day form a valid date.
public static  booleanisDate(String date)
     isDate returns true if string argument date forms a valid date.
public static  booleanisDateAfterToday(String date)
     isDate returns true if string argument date forms a valid date and is after today.
public static  booleanisDay(String s)
     isDay returns true if string s is a valid day number between 1 and 31.
public static  booleanisDigit(char c)
     Returns true if character c is a digit (0 ..
public static  booleanisDinersClub(String cc)
    
public static  booleanisDiscover(String cc)
    
public static  booleanisEmail(String s)
     Email address must be of form a@b.c -- in other words: - there must be at least one character before the @ - there must be at least one character before and after the . - the characters @ and .
public static  booleanisEmpty(String s)
     Check whether string s is empty.
public static  booleanisEmpty(Collection c)
     Check whether collection c is empty.
public static  booleanisEnRoute(String cc)
    
public static  booleanisFloat(String s)
     True if string s is an unsigned floating point(real) number. Also returns true for unsigned integers.
public static  booleanisGiftCard(String stPassed)
    
public static  booleanisHour(String s)
     isHour returns true if string s is a valid number between 0 and 23.
public static  booleanisInteger(String s)
     Returns true if all characters in string s are numbers. Accepts non-signed integers only.
public static  booleanisIntegerInRange(String s, int a, int b)
     isIntegerInRange returns true if string s is an integer within the range of integer arguments a and b, inclusive.
public static  booleanisInternationalPhoneNumber(String s)
     isInternationalPhoneNumber returns true if string s is a valid international phone number.
public static  booleanisJCB(String cc)
    
public static  booleanisLetter(char c)
     Returns true if character c is an English letter (A ..
public static  booleanisLetterOrDigit(char c)
     Returns true if character c is a letter or digit.
public static  booleanisMasterCard(String cc)
    
public static  booleanisMinute(String s)
     isMinute returns true if string s is a valid number between 0 and 59.
public static  booleanisMonth(String s)
     isMonth returns true if string s is a valid month number between 1 and 12.
public static  booleanisNegativeInteger(String s)
     Returns true if string s is an integer < 0.
public static  booleanisNonnegativeInteger(String s)
     Returns true if string s is an integer >= 0.
public static  booleanisNonpositiveInteger(String s)
     Returns true if string s is an integer <= 0.
public static  booleanisNotEmpty(String s)
     Check whether string s is NOT empty.
public static  booleanisNotEmpty(Collection c)
     Check whether collection c is NOT empty.
public static  booleanisNotPoBox(String s)
     isNotPoBox returns true if address argument does not contain anything that looks like a a PO Box.
public static  booleanisPositiveInteger(String s)
     Returns true if string s is an integer > 0.
public static  booleanisSSN(String s)
     isSSN returns true if string s is a valid U.S.
public static  booleanisSecond(String s)
     isSecond returns true if string s is a valid number between 0 and 59.
public static  booleanisSignedDouble(String s)
     True if string s is a signed or unsigned floating point (real) number.
public static  booleanisSignedFloat(String s)
     True if string s is a signed or unsigned floating point (real) number.
public static  booleanisSignedInteger(String s)
     Returns true if all characters are numbers; first character is allowed to be + or - as well.
public static  booleanisSignedLong(String s)
     Returns true if all characters are numbers; first character is allowed to be + or - as well.
public static  booleanisStateCode(String s)
     Return true if s is a valid U.S.
public static  booleanisTime(String hour, String minute, String second)
     isTime returns true if string arguments hour, minute, and second form a valid time.
public static  booleanisTime(String time)
     isTime returns true if string argument time forms a valid time.
public static  booleanisUSPhoneAreaCode(String s)
     isUSPhoneAreaCode returns true if string s is a valid U.S.
public static  booleanisUSPhoneMainNumber(String s)
     isUSPhoneMainNumber returns true if string s is a valid U.S.
public static  booleanisUSPhoneNumber(String s)
     isUSPhoneNumber returns true if string s is a valid U.S.
public static  booleanisUrl(String s)
    
public static  booleanisValueLinkCard(String stPassed)
    
public static  booleanisVisa(String cc)
    
public static  booleanisWhitespace(String s)
     Returns true if string s is empty or whitespace characters only.
public static  booleanisYear(String s)
     isYear returns true if string s is a valid Year number.
public static  booleanisZipCode(String s)
     isZIPCode returns true if string s is a valid U.S.
public static  StringstripCharsInBag(String s, String bag)
     Removes all characters which appear in string bag from string s.
public static  StringstripCharsNotInBag(String s, String bag)
     Removes all characters which do NOT appear in string bag from string s.
public static  StringstripInitialWhitespace(String s)
     Removes initial(leading) whitespace characters from s. Member whitespace(see above) defines which characters are considered whitespace.
public static  StringstripWhitespace(String s)
     Removes all whitespace characters from s. Member whitespace(see above) defines which characters are considered whitespace.
public static  booleansumIsMod10(int sum)
    

Field Detail
ContiguousUSStateCodes
final public static String ContiguousUSStateCodes(Code)
Valid contiguous U.S. postal codes



SSNDelimiters
final public static String SSNDelimiters(Code)
non-digit characters which are allowed in Social Security Numbers



USStateCodeDelimiter
final public static String USStateCodeDelimiter(Code)
Delimiter for USStateCodes String



USStateCodes
final public static String USStateCodes(Code)
Valid U.S. Postal Codes for states, territories, armed forces, etc. See http://www.usps.gov/ncsc/lookups/abbr_state.txt.



ZipCodeDelimeter
final public static String ZipCodeDelimeter(Code)
our preferred delimiter for reformatting ZIP Codes



ZipCodeDelimiters
final public static String ZipCodeDelimiters(Code)
non-digit characters which are allowed in ZIP Codes



creditCardDelimiters
final public static String creditCardDelimiters(Code)
non-digit characters which are allowed in credit card numbers



daysInMonth
final public static int[] daysInMonth(Code)
An array of ints representing the number of days in each month of the year. Note: February varies depending on the year



decimalPointDelimiter
final public static String decimalPointDelimiter(Code)
decimal point character differs by language and culture



defaultEmptyOK
final public static boolean defaultEmptyOK(Code)
boolean specifying by default whether or not it is okay for a String to be empty



digits
final public static String digits(Code)
digit characters



digitsInSocialSecurityNumber
final public static int digitsInSocialSecurityNumber(Code)
U.S. Social Security Numbers have 9 digits. They are formatted as 123-45-6789.



digitsInUSPhoneAreaCode
final public static int digitsInUSPhoneAreaCode(Code)



digitsInUSPhoneMainNumber
final public static int digitsInUSPhoneMainNumber(Code)



digitsInUSPhoneNumber
final public static int digitsInUSPhoneNumber(Code)
U.S. phone numbers have 10 digits. They are formatted as 123 456 7890 or(123) 456-7890.



digitsInZipCode1
final public static int digitsInZipCode1(Code)
U.S. ZIP codes have 5 or 9 digits. They are formatted as 12345 or 12345-6789.



digitsInZipCode2
final public static int digitsInZipCode2(Code)
U.S. ZIP codes have 5 or 9 digits. They are formatted as 12345 or 12345-6789.



isAnyCardMsg
final public static String isAnyCardMsg(Code)



isContiguousStateCodeMsg
final public static String isContiguousStateCodeMsg(Code)



isContiguousZipCodeMsg
final public static String isContiguousZipCodeMsg(Code)



isCreditCardPrefixMsg
final public static String isCreditCardPrefixMsg(Code)



isCreditCardSuffixMsg
final public static String isCreditCardSuffixMsg(Code)



isDateAfterToday
final public static String isDateAfterToday(Code)



isDateMsg
final public static String isDateMsg(Code)



isDatePrefixMsg
final public static String isDatePrefixMsg(Code)



isDateSuffixMsg
final public static String isDateSuffixMsg(Code)



isDayMsg
final public static String isDayMsg(Code)



isEmailMsg
final public static String isEmailMsg(Code)



isFloatMsg
final public static String isFloatMsg(Code)



isHourMsg
final public static String isHourMsg(Code)



isIntegerMsg
final public static String isIntegerMsg(Code)



isInternationalPhoneNumberMsg
final public static String isInternationalPhoneNumberMsg(Code)



isLongMsg
final public static String isLongMsg(Code)



isMinuteMsg
final public static String isMinuteMsg(Code)



isMonthMsg
final public static String isMonthMsg(Code)



isNotEmptyMsg
final public static String isNotEmptyMsg(Code)



isSSNMsg
final public static String isSSNMsg(Code)



isSecondMsg
final public static String isSecondMsg(Code)



isSignedDoubleMsg
final public static String isSignedDoubleMsg(Code)



isSignedFloatMsg
final public static String isSignedFloatMsg(Code)



isSignedIntegerMsg
final public static String isSignedIntegerMsg(Code)



isSignedLongMsg
final public static String isSignedLongMsg(Code)



isStateCodeMsg
final public static String isStateCodeMsg(Code)



isTimeMsg
final public static String isTimeMsg(Code)



isUSPhoneAreaCodeMsg
final public static String isUSPhoneAreaCodeMsg(Code)



isUSPhoneMainNumberMsg
final public static String isUSPhoneMainNumberMsg(Code)



isUSPhoneMsg
final public static String isUSPhoneMsg(Code)



isYearMsg
final public static String isYearMsg(Code)



isZipCodeMsg
final public static String isZipCodeMsg(Code)



letters
final public static String letters(Code)
letter characters



lowercaseLetters
final public static String lowercaseLetters(Code)
lower-case letter characters



module
final public static String module(Code)



phoneNumberDelimiters
final public static String phoneNumberDelimiters(Code)
non-digit characters which are allowed in phone numbers



uppercaseLetters
final public static String uppercaseLetters(Code)
upper-case letter characters



validSSNChars
final public static String validSSNChars(Code)
characters which are allowed in Social Security Numbers



validUSPhoneChars
final public static String validUSPhoneChars(Code)
characters which are allowed in US phone numbers



validWorldPhoneChars
final public static String validWorldPhoneChars(Code)
characters which are allowed in international phone numbers(a leading + is OK)



validZipCodeChars
final public static String validZipCodeChars(Code)
characters which are allowed in Social Security Numbers



whitespace
final public static String whitespace(Code)
whitespace characters





Method Detail
appendCheckDigit
public static String appendCheckDigit(String stPassed)(Code)



areEqual
public static boolean areEqual(Object obj, Object obj2)(Code)



charInString
public static boolean charInString(char c, String s)(Code)
Returns true if single character c(actually a string) is contained within string s.



daysInFebruary
public static int daysInFebruary(int year)(Code)
Given integer argument year, returns number of days in February of that year.



getCardType
public static String getCardType(String ccPassed)(Code)
Checks to see if the cc number is a valid number for any accepted credit card, and return the name of that type
Parameters:
  ccPassed - - a string representing a credit card number true, if the credit card number is any valid credit card number for any of the accepted card types, false otherwise



getLuhnCheckDigit
public static int getLuhnCheckDigit(String stPassed)(Code)



getLuhnSum
public static int getLuhnSum(String stPassed)(Code)



isAlphabetic
public static boolean isAlphabetic(String s)(Code)
Returns true if string s is letters only. NOTE: This should handle i18n version to support European characters, etc. since it now uses Character.isLetter()



isAlphanumeric
public static boolean isAlphanumeric(String s)(Code)
Returns true if string s is English letters (A .. Z, a..z) and numbers only. NOTE: Need i18n version to support European characters. This could be tricky due to different character sets and orderings for various languages and platforms.



isAmericanExpress
public static boolean isAmericanExpress(String cc)(Code)
Checks to see if the cc number is a valid American Express number
Parameters:
  cc - - a string representing a credit card number; Sample number: 340000000000009(15 digits) true, if the credit card number is a valid American Express number, false otherwise



isAnyCard
public static boolean isAnyCard(String ccPassed)(Code)
Checks to see if the cc number is a valid number for any accepted credit card
Parameters:
  ccPassed - - a string representing a credit card number true, if the credit card number is any valid credit card number for any of the accepted card types, false otherwise



isCardMatch
public static boolean isCardMatch(String cardType, String cardNumberPassed)(Code)
Checks to see if the cc number is a valid number for the specified type
Parameters:
  cardType - - a string representing the credit card type
Parameters:
  cardNumberPassed - - a string representing a credit card number true, if the credit card number is valid for the particular credit card type given in "cardType", false otherwise



isCarteBlanche
public static boolean isCarteBlanche(String cc)(Code)
Checks to see if the cc number is a valid Carte Blanche number
Parameters:
  cc - - a string representing a credit card number; Sample number: 30000000000004(14 digits) true, if the credit card number is a valid Carte Blanche number, false otherwise



isContiguousStateCode
public static boolean isContiguousStateCode(String s)(Code)
Return true if s is a valid contiguous U.S. Postal Code (abbreviation for state).



isContiguousZipCode
public static boolean isContiguousZipCode(String s)(Code)
Returns true if string s is a valid contiguous U.S. Zip code. Must be 5 or 9 digits only.



isCreditCard
public static boolean isCreditCard(String stPassed)(Code)
Checks credit card number with Luhn Mod-10 test
Parameters:
  stPassed - a string representing a credit card number true, if the credit card number passes the Luhn Mod-10 test, false otherwise



isDate
public static boolean isDate(String year, String month, String day)(Code)
isDate returns true if string arguments year, month, and day form a valid date.



isDate
public static boolean isDate(String date)(Code)
isDate returns true if string argument date forms a valid date.



isDateAfterToday
public static boolean isDateAfterToday(String date)(Code)
isDate returns true if string argument date forms a valid date and is after today.



isDay
public static boolean isDay(String s)(Code)
isDay returns true if string s is a valid day number between 1 and 31.



isDigit
public static boolean isDigit(char c)(Code)
Returns true if character c is a digit (0 .. 9).



isDinersClub
public static boolean isDinersClub(String cc)(Code)
Checks to see if the cc number is a valid Diners Club number
Parameters:
  cc - - a string representing a credit card number; Sample number: 30000000000004(14 digits) true, if the credit card number is a valid Diner's Club number, false otherwise



isDiscover
public static boolean isDiscover(String cc)(Code)
Checks to see if the cc number is a valid Discover number
Parameters:
  cc - - a string representing a credit card number; Sample number: 6011000000000004(16 digits) true, if the credit card number is a valid Discover card number, false otherwise



isEmail
public static boolean isEmail(String s)(Code)
Email address must be of form a@b.c -- in other words: - there must be at least one character before the @ - there must be at least one character before and after the . - the characters @ and . are both required



isEmpty
public static boolean isEmpty(String s)(Code)
Check whether string s is empty.



isEmpty
public static boolean isEmpty(Collection c)(Code)
Check whether collection c is empty.



isEnRoute
public static boolean isEnRoute(String cc)(Code)
Checks to see if the cc number is a valid EnRoute number
Parameters:
  cc - - a string representing a credit card number; Sample number: 201400000000009(15 digits) true, if the credit card number is a valid enRoute card number, false, otherwise



isFloat
public static boolean isFloat(String s)(Code)
True if string s is an unsigned floating point(real) number. Also returns true for unsigned integers. If you wish to distinguish between integers and floating point numbers, first call isInteger, then call isFloat. Does not accept exponential notation.



isGiftCard
public static boolean isGiftCard(String stPassed)(Code)
Check to see if a card number is a supported Gift Card
Parameters:
  stPassed - a string representing a gift card true, if the number passed simple checks



isHour
public static boolean isHour(String s)(Code)
isHour returns true if string s is a valid number between 0 and 23.



isInteger
public static boolean isInteger(String s)(Code)
Returns true if all characters in string s are numbers. Accepts non-signed integers only. Does not accept floating point, exponential notation, etc.



isIntegerInRange
public static boolean isIntegerInRange(String s, int a, int b)(Code)
isIntegerInRange returns true if string s is an integer within the range of integer arguments a and b, inclusive.



isInternationalPhoneNumber
public static boolean isInternationalPhoneNumber(String s)(Code)
isInternationalPhoneNumber returns true if string s is a valid international phone number. Must be digits only; any length OK. May be prefixed by + character.



isJCB
public static boolean isJCB(String cc)(Code)
Checks to see if the cc number is a valid JCB number
Parameters:
  cc - - a string representing a credit card number; Sample number: 3088000000000009(16 digits) true, if the credit card number is a valid JCB card number, false otherwise



isLetter
public static boolean isLetter(char c)(Code)
Returns true if character c is an English letter (A .. Z, a..z). NOTE: Need i18n version to support European characters. This could be tricky due to different character sets and orderings for various languages and platforms.



isLetterOrDigit
public static boolean isLetterOrDigit(char c)(Code)
Returns true if character c is a letter or digit.



isMasterCard
public static boolean isMasterCard(String cc)(Code)
Checks to see if the cc number is a valid Master Card number
Parameters:
  cc - a string representing a credit card number; Sample number: 5500 0000 0000 0004(16 digits) true, if the credit card number is a valid MasterCard number, false otherwise



isMinute
public static boolean isMinute(String s)(Code)
isMinute returns true if string s is a valid number between 0 and 59.



isMonth
public static boolean isMonth(String s)(Code)
isMonth returns true if string s is a valid month number between 1 and 12.



isNegativeInteger
public static boolean isNegativeInteger(String s)(Code)
Returns true if string s is an integer < 0.



isNonnegativeInteger
public static boolean isNonnegativeInteger(String s)(Code)
Returns true if string s is an integer >= 0.



isNonpositiveInteger
public static boolean isNonpositiveInteger(String s)(Code)
Returns true if string s is an integer <= 0.



isNotEmpty
public static boolean isNotEmpty(String s)(Code)
Check whether string s is NOT empty.



isNotEmpty
public static boolean isNotEmpty(Collection c)(Code)
Check whether collection c is NOT empty.



isNotPoBox
public static boolean isNotPoBox(String s)(Code)
isNotPoBox returns true if address argument does not contain anything that looks like a a PO Box.



isPositiveInteger
public static boolean isPositiveInteger(String s)(Code)
Returns true if string s is an integer > 0. NOTE: using the Java Long object for greatest precision



isSSN
public static boolean isSSN(String s)(Code)
isSSN returns true if string s is a valid U.S. Social Security Number. Must be 9 digits.



isSecond
public static boolean isSecond(String s)(Code)
isSecond returns true if string s is a valid number between 0 and 59.



isSignedDouble
public static boolean isSignedDouble(String s)(Code)
True if string s is a signed or unsigned floating point (real) number. First character is allowed to be + or -. Also returns true for unsigned integers. If you wish to distinguish between integers and floating point numbers, first call isSignedInteger, then call isSignedFloat.



isSignedFloat
public static boolean isSignedFloat(String s)(Code)
True if string s is a signed or unsigned floating point (real) number. First character is allowed to be + or -. Also returns true for unsigned integers. If you wish to distinguish between integers and floating point numbers, first call isSignedInteger, then call isSignedFloat.



isSignedInteger
public static boolean isSignedInteger(String s)(Code)
Returns true if all characters are numbers; first character is allowed to be + or - as well. Does not accept floating point, exponential notation, etc.



isSignedLong
public static boolean isSignedLong(String s)(Code)
Returns true if all characters are numbers; first character is allowed to be + or - as well. Does not accept floating point, exponential notation, etc.



isStateCode
public static boolean isStateCode(String s)(Code)
Return true if s is a valid U.S. Postal Code (abbreviation for state).



isTime
public static boolean isTime(String hour, String minute, String second)(Code)
isTime returns true if string arguments hour, minute, and second form a valid time.



isTime
public static boolean isTime(String time)(Code)
isTime returns true if string argument time forms a valid time.



isUSPhoneAreaCode
public static boolean isUSPhoneAreaCode(String s)(Code)
isUSPhoneAreaCode returns true if string s is a valid U.S. Phone Area Code. Must be 3 digits.



isUSPhoneMainNumber
public static boolean isUSPhoneMainNumber(String s)(Code)
isUSPhoneMainNumber returns true if string s is a valid U.S. Phone Main Number. Must be 7 digits.



isUSPhoneNumber
public static boolean isUSPhoneNumber(String s)(Code)
isUSPhoneNumber returns true if string s is a valid U.S. Phone Number. Must be 10 digits.



isUrl
public static boolean isUrl(String s)(Code)
isUrl returns true if the string contains ://
Parameters:
  s - String to validate true if s contains ://



isValueLinkCard
public static boolean isValueLinkCard(String stPassed)(Code)
Check to see if a card number is a valid ValueLink Gift Card
Parameters:
  stPassed - a string representing a valuelink gift card true, if the number passed simple checks



isVisa
public static boolean isVisa(String cc)(Code)
Checks to see if the cc number is a valid Visa number
Parameters:
  cc - a string representing a credit card number; Sample number: 4111 1111 1111 1111(16 digits) true, if the credit card number is a valid VISA number, false otherwise



isWhitespace
public static boolean isWhitespace(String s)(Code)
Returns true if string s is empty or whitespace characters only.



isYear
public static boolean isYear(String s)(Code)
isYear returns true if string s is a valid Year number. Must be 2 or 4 digits only. For Year 2000 compliance, you are advised to use 4-digit year numbers everywhere.



isZipCode
public static boolean isZipCode(String s)(Code)
isZIPCode returns true if string s is a valid U.S. ZIP code. Must be 5 or 9 digits only.



stripCharsInBag
public static String stripCharsInBag(String s, String bag)(Code)
Removes all characters which appear in string bag from string s.



stripCharsNotInBag
public static String stripCharsNotInBag(String s, String bag)(Code)
Removes all characters which do NOT appear in string bag from string s.



stripInitialWhitespace
public static String stripInitialWhitespace(String s)(Code)
Removes initial(leading) whitespace characters from s. Member whitespace(see above) defines which characters are considered whitespace.



stripWhitespace
public static String stripWhitespace(String s)(Code)
Removes all whitespace characters from s. Member whitespace(see above) defines which characters are considered whitespace.



sumIsMod10
public static boolean sumIsMod10(int sum)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.