Java Doc for ValidationUtils.java in  » Swing-Library » jgoodies-validation » com » jgoodies » validation » 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 » Swing Library » jgoodies validation » com.jgoodies.validation.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jgoodies.validation.util.ValidationUtils

ValidationUtils
final public class ValidationUtils (Code)
Consists exclusively of static methods for validating input values by testing and comparing single and multiple values.

The Jakarta Commons Lang library contains more classes and methods useful for validation. The Utils string and character tests in this ValidationUtils class are compatible with the Jakarta Commons Lang StringUtils methods.
author:
   Karsten Lentzsch
version:
   $Revision: 1.12 $
See Also:   Calendar





Method Summary
public static  booleanequals(Object o1, Object o2)
     Checks and answers if the two objects are both null or equal.
public static  CalendargetRelativeCalendar(int offsetDays)
     Computes the day that has the given offset in days to today and returns it as an instance of Calendar.
public static  CalendargetRelativeCalendar(Calendar from, int offsetDays)
     Computes the day that has the given offset in days from the specified from date and returns it as an instance of Calendar.
public static  DategetRelativeDate(int offsetDays)
     Computes the day that has the given offset in days to today and returns it as an instance of Date.
public static  booleanhasBoundedLength(String str, int min, int max)
     Checks and answers if the length of the given string is in the bounds as specified by the interval [min, max].
public static  booleanhasMaximumLength(String str, int max)
     Checks and answers if the given string is shorter than the specified maximum length.
public static  booleanhasMinimumLength(String str, int min)
     Checks and answers if the given string has at least the specified minimum length.
public static  booleanisAlpha(String str)
     Checks and answers if the given string contains only unicode letters.
public static  booleanisAlphaSpace(String str)
     Checks and answers if the given string contains only unicode letters and space (' ').
public static  booleanisAlphanumeric(String str)
     Checks and answers if the given string contains only unicode letters or digits.
public static  booleanisAlphanumericSpace(String str)
     Checks and answers if the given string contains only unicode letters or digits or space (' ').
public static  booleanisBlank(String str)
     Checks and answers if the given string is whitespace, empty ("") or null.
public static  booleanisEmpty(String str)
     Checks and answers if the given string is empty ("") or null.
public static  booleanisFutureDay(Date date)
     Determines and answers if the day of the given Date is in the future.
public static  booleanisNotBlank(String str)
     Checks and answers if the given string is not empty (""), not null and not whitespace only.
public static  booleanisNotEmpty(String str)
     Checks and answers if the given string is not empty ("") and not null.
public static  booleanisNumeric(String str)
     Checks and answers if the given string contains only unicode digits.
public static  booleanisNumericSpace(String str)
     Checks and answers if the given string contains only unicode digits or space (' ').
public static  booleanisPastDay(Date date)
     Determines and answers if the day of the given Date is in the past.
public static  booleanisToday(Date date)
     Determines and answers if the given Date is today.
public static  booleanisTomorrow(Date date)
     Determines and answers if the given Date is tomorrow.
public static  booleanisYesterday(Date date)
     Determines and answers if the given Date is yesterday.



Method Detail
equals
public static boolean equals(Object o1, Object o2)(Code)
Checks and answers if the two objects are both null or equal.
 ValidationUtils.equals(null, null)  == true
 ValidationUtils.equals("Hi", "Hi")  == true
 ValidationUtils.equals("Hi", null)  == false
 ValidationUtils.equals(null, "Hi")  == false
 ValidationUtils.equals("Hi", "Ho")  == false
 

Parameters:
  o1 - the first object to compare
Parameters:
  o2 - the second object to compare boolean true if and only ifboth objects are null or equal



getRelativeCalendar
public static Calendar getRelativeCalendar(int offsetDays)(Code)
Computes the day that has the given offset in days to today and returns it as an instance of Calendar.
Parameters:
  offsetDays - the offset in day relative to today a Calendar instance that is the begin of the daywith the specified offset



getRelativeCalendar
public static Calendar getRelativeCalendar(Calendar from, int offsetDays)(Code)
Computes the day that has the given offset in days from the specified from date and returns it as an instance of Calendar.
Parameters:
  from - the base date as Calendar instance
Parameters:
  offsetDays - the offset in day relative to today a Calendar instance that is the begin of the daywith the specified offset from the given day



getRelativeDate
public static Date getRelativeDate(int offsetDays)(Code)
Computes the day that has the given offset in days to today and returns it as an instance of Date.
Parameters:
  offsetDays - the offset in day relative to today the Date that is the begin of the daywith the specified offset



hasBoundedLength
public static boolean hasBoundedLength(String str, int min, int max)(Code)
Checks and answers if the length of the given string is in the bounds as specified by the interval [min, max]. Strings that are null or contain only blanks have length 0.
 ValidationUtils.hasBoundedLength(null,  1, 2) == false
 ValidationUtils.hasBoundedLength("",    1, 2) == false
 ValidationUtils.hasBoundedLength(" ",   1, 2) == false
 ValidationUtils.hasBoundedLength("   ", 1, 2) == false
 ValidationUtils.hasBoundedLength("Hi ", 1, 2) == true
 ValidationUtils.hasBoundedLength("Ewa", 1, 2) == false
 

