Java Doc for StringArrayConverter.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.StringArrayConverter

StringArrayConverter
final public class StringArrayConverter extends AbstractArrayConverter (Code)
Standard org.apache.commons.beanutils.Converter implementation that converts an incoming String into an array of String objects. On a conversion failure, returns a specified default value or throws a ConversionException depending on how this instance is constructed.

There is also some special handling where the input is of type int[]. See method convert for more details.
author:
   Craig R. McClanahan
version:
   $Revision: 556229 $ $Date: 2007-07-14 07:11:19 +0100 (Sat, 14 Jul 2007) $
since:
   1.4ArrayConverter




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

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

If the value is already of type String[] then it is simply returned unaltered.

If the value is of type int[], then a String[] is returned where each element in the string array is the result of calling Integer.toString on the corresponding element of the int array.



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



StringArrayConverter
public StringArrayConverter(Object defaultValue)(Code)
Create a org.apache.commons.beanutils.Converter that will return the specified default value if a conversion error occurs.
Parameters:
  defaultValue - The default value to be returned




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

If the value is already of type String[] then it is simply returned unaltered.

If the value is of type int[], then a String[] is returned where each element in the string array is the result of calling Integer.toString on the corresponding element of the int array. This was added as a result of bugzilla request #18297 though there is not complete agreement that this feature should have been added.

In all other cases, this method calls toString on the input object, then assumes the result is a comma-separated list of values. The values are split apart into the individual items and returned as the elements of an array. See class AbstractArrayConverter for the exact input formats supported.
Parameters:
  type - is the data type to which this value should be converted.It is expected to be the class for type String[] (though this parameteris actually ignored by this method).
Parameters:
  value - is the input value to be converted. If null then thedefault value is returned or an exception thrown if no default valueexists. the converted value
exception:
  ConversionException - if conversion cannot be performedsuccessfully, or the input is null and there is no default value setfor this object.




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.