Java Doc for BooleanArrayConverter.java in  » Library » Apache-commons-beanutils-1.8.0-BETA-src » org » apache » commons » beanutils » converters » 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 » Library » Apache commons beanutils 1.8.0 BETA src » org.apache.commons.beanutils.converters 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.beanutils.converters.AbstractArrayConverter
      org.apache.commons.beanutils.converters.BooleanArrayConverter

BooleanArrayConverter
final public class BooleanArrayConverter extends AbstractArrayConverter (Code)

Standard org.apache.commons.beanutils.Converter implementation that converts an incoming String into a primitive array of boolean. On a conversion failure, returns a specified default value or throws a ConversionException depending on how this instance is constructed.

By default, the values to be converted are expected to be those recognised by a default instance of BooleanConverter. A customised BooleanConverter can be provided in order to recognise alternative values as true/false.


author:
   Craig R. McClanahan
version:
   $Revision: 556229 $ $Date: 2007-07-14 07:11:19 +0100 (Sat, 14 Jul 2007) $
since:
   1.4ArrayConverter


Field Summary
final public static  ClassMODEL
     Type which this class converts its input to.
final protected  BooleanConverterbooleanConverter
     This object is used to perform the conversion of individual strings into Boolean/boolean values.

Constructor Summary
public  BooleanArrayConverter()
     Create a org.apache.commons.beanutils.Converter that will throw a ConversionException if a conversion error occurs.
public  BooleanArrayConverter(Object defaultValue)
     Create a org.apache.commons.beanutils.Converter that will return the specified default value if a conversion error occurs.
public  BooleanArrayConverter(BooleanConverter converter, Object defaultValue)
     Create a org.apache.commons.beanutils.Converter that will return the specified default value if a conversion error occurs.

Conversion of strings to boolean values will be done via the specified converter.


Parameters:
  converter - is the converter object that will be used toconvert each input string-value into a boolean.
Parameters:
  defaultValue - is the default value to be returned by methodconvert if conversion fails; null is a valid default value.

Method Summary
public  Objectconvert(Class type, Object value)
     Convert the specified input object into an output object of type array-of-boolean.

If the input value is null, then the default value specified in the constructor is returned.


Field Detail
MODEL
final public static Class MODEL(Code)
Type which this class converts its input to. This value can be used as a parameter to the ConvertUtils.register method.



booleanConverter
final protected BooleanConverter booleanConverter(Code)
This object is used to perform the conversion of individual strings into Boolean/boolean values.




Constructor Detail
BooleanArrayConverter
public BooleanArrayConverter()(Code)
Create a org.apache.commons.beanutils.Converter that will throw a ConversionException if a conversion error occurs.

Conversion of strings to boolean values will be done via a default instance of class BooleanConverter.




BooleanArrayConverter
public BooleanArrayConverter(Object defaultValue)(Code)
Create a org.apache.commons.beanutils.Converter that will return the specified default value if a conversion error occurs.

Conversion of strings to boolean values will be done via a default instance of class BooleanConverter.


Parameters:
  defaultValue - The default value to be returned



BooleanArrayConverter
public BooleanArrayConverter(BooleanConverter converter, Object defaultValue)(Code)
Create a org.apache.commons.beanutils.Converter that will return the specified default value if a conversion error occurs.

Conversion of strings to boolean values will be done via the specified converter.


Parameters:
  converter - is the converter object that will be used toconvert each input string-value into a boolean.
Parameters:
  defaultValue - is the default value to be returned by methodconvert if conversion fails; null is a valid default value. See thedocumentation for method "convert" for more information.The value BooleanArrayConverter.NO_DEFAULT may be passed here tospecify that an exception should be thrown on conversion failure.




Method Detail
convert
public Object convert(Class type, Object value)(Code)
Convert the specified input object into an output object of type array-of-boolean.

If the input value is null, then the default value specified in the constructor is returned. If no such value was provided, then a ConversionException is thrown instead.

If the input value is of type String[] then the returned array shall be of the same size as this array, with a true or false value in each array element depending on the result of applying method BooleanConverter.convert to each string.

For all other types of value, the object's toString method is expected to return a string containing a comma-separated list of values, eg "true, false, true". See the documentation for AbstractArrayConverter.parseElements for more information on the exact formats supported.

If the result of value.toString() cannot be split into separate words, then the default value is also returned (or an exception thrown).

If any of the elements in the value array (or the elements resulting from splitting up value.toString) are not recognised by the BooleanConverter associated with this object, then what happens depends on whether that BooleanConverter has a default value or not: if it does, then that unrecognised element is converted into the BooleanConverter's default value. If the BooleanConverter does not have a default value, then the default value for this object is returned as the complete conversion result (not just for the element), or an exception is thrown if this object has no default value defined.


Parameters:
  type - is the type to which this value should be converted. In thecase of this BooleanArrayConverter class, this value is ignored.
Parameters:
  value - is the input value to be converted. an object of type boolean[], or the default value if there wasany sort of error during conversion and the constructorwas provided with a default value.
exception:
  ConversionException - if conversion cannot be performedsuccessfully and the constructor was not provided with a defaultvalue to return on conversion failure.
exception:
  NullPointerException - if value is an array, and any of thearray elements are null.



Fields inherited from org.apache.commons.beanutils.converters.AbstractArrayConverter
final public static Object NO_DEFAULT(Code)(Java Doc)
protected Object defaultValue(Code)(Java Doc)
protected static String[] strings(Code)(Java Doc)
protected boolean useDefault(Code)(Java Doc)

Methods inherited from org.apache.commons.beanutils.converters.AbstractArrayConverter
abstract public Object convert(Class type, Object value)(Code)(Java Doc)
protected List parseElements(String svalue)(Code)(Java Doc)

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.