Java Doc for Validator.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » 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 » sakai » org.sakaiproject.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.sakaiproject.util.Validator

Validator
public class Validator (Code)

Validator is utility class that helps to validate stuff.



Field Summary
final protected static  StringBLANK_MSG
    
final protected static  StringESCAPE_CHARS_IN_RESOURCE_ID
    
final protected static  StringESCAPE_URL
    
final protected static  StringESCAPE_URL_SPECIAL
    
final public static  StringINVALID_CHARS_IN_RESOURCE_ID
    
final protected static  StringINVALID_CHARS_IN_USER_ID
    
final protected static  StringINVALID_CHARS_IN_ZIP_ENTRY
    
final protected static  StringINVALID_MSG
    
final protected static  StringMAP_TO_A
    
final protected static  StringMAP_TO_B
    
final protected static  StringMAP_TO_C
    
final protected static  StringMAP_TO_E
    
final protected static  StringMAP_TO_I
    
final protected static  StringMAP_TO_L
    
final protected static  StringMAP_TO_N
    
final protected static  StringMAP_TO_O
    
final protected static  StringMAP_TO_U
    
final protected static  StringMAP_TO_X
    
final protected static  StringMAP_TO_Y
    
final protected static  StringVALID_EMAIL
    


Method Summary
public static  booleancheckDate(int day, int month, int year)
    
public static  booleancheckEmailLocal(String id)
    
public static  booleancheckResourceId(String id)
     Check for a valid resource id.
public static  booleancheckUserId(String id)
     Check for a valid user id.
public static  StringcleanInput(String value)
     Clean the user input string of strange newlines, etc.
Parameters:
  value - The user input string.
public static  StringescapeHtml(String value)
     Escape a plaintext string so that it can be output as part of an HTML document.
public static  StringescapeHtmlFixCopyright(String value)
     escapeHtml(), but also fix the case where we start with © and treat it as copyright (c) Note: ResourcesAction used to (before 1.1.05) place this as the copyright symbol.
public static  StringescapeHtmlFormattedText(String value)
     Escape HTML-formatted text in preparation to include it in an HTML document.
public static  StringescapeHtmlFormattedTextSupressNewlines(String value)
     Escape HTML-formatted text in preparation to include it in an HTML document, except that HTML line breaks ("<br />") will be supressed (removed).
public static  StringescapeHtmlFormattedTextarea(String value)
     Escapes the given HTML-formatted text for editing within the WYSIWYG editor.
public static  StringescapeHtmlSupressNewlines(String value)
     Escape a plaintext string so that it can be output as part of an HTML document, except that newlines are NOT escaped and therefore are treated as whitespace instead of displaying as line-breaks.
public static  StringescapeHtmlTextarea(String value)
     Escape plaintext for display inside a plain textarea.
public static  StringescapeJavascript(String value)
     Return a string based on value that is safe to place into a javascript / html identifier: anything not alphanumeric change to 'x'.
public static  StringescapeJsQuoted(String value)
     Return a string based on value that is safe to place into a javascript value that is in single quiotes.
Parameters:
  value - The string to escape.
public static  StringescapeQuestionMark(String id)
     Return a string based on id that is fully escaped the question mark.
Parameters:
  id - The string to escape.
public static  StringescapeResourceName(String id)
     Return a string based on id that is fully escaped using Resource name validity rules.
Parameters:
  id - The string to escape.
public static  StringescapeSql(String value)
     Return a string based on value that is safe to place into a sql statement: sql statements use the single quote, and this must be doubled as an escape.
Parameters:
  value - The string to escape.
public static  StringescapeUrl(String id)
     Return a string based on id that is fully escaped using URL rules, using a UTF-8 underlying encoding.
Parameters:
  id - The string to escape.
public static  StringescapeZipEntry(String id)
     Return a string based on id that is fully escaped to create a zip entry
Parameters:
  id - The string to escape.
public static  StringgetFileExtension(String fullName)
     Isolate and return just the file extension part of a full drive and path file name.
public static  StringgetFileName(String fullName)
     Isolate and return just the file name part of a full drive and path file name.
public static  StringgetFileSizeWithDividor(String size)
    
public static  StringgetResourceTarget(String contentType)
     Determine whether a file resource should be opened in the current window or a new window.
public static  booleanletBrowserInline(String type)
     Is this a mime type that the browser can handle inline, in a browser window? If so, links to this type should be to a _blank, and content-disposition should be inline.
public static  Stringlimit(String value, Integer length)
     Limit the string to a certain number of characters, adding "..." if it was truncated.
Parameters:
  value - The string to limit.
Parameters:
  the - length to limit to (as an Integer).