Parameters:
  str - the string to check
Parameters:
  min - the minimum length
Parameters:
  max - the maximum length true if the length is in the interval,false otherwise
throws:
  IllegalArgumentException - if min > max



hasMaximumLength
public static boolean hasMaximumLength(String str, int max)(Code)
Checks and answers if the given string is shorter than the specified maximum length. Strings that are null or contain only blanks have length 0.
 ValidationUtils.hasMaximumLength(null,  2) == true
 ValidationUtils.hasMaximumLength("",    2) == true
 ValidationUtils.hasMaximumLength(" ",   2) == true
 ValidationUtils.hasMaximumLength("   ", 2) == true
 ValidationUtils.hasMaximumLength("Hi ", 2) == true
 ValidationUtils.hasMaximumLength("Ewa", 2) == false
 

Parameters:
  str - the string to check
Parameters:
  max - the maximum length true if the length is less than or equal to the minimum,false otherwise



hasMinimumLength
public static boolean hasMinimumLength(String str, int min)(Code)
Checks and answers if the given string has at least the specified minimum length. Strings that are null or contain only blanks have length 0.
 ValidationUtils.hasMinimumLength(null,  2) == false
 ValidationUtils.hasMinimumLength("",    2) == false
 ValidationUtils.hasMinimumLength(" ",   2) == false
 ValidationUtils.hasMinimumLength("   ", 2) == false
 ValidationUtils.hasMinimumLength("Hi ", 2) == true
 ValidationUtils.hasMinimumLength("Ewa", 2) == true
 

Parameters:
  str - the string to check
Parameters:
  min - the minimum length true if the length is greater or equal to the minimum,false otherwise



isAlpha
public static boolean isAlpha(String str)(Code)
Checks and answers if the given string contains only unicode letters. null returns false, an empty string ("") returns true.
 ValidationUtils.isAlpha(null)   == false
 ValidationUtils.isAlpha("")     == true
 ValidationUtils.isAlpha("   ")  == false
 ValidationUtils.isAlpha("abc")  == true
 ValidationUtils.isAlpha("ab c") == false
 ValidationUtils.isAlpha("ab2c") == false
 ValidationUtils.isAlpha("ab-c") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode letters,and is non-null
since:
   1.2



isAlphaSpace
public static boolean isAlphaSpace(String str)(Code)
Checks and answers if the given string contains only unicode letters and space (' '). null returns false, an empty string ("") returns true.
 ValidationUtils.isAlphaSpace(null)   == false
 ValidationUtils.isAlphaSpace("")     == true
 ValidationUtils.isAlphaSpace("   ")  == true
 ValidationUtils.isAlphaSpace("abc")  == true
 ValidationUtils.isAlphaSpace("ab c") == true
 ValidationUtils.isAlphaSpace("ab2c") == false
 ValidationUtils.isAlphaSpace("ab-c") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode lettersand space, and is non-null
since:
   1.2



isAlphanumeric
public static boolean isAlphanumeric(String str)(Code)
Checks and answers if the given string contains only unicode letters or digits. null returns false, an empty string ("") returns true.
 ValidationUtils.isAlphanumeric(null)   == false
 ValidationUtils.isAlphanumeric("")     == true
 ValidationUtils.isAlphanumeric("   ")  == false
 ValidationUtils.isAlphanumeric("abc")  == true
 ValidationUtils.isAlphanumeric("ab c") == false
 ValidationUtils.isAlphanumeric("ab2c") == true
 ValidationUtils.isAlphanumeric("ab-c") == false
 ValidationUtils.isAlphanumeric("123")  == true
 ValidationUtils.isAlphanumeric("12 3") == false
 ValidationUtils.isAlphanumeric("12-3") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode lettersor digits, and is non-null
since:
   1.2



isAlphanumericSpace
public static boolean isAlphanumericSpace(String str)(Code)
Checks and answers if the given string contains only unicode letters or digits or space (' '). null returns false, an empty string ("") returns true.
 ValidationUtils.isAlphanumericSpace(null)   == false
 ValidationUtils.isAlphanumericSpace("")     == true
 ValidationUtils.isAlphanumericSpace("   ")  == true
 ValidationUtils.isAlphanumericSpace("abc")  == true
 ValidationUtils.isAlphanumericSpace("ab c") == true
 ValidationUtils.isAlphanumericSpace("ab2c") == true
 ValidationUtils.isAlphanumericSpace("ab-c") == false
 ValidationUtils.isAlphanumericSpace("123")  == true
 ValidationUtils.isAlphanumericSpace("12 3") == true
 ValidationUtils.isAlphanumericSpace("12-3") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode letters,digits or space (' '), and is non-null
since:
   1.2



