Java Doc for FxFormatUtils.java in  » J2EE » fleXive » com » flexive » shared » 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 » J2EE » fleXive » com.flexive.shared 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.shared.FxFormatUtils

FxFormatUtils
final public class FxFormatUtils (Code)
Miscellaneous formatting utility functions.
author:
   Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
author:
   Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)




Method Summary
public static  StringcolorCodeToStyle(String code)
     Converts "#FF0000" or "FF0000" rgb values to style="color:#FF0000" and all other style values to class="XXX".
public static  StringencodeHex(byte[] bytes)
     Turns an array of bytes into a String representing each byte as an unsigned hex number.
public static  StringencodePassword(long accountId, String password)
     Checks the password and encodes it.
public static  StringescapeForJavaScript(String value, boolean replaceNewlines, boolean filterHtml)
     Escape text content for output in a javascript function call parameter, based on the Struts TagUtils#filter function.
public static  StringescapeForJavaScript(String value, boolean replaceNewlines)
     Escape text content for output in a javascript function call parameter.
Parameters:
  value - the text content
Parameters:
  replaceNewlines - replaces linebreaks with html
tags if set to true,or simply removes them (replaces them with spaces) if set to false.
public static  StringescapeForJavaScript(String value)
     Escape text content for output in a javascript function call parameter.
public static  StringescapeForSql(Object value)
     Generic SQL escape method.
public static  StringescapeTreePath(String path)
    
public static  StringformatResource(String resource, long languageId, Object... values)
     Format a resource, replacing all {x} by the appropriate value in values.
public static  SimpleDateFormatgetDateFormat()
     Returns a basic date format that is readable but not localized.
public static  SimpleDateFormatgetDateTimeFormat()
     Returns a basic date/time format that is readable but not localized.
public static  StringisEmail(String email)
     Checks the email.
public static  booleanisQuoted(String value)
    
public static  booleanisRGBCode(String value)
     Checks if a value is a RGB color code.
public static  StringprocessColorString(String paramName, String value)
     Check if a color value is valid.
public static  DatetoDate(String date, Locale locale)
    
public static  StringtoString(Date date, Locale locale)
    
public static  Stringunquote(String value)
    



Method Detail
colorCodeToStyle
public static String colorCodeToStyle(String code)(Code)
Converts "#FF0000" or "FF0000" rgb values to style="color:#FF0000" and all other style values to class="XXX".
Parameters:
  code - the color code the style or class value



encodeHex
public static String encodeHex(byte[] bytes)(Code)
Turns an array of bytes into a String representing each byte as an unsigned hex number.
Parameters:
  bytes - an array of bytes to convert to a hex-string generated hex string



encodePassword
public static String encodePassword(long accountId, String password) throws FxInvalidParameterException(Code)
Checks the password and encodes it.
Parameters:
  accountId - the account ID (needed for computing the hash)
Parameters:
  password - unencoded the password the encoded password
throws:
  FxInvalidParameterException - if the password is invalid (too short, too simple, ..)



escapeForJavaScript
public static String escapeForJavaScript(String value, boolean replaceNewlines, boolean filterHtml)(Code)
Escape text content for output in a javascript function call parameter, based on the Struts TagUtils#filter function.
Parameters:
  value - the text content
Parameters:
  replaceNewlines - replaces linebreaks with html
tags if set to true,or simply removes them (replaces them with spaces) if set to false.
Parameters:
  filterHtml - filter html? the escaped text



escapeForJavaScript
public static String escapeForJavaScript(String value, boolean replaceNewlines)(Code)
Escape text content for output in a javascript function call parameter.
Parameters:
  value - the text content
Parameters:
  replaceNewlines - replaces linebreaks with html
tags if set to true,or simply removes them (replaces them with spaces) if set to false. the escaped text



escapeForJavaScript
public static String escapeForJavaScript(String value)(Code)
Escape text content for output in a javascript function call parameter.
Parameters:
  value - the text content the escaped text



escapeForSql
public static String escapeForSql(Object value)(Code)
Generic SQL escape method.
Parameters:
  value - the value to be formatted the formatted value



escapeTreePath
public static String escapeTreePath(String path)(Code)
Escape a path to allow only a-zA-Z0-9/ and replace all other letters with underscores (_)
Parameters:
  path - the path to escape escaped path



formatResource
public static String formatResource(String resource, long languageId, Object... values)(Code)
Format a resource, replacing all {x} by the appropriate value in values. If values is an instance of FxString the given localeId is used
Parameters:
  resource - String containing {0}..{n} placeholders
Parameters:
  languageId - used locale if values contain FxString instances
Parameters:
  values - either FxString, FxException or any Object using toString() formatted resource



getDateFormat
public static SimpleDateFormat getDateFormat()(Code)
Returns a basic date format that is readable but not localized. a basic date format that is readable but not localized.



getDateTimeFormat
public static SimpleDateFormat getDateTimeFormat()(Code)
Returns a basic date/time format that is readable but not localized. a basic date/time format that is readable but not localized.



isEmail
public static String isEmail(String email) throws FxInvalidParameterException(Code)
Checks the email.
Parameters:
  email - the email to check the email without whitespaces
throws:
  com.flexive.shared.exceptions.FxInvalidParameterException - if the email is invalid



isQuoted
public static boolean isQuoted(String value)(Code)
Is the value quoted by ' or " ?
Parameters:
  value - value to check if quoted by ' or " ?



isRGBCode
public static boolean isRGBCode(String value)(Code)
Checks if a value is a RGB color code.

The RGB color code my start with a '#', but is also recognized without it.
Parameters:
  value - the string to check true if the value is a valid RGB color code




processColorString
public static String processColorString(String paramName, String value) throws FxInvalidParameterException(Code)
Check if a color value is valid.

The color may be a RGB value (recognized by a starting '#') or a css class name.
The function returns the default color if value is empty.
If the value defines a invalid RGB value a FxInvalidParameterException is thrown.

Parameters:
  paramName - the name of the parameter that is used when a FxInvalidParameterException is thrown
Parameters:
  value - the color alue the (corrected) color
throws:
  FxInvalidParameterException - if the color is invalid




toDate
public static Date toDate(String date, Locale locale) throws ParseException(Code)



toString
public static String toString(Date date, Locale locale)(Code)



unquote
public static String unquote(String value)(Code)
Unquote a quoted value
Parameters:
  value - value to unquote unquoted calue



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.