public static  Stringlimit(String value, int length)
     Limit the string to a certain number of characters, adding "..." if it was truncated
Parameters:
  value - The string to limit.
Parameters:
  the - length to limit to (as an int).
public static  StringlimitFormattedText(String value, int length)
     Limit the formatted to a certain number of DISPLAYED characters, adding "..." if it was truncated.
public static  StringstripAllNewlines(String value)
     Clean the string parameter of all newlines (replace with space character) and trim leading and trailing spaces
Parameters:
  value - The user input string.

Field Detail
BLANK_MSG
final protected static String BLANK_MSG(Code)



ESCAPE_CHARS_IN_RESOURCE_ID
final protected static String ESCAPE_CHARS_IN_RESOURCE_ID(Code)
These characters are allowed; but if escapeResourceName() is called, they are escaped (actually, removed) Certain characters cause problems with filenames in certain OSes - so get rid of these characters in filenames



ESCAPE_URL
final protected static String ESCAPE_URL(Code)
These characters are escaped when making a URL



ESCAPE_URL_SPECIAL
final protected static String ESCAPE_URL_SPECIAL(Code)
These can't be encoded in URLs safely even using %nn notation, so encode them using our own custom URL encoding, which the ParameterParser decodes



INVALID_CHARS_IN_RESOURCE_ID
final public static String INVALID_CHARS_IN_RESOURCE_ID(Code)
These characters are not allowed in a resource id



INVALID_CHARS_IN_USER_ID
final protected static String INVALID_CHARS_IN_USER_ID(Code)
These characters are not allowed in a user id



INVALID_CHARS_IN_ZIP_ENTRY
final protected static String INVALID_CHARS_IN_ZIP_ENTRY(Code)



INVALID_MSG
final protected static String INVALID_MSG(Code)



MAP_TO_A
final protected static String MAP_TO_A(Code)



MAP_TO_B
final protected static String MAP_TO_B(Code)



MAP_TO_C
final protected static String MAP_TO_C(Code)



MAP_TO_E
final protected static String MAP_TO_E(Code)



MAP_TO_I
final protected static String MAP_TO_I(Code)



MAP_TO_L
final protected static String MAP_TO_L(Code)



MAP_TO_N
final protected static String MAP_TO_N(Code)



MAP_TO_O
final protected static String MAP_TO_O(Code)



MAP_TO_U
final protected static String MAP_TO_U(Code)



MAP_TO_X
final protected static String MAP_TO_X(Code)



MAP_TO_Y
final protected static String MAP_TO_Y(Code)



VALID_EMAIL
final protected static String VALID_EMAIL(Code)
Valid special email local id characters (- those that are invalid resource ids)





Method Detail
checkDate
public static boolean checkDate(int day, int month, int year)(Code)
Validate whether the date input is valid



checkEmailLocal
public static boolean checkEmailLocal(String id)(Code)
Is this a valid local part of an email id?



checkResourceId
public static boolean checkResourceId(String id)(Code)
Check for a valid resource id. true if valid, false if not



checkUserId
public static boolean checkUserId(String id)(Code)
Check for a valid user id.
exception:
  IdInvalidException - if the id is invalid.



cleanInput
public static String cleanInput(String value)(Code)
Clean the user input string of strange newlines, etc.
Parameters:
  value - The user input string. value cleaned of string newlines, etc.



escapeHtml
public static String escapeHtml(String value)(Code)
Escape a plaintext string so that it can be output as part of an HTML document. Amperstand, greater-than, less-than, newlines, etc, will be escaped so that they display (instead of being interpreted as formatting).
Parameters:
  value - The string to escape. value fully escaped for HTML.



escapeHtmlFixCopyright
public static String escapeHtmlFixCopyright(String value)(Code)
escapeHtml(), but also fix the case where we start with © and treat it as copyright (c) Note: ResourcesAction used to (before 1.1.05) place this as the copyright symbol. -ggolden



escapeHtmlFormattedText
public static String escapeHtmlFormattedText(String value)(Code)
Escape HTML-formatted text in preparation to include it in an HTML document.



escapeHtmlFormattedTextSupressNewlines
public static String escapeHtmlFormattedTextSupressNewlines(String value)(Code)
Escape HTML-formatted text in preparation to include it in an HTML document, except that HTML line breaks ("<br />") will be supressed (removed).



escapeHtmlFormattedTextarea
public static String escapeHtmlFormattedTextarea(String value)(Code)
Escapes the given HTML-formatted text for editing within the WYSIWYG editor. All HTML meta-characters in the string (such as amperstand, less-than, etc), will be escaped.
Parameters:
  value - The formatted text to escape The string to use as the value of the formatted textarea widget



