Java Doc for ConversionUtilities.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » 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 » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.rave.web.ui.util.ConversionUtilities

ConversionUtilities
public class ConversionUtilities (Code)
The ConversionUtilities class provides utility method for converting values to and from Strings. Use this class if your component processes input from the user, or displays a converted value.




Method Summary
public static  ObjectconvertRenderedValue(FacesContext context, Object submittedValue, UIComponent component)
     Return the converted value of submittedValue. If submittedValue is null, return null. If submittedValue is "", check the rendered value.
public static  ObjectconvertValueToArray(UIComponent component, String[] rawValues, FacesContext context)
    

Convert a String array of submitted values to the appropriate type of Array for the value Object.

public static  ObjectconvertValueToList(UIComponent component, String[] rawValues, FacesContext context)
    

Convert a String array of submitted values to the appropriate type of List for the value Object.

public static  ObjectconvertValueToObject(UIComponent component, String rawValue, FacesContext context)
    

Convert the values of a component with a single (non-list, non-array) value.

public static  StringconvertValueToString(UIComponent component, Object realValue)
     Converts an Object (which may or may not be the value of the component) to a String using the converter associated with the component.
public static  ConvertergetConverterForClass(Class converterClass)
     This method retrieves an appropriate converter based on the type of an object.
static  voidlog(String s)
    
public static  voidremoveRenderedValue(UIComponent component)
     Remove the stored rendered value from the specified component.
public static  voidremoveSavedRenderedValueState(UIComponent component)
     Remove the storage for the "virtual" for the specified component used to save the rendered value for the "virtual" instances of this component when used in a table.
public static  booleanrenderedNull(UIComponent component)
     Return true if the stored rendered value on the specified component was null.
public static  voidrestoreRenderedValueState(FacesContext context, UIComponent component)
     Used to restore the rendered value when a component is used within a table.
public static  voidsaveRenderedValueState(FacesContext context, UIComponent component)
     Used to preserve the rendered value when a component is used within a table.
public static  voidsetRenderedValue(UIComponent component, Object value)
     Record the value being rendered.



Method Detail
convertRenderedValue
public static Object convertRenderedValue(FacesContext context, Object submittedValue, UIComponent component) throws ConverterException(Code)
Return the converted value of submittedValue. If submittedValue is null, return null. If submittedValue is "", check the rendered value. If the the value that was rendered was null, return null else continue to convert.



convertValueToArray
public static Object convertValueToArray(UIComponent component, String[] rawValues, FacesContext context) throws ConverterException(Code)

Convert a String array of submitted values to the appropriate type of Array for the value Object. This method assumes that the value binding for the value of the component has been determined to be an array (and as a consequence that the component implements ValueHolder).

To evaluate the valueBinding, use the ValueTypeEvaluator class.


Parameters:
  component - The component whose submitted values are to beconverted
Parameters:
  rawValues - The submitted value of the component
Parameters:
  context - The FacesContext of the request
See Also:   ValueTypeEvaluator
throws:
  ConverterException - if the conversion fails An array of converted values



convertValueToList
public static Object convertValueToList(UIComponent component, String[] rawValues, FacesContext context) throws ConverterException(Code)

Convert a String array of submitted values to the appropriate type of List for the value Object. This method assumes that the value binding for the value of the component has been determined to be a subclass of java.util.List, and as a consequence, that the component implements ValueHolder.

To evaluate the valueBinding, use the ValueTypeEvaluator class.


Parameters:
  component - The component whose submitted values are to beconverted
Parameters:
  rawValues - The submitted value of the component
Parameters:
  context - The FacesContext of the request
See Also:   ValueTypeEvaluator
throws:
  ConverterException - if the conversion fails A List of converted values



convertValueToObject
public static Object convertValueToObject(UIComponent component, String rawValue, FacesContext context) throws ConverterException(Code)

Convert the values of a component with a single (non-list, non-array) value. Use this method if

  • the component always binds the user input to a single object (e.g. a textfield component); or
  • to handle the single object case when the component may bind the user input to a single object or to a collection of objects (e.g. a list component). Use a ValueTypeEvaluator to evaluate the value binding type.

Parameters:
  component - The component whose value is getting converted
Parameters:
  rawValue - The submitted value of the component
Parameters:
  context - The FacesContext of the request
throws:
  ConverterException - if the conversion fails An Object representing the converted value. If rawValue ==null return null.
See Also:   ValueTypeEvaluator



convertValueToString
public static String convertValueToString(UIComponent component, Object realValue) throws ConverterException(Code)
Converts an Object (which may or may not be the value of the component) to a String using the converter associated with the component. This method can be used to convert the value of the component, or the value of an Object associated with the component, such as the objects representing the options for a listbox or a checkboxgroup.
Parameters:
  component - The component that needs to display the valueas a String
Parameters:
  realValue - The object that the component is to display
throws:
  ConverterException - if the conversion fails If converting the Object to a String fails



getConverterForClass
public static Converter getConverterForClass(Class converterClass)(Code)
This method retrieves an appropriate converter based on the type of an object.
Parameters:
  converterClass - The name of the converter class An instance of the appropriate converter type



log
static void log(String s)(Code)



removeRenderedValue
public static void removeRenderedValue(UIComponent component)(Code)
Remove the stored rendered value from the specified component.



removeSavedRenderedValueState
public static void removeSavedRenderedValueState(UIComponent component)(Code)
Remove the storage for the "virtual" for the specified component used to save the rendered value for the "virtual" instances of this component when used in a table.



renderedNull
public static boolean renderedNull(UIComponent component)(Code)
Return true if the stored rendered value on the specified component was null.



restoreRenderedValueState
public static void restoreRenderedValueState(FacesContext context, UIComponent component)(Code)
Used to restore the rendered value when a component is used within a table. Since there is only one component instance when used in a table column the rendered value must be maintained and restored for each "virtual" component instance for the rows in the column.
Parameters:
  context - The current FacesContext for this request.
Parameters:
  component - The component that is appearing in the table.



saveRenderedValueState
public static void saveRenderedValueState(FacesContext context, UIComponent component)(Code)
Used to preserve the rendered value when a component is used within a table. Since there is only one component instance when used in a table column the rendered value must be maintained for each "virtual" component instance for the rows in the column.
Parameters:
  context - The current FacesContext for this request.
Parameters:
  component - The component that is appearing in the table.



setRenderedValue
public static void setRenderedValue(UIComponent component, Object value)(Code)
Record the value being rendered.
Parameters:
  component - The component being rendered.
Parameters:
  value - The value being rendered.



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.