isBlank
public static boolean isBlank(String str)(Code)
Checks and answers if the given string is whitespace, empty ("") or null.
 ValidationUtils.isBlank(null)    == true
 ValidationUtils.isBlank("")      == true
 ValidationUtils.isBlank(" ")     == true
 ValidationUtils.isBlank(" abc")  == false
 ValidationUtils.isBlank("abc ")  == false
 ValidationUtils.isBlank(" abc ") == false
 

Parameters:
  str - the string to check, may be null true if the string is whitespace, emptyor null
See Also:   ValidationUtils.isEmpty(String)



isEmpty
public static boolean isEmpty(String str)(Code)
Checks and answers if the given string is empty ("") or null.
 ValidationUtils.isEmpty(null)  == true
 ValidationUtils.isEmpty("")    == true
 ValidationUtils.isEmpty(" ")   == false
 ValidationUtils.isEmpty("Hi ") == false
 

Parameters:
  str - the string to check, may be null true if the string is empty or null
See Also:   ValidationUtils.isBlank(String)



isFutureDay
public static boolean isFutureDay(Date date)(Code)
Determines and answers if the day of the given Date is in the future.
Parameters:
  date - the date to check true if in the future, false otherwise



isNotBlank
public static boolean isNotBlank(String str)(Code)
Checks and answers if the given string is not empty (""), not null and not whitespace only.
 ValidationUtils.isNotBlank(null)    == false
 ValidationUtils.isNotBlank("")      == false
 ValidationUtils.isNotBlank(" ")     == false
 ValidationUtils.isNotBlank(" abc")  == true
 ValidationUtils.isNotBlank("abc ")  == true
 ValidationUtils.isNotBlank(" abc ") == true
 

Parameters:
  str - the string to check, may be null true if the string is not emptyand not null and not whitespace only
See Also:   ValidationUtils.isEmpty(String)
since:
   1.2



isNotEmpty
public static boolean isNotEmpty(String str)(Code)
Checks and answers if the given string is not empty ("") and not null.
 ValidationUtils.isNotEmpty(null)  == false
 ValidationUtils.isNotEmpty("")    == false
 ValidationUtils.isNotEmpty(" ")   == true
 ValidationUtils.isNotEmpty("Hi")  == true
 ValidationUtils.isNotEmpty("Hi ") == true
 

Parameters:
  str - the string to check, may be null true if the string is not empty and not null
See Also:   ValidationUtils.isBlank(String)



isNumeric
public static boolean isNumeric(String str)(Code)
Checks and answers if the given string contains only unicode digits. A decimal point is not a unicode digit and returns false. null returns false, an empty string ("") returns true.
 ValidationUtils.isNumeric(null)   == false
 ValidationUtils.isNumeric("")     == true
 ValidationUtils.isNumeric("   ")  == false
 ValidationUtils.isNumeric("abc")  == false
 ValidationUtils.isNumeric("ab c") == false
 ValidationUtils.isNumeric("ab2c") == false
 ValidationUtils.isNumeric("ab-c") == false
 ValidationUtils.isNumeric("123")  == true
 ValidationUtils.isNumeric("12 3") == false
 ValidationUtils.isNumeric("12-3") == false
 ValidationUtils.isNumeric("12.3") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode digits,and is non-null
since:
   1.2



isNumericSpace
public static boolean isNumericSpace(String str)(Code)
Checks and answers if the given string contains only unicode digits or space (' '). A decimal point is not a unicode digit and returns false. null returns false, an empty string ("") returns true.
 ValidationUtils.isNumericSpace(null)   == false
 ValidationUtils.isNumericSpace("")     == true
 ValidationUtils.isNumericSpace("   ")  == true
 ValidationUtils.isNumericSpace("abc")  == false
 ValidationUtils.isNumericSpace("ab c") == false
 ValidationUtils.isNumericSpace("ab2c") == false
 ValidationUtils.isNumericSpace("ab-c") == false
 ValidationUtils.isNumericSpace("123")  == true
 ValidationUtils.isNumericSpace("12 3") == true
 ValidationUtils.isNumericSpace("12-3") == false
 ValidationUtils.isNumericSpace("12.3") == false
 

Parameters:
  str - the string to check, may be null true if the string contains only unicode digitsor space, and is non-null
since:
   1.2



isPastDay
public static boolean isPastDay(Date date)(Code)
Determines and answers if the day of the given Date is in the past.
Parameters:
  date - the date to check true if in the past, false otherwise



isToday
public static boolean isToday(Date date)(Code)
Determines and answers if the given Date is today.
Parameters:
  date - the date to check true if today, false otherwise



isTomorrow
public static boolean isTomorrow(Date date)(Code)
Determines and answers if the given Date is tomorrow.
Parameters:
  date - the date to check true if tomorrow, false otherwise



isYesterday
public static boolean isYesterday(Date date)(Code)
Determines and answers if the given Date is yesterday.
Parameters:
  date - the date to check true if yesterday, false otherwise



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.