escapeHtmlSupressNewlines
public static String escapeHtmlSupressNewlines(String value)(Code)
Escape a plaintext string so that it can be output as part of an HTML document, except that newlines are NOT escaped and therefore are treated as whitespace instead of displaying as line-breaks. Amperstand, greater-than, less-than, etc, will be escaped so that they display (instead of being interpreted as formatting).
Parameters:
  value - The string to escape. value fully escaped for HTML.



escapeHtmlTextarea
public static String escapeHtmlTextarea(String value)(Code)
Escape plaintext for display inside a plain textarea.



escapeJavascript
public static String escapeJavascript(String value)(Code)
Return a string based on value that is safe to place into a javascript / html identifier: anything not alphanumeric change to 'x'. If the first character is not alphabetic, a letter 'i' is prepended.
Parameters:
  value - The string to escape. value fully escaped using javascript / html identifier rules.



escapeJsQuoted
public static String escapeJsQuoted(String value)(Code)
Return a string based on value that is safe to place into a javascript value that is in single quiotes.
Parameters:
  value - The string to escape. value escaped.



escapeQuestionMark
public static String escapeQuestionMark(String id)(Code)
Return a string based on id that is fully escaped the question mark.
Parameters:
  id - The string to escape. id fully escaped question mark.



escapeResourceName
public static String escapeResourceName(String id)(Code)
Return a string based on id that is fully escaped using Resource name validity rules.
Parameters:
  id - The string to escape. id fully escaped using Resource name validity rules.



escapeSql
public static String escapeSql(String value)(Code)
Return a string based on value that is safe to place into a sql statement: sql statements use the single quote, and this must be doubled as an escape.
Parameters:
  value - The string to escape. value escaped.



escapeUrl
public static String escapeUrl(String id)(Code)
Return a string based on id that is fully escaped using URL rules, using a UTF-8 underlying encoding.
Parameters:
  id - The string to escape. id fully escaped using URL rules.



escapeZipEntry
public static String escapeZipEntry(String id)(Code)
Return a string based on id that is fully escaped to create a zip entry
Parameters:
  id - The string to escape. id fully escaped to create a zip entry



getFileExtension
public static String getFileExtension(String fullName)(Code)
Isolate and return just the file extension part of a full drive and path file name.
Parameters:
  fullName - The full file name from a local os file system (mac, unix, windoze) Just the extension of the file, to the right of the dot, not including the dot, or blank if none.



getFileName
public static String getFileName(String fullName)(Code)
Isolate and return just the file name part of a full drive and path file name.
Parameters:
  fullName - The full file name from a local os file system (mac, unix, windoze) Just the name (and extension) of the file, without the drive or path.



getFileSizeWithDividor
public static String getFileSizeWithDividor(String size)(Code)
Put the dividor (comma) inside the size string, for example, 1,003 for 1003
Parameters:
  size - The string of size number The size string with the dividor added



getResourceTarget
public static String getResourceTarget(String contentType)(Code)
Determine whether a file resource should be opened in the current window or a new window.
Parameters:
  contentType - The content type to check A string identifying the window in which to open the resource: "_self" to open the resource in the current window, "_blank" for a new window, or an empty string if the resource is not a file.



letBrowserInline
public static boolean letBrowserInline(String type)(Code)
Is this a mime type that the browser can handle inline, in a browser window? If so, links to this type should be to a _blank, and content-disposition should be inline. If not, links to this type should be to _self, and content-disposition should be attachment.
Parameters:
  type - The mime type to check. true if this type of resource the browser can handle in line, false if not.



limit
public static String limit(String value, Integer length)(Code)
Limit the string to a certain number of characters, adding "..." if it was truncated.
Parameters:
  value - The string to limit.
Parameters:
  the - length to limit to (as an Integer). The limited string.



limit
public static String limit(String value, int length)(Code)
Limit the string to a certain number of characters, adding "..." if it was truncated
Parameters:
  value - The string to limit.
Parameters:
  the - length to limit to (as an int). The limited string.



limitFormattedText
public static String limitFormattedText(String value, int length)(Code)
Limit the formatted to a certain number of DISPLAYED characters, adding "..." if it was truncated. For example, trim("Hello \n<b>World</b>!", 7) returns "Hello \n<b>W</b>..."
Parameters:
  value - The formatted text to limit.
Parameters:
  the - length to limit to (as an int). The limited string.



stripAllNewlines
public static String stripAllNewlines(String value)(Code)
Clean the string parameter of all newlines (replace with space character) and trim leading and trailing spaces
Parameters:
  value - The user input string. value cleaned of newlines, etc.



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.