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

All known Subclasses:   org.apache.commons.beanutils.converters.FloatArrayConverter,  org.apache.commons.beanutils.converters.ShortArrayConverter,  org.apache.commons.beanutils.converters.BooleanArrayConverter,  org.apache.commons.beanutils.converters.IntegerArrayConverter,  org.apache.commons.beanutils.converters.LongArrayConverter,  org.apache.commons.beanutils.converters.CharacterArrayConverter,  org.apache.commons.beanutils.converters.DoubleArrayConverter,  org.apache.commons.beanutils.converters.ByteArrayConverter,  org.apache.commons.beanutils.converters.StringArrayConverter,
AbstractArrayConverter
abstract public class AbstractArrayConverter implements Converter(Code)

Convenience base class for converters that translate the String representation of an array into a corresponding array of primitives object. This class encapsulates the functionality required to parse the String into a list of String elements that can later be individually converted to the appropriate primitive type.

The input syntax accepted by the parseElements() method is designed to be compatible with the syntax used to initialize arrays in a Java source program, except that only String literal values are supported. For maximum flexibility, the surrounding '{' and '}' characters are optional, and individual elements may be separated by any combination of whitespace and comma characters.


author:
   Craig R. McClanahan
version:
   $Revision: 557808 $ $Date: 2007-07-20 00:05:03 +0100 (Fri, 20 Jul 2007) $
since:
   1.4ArrayConverter


Field Summary
final public static  ObjectNO_DEFAULT
     This is a special reference that can be passed as the "default object" to the constructor to indicate that no default is desired.
protected  ObjectdefaultValue
     The default value specified to our Constructor, if any.
protected static  String[]strings
    
protected  booleanuseDefault
    

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

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

Parse an incoming String of the form similar to an array initializer in the Java language into a List individual Strings for each element, according to the following rules.

  • The string is expected to be a comma-separated list of values.
  • The string may optionally have matching '{' and '}' delimiters around the list.
  • Whitespace before and after each element is stripped.
  • Elements in the list may be delimited by single or double quotes.

Field Detail
NO_DEFAULT
final public static Object NO_DEFAULT(Code)
This is a special reference that can be passed as the "default object" to the constructor to indicate that no default is desired. Note that the value 'null' cannot be used for this purpose, as the caller may want a null to be returned as the default.



defaultValue
protected Object defaultValue(Code)
The default value specified to our Constructor, if any.



strings
protected static String[] strings(Code)

Model object for string arrays.




useDefault
protected boolean useDefault(Code)
Should we return the default value on conversion errors?




Constructor Detail
AbstractArrayConverter
public AbstractArrayConverter()(Code)
Create a Converter that will throw a ConversionException if a conversion error occurs.



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




Method Detail
convert
abstract public Object convert(Class type, Object value)(Code)
Convert the specified input object into an output object of the specified type. This method must be implemented by a concrete subclass.
Parameters:
  type - Data type to which this value should be converted
Parameters:
  value - The input value to be converted The converted value
exception:
  ConversionException - if conversion cannot be performedsuccessfully



parseElements
protected List parseElements(String svalue)(Code)

Parse an incoming String of the form similar to an array initializer in the Java language into a List individual Strings for each element, according to the following rules.

  • The string is expected to be a comma-separated list of values.
  • The string may optionally have matching '{' and '}' delimiters around the list.
  • Whitespace before and after each element is stripped.
  • Elements in the list may be delimited by single or double quotes. Within a quoted elements, the normal Java escape sequences are valid.

Parameters:
  svalue - String value to be parsed The parsed list of String values
exception:
  ConversionException - if the syntax of svalueis not syntactically valid
exception:
  NullPointerException - if svalueis null



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.