Java Doc for PropertyConverter.java in  » Library » Apache-commons-configuration-1.4-src » org » apache » commons » configuration » 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 configuration 1.4 src » org.apache.commons.configuration 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.configuration.PropertyConverter

PropertyConverter
final public class PropertyConverter (Code)
A utility class to convert the configuration properties into any type.
author:
   Emmanuel Bourg
version:
   $Revision: 490321 $, $Date: 2006-12-26 17:19:07 +0100 (Di, 26 Dez 2006) $
since:
   1.1


Field Summary
final static  StringLIST_ESCAPE
     Constant for the list delimiter escaping character.


Method Summary
public static  StringescapeDelimiters(String s, char delimiter)
     Escapes the delimiters that might be contained in the given string.
public static  Objectinterpolate(Object value, AbstractConfiguration config)
     Performs interpolation of the specified value.
public static  Listsplit(String s, char delimiter)
     Split a string on the specified delimiter.
public static  BigDecimaltoBigDecimal(Object value)
     Convert the specified object into a BigDecimal.
public static  BigIntegertoBigInteger(Object value)
     Convert the specified object into a BigInteger.
public static  BooleantoBoolean(Object value)
     Convert the specified object into a Boolean.
public static  BytetoByte(Object value)
     Convert the specified object into a Byte.
public static  CalendartoCalendar(Object value, String format)
     Convert the specified object into a Calendar.
public static  ColortoColor(Object value)
     Convert the specified object into a Color.
public static  DatetoDate(Object value, String format)
     Convert the specified object into a Date.
public static  DoubletoDouble(Object value)
     Convert the specified object into a Double.
public static  FloattoFloat(Object value)
     Convert the specified object into a Float.
public static  IntegertoInteger(Object value)
     Convert the specified object into an Integer.
public static  IteratortoIterator(Object value, char delimiter)
     Return an iterator over the simple values of a composite value.
public static  LocaletoLocale(Object value)
     Convert the specified object into a Locale.
public static  LongtoLong(Object value)
     Convert the specified object into a Long.
static  NumbertoNumber(Object value, Class targetClass)
     Tries to convert the specified object into a number object.
public static  ShorttoShort(Object value)
     Convert the specified object into a Short.
public static  URLtoURL(Object value)
     Convert the specified object into an URL.

Field Detail
LIST_ESCAPE
final static String LIST_ESCAPE(Code)
Constant for the list delimiter escaping character.





Method Detail
escapeDelimiters
public static String escapeDelimiters(String s, char delimiter)(Code)
Escapes the delimiters that might be contained in the given string. This method ensures that list delimiter characters that are part of a property's value are correctly escaped when a configuration is saved to a file. Otherwise when loaded again the property will be treated as a list property.
Parameters:
  s - the string with the value
Parameters:
  delimiter - the list delimiter to use the correctly esaped string



interpolate
public static Object interpolate(Object value, AbstractConfiguration config)(Code)
Performs interpolation of the specified value. This method checks if the given value contains variables of the form ${...}. If this is the case, all occurrances will be substituted by their current values.
Parameters:
  value - the value to be interpolated
Parameters:
  config - the current configuration object the interpolated value



split
public static List split(String s, char delimiter)(Code)
Split a string on the specified delimiter. To be removed when commons-lang has a better replacement available (Tokenizer?). todo: replace with a commons-lang equivalent
Parameters:
  s - the string to split
Parameters:
  delimiter - the delimiter a list with the single tokens



toBigDecimal
public static BigDecimal toBigDecimal(Object value) throws ConversionException(Code)
Convert the specified object into a BigDecimal.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a BigDecimal



toBigInteger
public static BigInteger toBigInteger(Object value) throws ConversionException(Code)
Convert the specified object into a BigInteger.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a BigInteger



toBoolean
public static Boolean toBoolean(Object value) throws ConversionException(Code)
Convert the specified object into a Boolean. Internally the org.apache.commons.lang.BooleanUtils class from the Commons Lang project is used to perform this conversion. This class accepts some more tokens for the boolean value of true, e.g. yes and on. Please refer to the documentation of this class for more details.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a boolean



toByte
public static Byte toByte(Object value) throws ConversionException(Code)
Convert the specified object into a Byte.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a byte



toCalendar
public static Calendar toCalendar(Object value, String format) throws ConversionException(Code)
Convert the specified object into a Calendar.
Parameters:
  value - the value to convert
Parameters:
  format - the DateFormat pattern to parse String values the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Calendar



toColor
public static Color toColor(Object value) throws ConversionException(Code)
Convert the specified object into a Color. If the value is a String, the format allowed is (#)?[0-9A-F]{6}([0-9A-F]{2})?. Examples:
  • FF0000 (red)
  • 0000FFA0 (semi transparent blue)
  • #CCCCCC (gray)
  • #00FF00A0 (semi transparent green)

Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Color



toDate
public static Date toDate(Object value, String format) throws ConversionException(Code)
Convert the specified object into a Date.
Parameters:
  value - the value to convert
Parameters:
  format - the DateFormat pattern to parse String values the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Calendar



toDouble
public static Double toDouble(Object value) throws ConversionException(Code)
Convert the specified object into a Double.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Double



toFloat
public static Float toFloat(Object value) throws ConversionException(Code)
Convert the specified object into a Float.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Float



toInteger
public static Integer toInteger(Object value) throws ConversionException(Code)
Convert the specified object into an Integer.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to an integer



toIterator
public static Iterator toIterator(Object value, char delimiter)(Code)
Return an iterator over the simple values of a composite value. The value specified is handled depending on its type:
  • Strings are checked for delimiter characters and splitted if necessary.
  • For collections the single elements are checked.
  • Arrays are treated like collections.
  • All other types are directly inserted.
  • Recursive combinations are supported, e.g. a collection containing array that contain strings.

Parameters:
  value - the value to "split"
Parameters:
  delimiter - the delimiter for String values an iterator for accessing the single values



toLocale
public static Locale toLocale(Object value) throws ConversionException(Code)
Convert the specified object into a Locale.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Locale



toLong
public static Long toLong(Object value) throws ConversionException(Code)
Convert the specified object into a Long.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a Long



toNumber
static Number toNumber(Object value, Class targetClass) throws ConversionException(Code)
Tries to convert the specified object into a number object. This method is used by the conversion methods for number types. Note that the return value is not in always of the specified target class, but only if a new object has to be created.
Parameters:
  value - the value to be converted (must not be null)
Parameters:
  targetClass - the target class of the conversion (must be derivedfrom java.lang.Number) the converted number
throws:
  ConversionException - if the object cannot be converted



toShort
public static Short toShort(Object value) throws ConversionException(Code)
Convert the specified object into a Short.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to a short



toURL
public static URL toURL(Object value) throws ConversionException(Code)
Convert the specified object into an URL.
Parameters:
  value - the value to convert the converted value
throws:
  ConversionException - thrown if the value cannot be converted to an URL



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.