Java Doc for StringValue.java in  » J2EE » wicket » org » apache » wicket » util » string » 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 » J2EE » wicket » org.apache.wicket.util.string 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.wicket.util.string.StringValue

All known Subclasses:   org.apache.wicket.util.lang.EnumeratedType,
StringValue
public class StringValue implements IClusterable(Code)
Holds an immutable String value and optionally a Locale, with methods to convert to various types. Also provides some handy parsing methods and a variety of static factory methods.

Objects can be constructed directly from Strings or by using the valueOf() static factory methods. The repeat() static factory methods provide a way of generating a String value that repeats a given char or String a number of times.

Conversions to a wide variety of types can be found in the to*() methods. A generic conversion can be achieved with to(Class).

The beforeFirst(), afterFirst(), beforeLast() and afterLast() methods are handy for parsing things like paths and filenames.
author:
   Jonathan Locke




Constructor Summary
protected  StringValue(String text)
     Private constructor to force use of static factory methods.
protected  StringValue(String text, Locale locale)
     Private constructor to force use of static factory methods.

Method Summary
final public  StringafterFirst(char c)
     Gets the substring after the first occurence given char.
final public  StringafterLast(char c)
     Gets the substring after the last occurence given char.
final public  StringbeforeFirst(char c)
     Gets the substring before the first occurence given char.
final public  StringbeforeLast(char c)
     Gets the substring before the last occurence given char.
public static  StringValuerepeat(int times, char c)
    
public static  StringValuerepeat(int times, String s)
    
final public  CharSequencereplaceAll(CharSequence searchFor, CharSequence replaceWith)
     Replaces on this text.
final public  Objectto(Class type)
     Converts this StringValue to a given type.
final public  booleantoBoolean()
     Convert this text to a boolean.
final public  booleantoBoolean(boolean defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  BooleantoBooleanObject()
     Convert this text to a boolean and convert unchecked NumberFormatExceptions to checked.
final public  chartoChar()
     Convert this text to a char.
final public  chartoChar(char defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  CharactertoCharacter()
     Convert this text to a Character and convert unchecked NumberFormatExceptions to checked.
final public  doubletoDouble()
     Convert this text to a double and convert unchecked NumberFormatExceptions to checked.
final public  doubletoDouble(double defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  DoubletoDoubleObject()
     Convert this text to a Double and convert unchecked NumberFormatExceptions to checked.
final public  DurationtoDuration()
     Convert this text to a Duration instance and convert unchecked NumberFormatExceptions to checked.
final public  DurationtoDuration(Duration defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  inttoInt()
     Convert this text to an int and convert unchecked NumberFormatExceptions to checked.
final public  inttoInt(int defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  IntegertoInteger()
     Convert this text to an Integer and convert unchecked NumberFormatExceptions to checked.
final public  longtoLong()
     Convert this text to a long and convert unchecked NumberFormatExceptions to checked.
final public  longtoLong(long defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  LongtoLongObject()
     Convert this text to a Long and convert unchecked NumberFormatExceptions to checked.
final public  BooleantoOptionalBoolean()
     Convert to object types, returning null if text is null.
final public  CharactertoOptionalCharacter()
     Convert to object types, returning null if text is null.
final public  DoubletoOptionalDouble()
     Convert to object types, returning null if text is null.
final public  DurationtoOptionalDuration()
     Convert to object types, returning null if text is null.
final public  IntegertoOptionalInteger()
     Convert to object types, returning null if text is null.
final public  LongtoOptionalLong()
     Convert to object types, returning null if text is null.
final public  StringtoOptionalString()
     Convert to object types, returning null if text is null.
final public  TimetoOptionalTime()
     Convert to object types, returning null if text is null.
final public  StringtoString()
    
final public  StringtoString(String defaultValue)
     Convert to primitive types, returning default value if text is null.
final public  TimetoTime()
     Convert this text to a time instance and convert unchecked NumberFormatExceptions to checked.
final public  TimetoTime(Time defaultValue)
     Convert to primitive types, returning default value if text is null.
public static  StringValuevalueOf(double value)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(double value, int places, Locale locale)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(double value, Locale locale)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(Object object)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(Object object, Locale locale)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(String string)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(String string, Locale locale)
     Converts the given input to an instance of StringValue.
public static  StringValuevalueOf(AppendingStringBuffer buffer)
     Converts the given input to an instance of StringValue.


Constructor Detail
StringValue
protected StringValue(String text)(Code)
Private constructor to force use of static factory methods.
Parameters:
  text - The text for this string value



StringValue
protected StringValue(String text, Locale locale)(Code)
Private constructor to force use of static factory methods.
Parameters:
  text - The text for this string value
Parameters:
  locale - the locale for formatting and parsing




Method Detail
afterFirst
final public String afterFirst(char c)(Code)
Gets the substring after the first occurence given char.
Parameters:
  c - char to scan for the substring



afterLast
final public String afterLast(char c)(Code)
Gets the substring after the last occurence given char.
Parameters:
  c - char to scan for the substring



beforeFirst
final public String beforeFirst(char c)(Code)
Gets the substring before the first occurence given char.
Parameters:
  c - char to scan for the substring



beforeLast
final public String beforeLast(char c)(Code)
Gets the substring before the last occurence given char.
Parameters:
  c - char to scan for the substring



repeat
public static StringValue repeat(int times, char c)(Code)

Parameters:
  times - Number of times to repeat character
Parameters:
  c - Character to repeat Repeated character string



repeat
public static StringValue repeat(int times, String s)(Code)

Parameters:
  times - Number of times to repeat string
Parameters:
  s - String to repeat Repeated character string



replaceAll
final public CharSequence replaceAll(CharSequence searchFor, CharSequence replaceWith)(Code)
Replaces on this text.
Parameters:
  searchFor - What to search for
Parameters:
  replaceWith - What to replace with This string value with searchFor replaces with replaceWith



to
final public Object to(Class type) throws StringValueConversionException(Code)
Converts this StringValue to a given type.
Parameters:
  type - The type to convert to The converted value
throws:
  StringValueConversionException -



toBoolean
final public boolean toBoolean() throws StringValueConversionException(Code)
Convert this text to a boolean. This string value as a boolean
throws:
  StringValueConversionException -



toBoolean
final public boolean toBoolean(boolean defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toBooleanObject
final public Boolean toBooleanObject() throws StringValueConversionException(Code)
Convert this text to a boolean and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toChar
final public char toChar() throws StringValueConversionException(Code)
Convert this text to a char. This string value as a character
throws:
  StringValueConversionException -



toChar
final public char toChar(char defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toCharacter
final public Character toCharacter() throws StringValueConversionException(Code)
Convert this text to a Character and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toDouble
final public double toDouble() throws StringValueConversionException(Code)
Convert this text to a double and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toDouble
final public double toDouble(double defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toDoubleObject
final public Double toDoubleObject() throws StringValueConversionException(Code)
Convert this text to a Double and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toDuration
final public Duration toDuration() throws StringValueConversionException(Code)
Convert this text to a Duration instance and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toDuration
final public Duration toDuration(Duration defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toInt
final public int toInt() throws StringValueConversionException(Code)
Convert this text to an int and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toInt
final public int toInt(int defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toInteger
final public Integer toInteger() throws StringValueConversionException(Code)
Convert this text to an Integer and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toLong
final public long toLong() throws StringValueConversionException(Code)
Convert this text to a long and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toLong
final public long toLong(long defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



toLongObject
final public Long toLongObject() throws StringValueConversionException(Code)
Convert this text to a Long and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toOptionalBoolean
final public Boolean toOptionalBoolean() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalCharacter
final public Character toOptionalCharacter() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalDouble
final public Double toOptionalDouble() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalDuration
final public Duration toOptionalDuration() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalInteger
final public Integer toOptionalInteger() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalLong
final public Long toOptionalLong() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toOptionalString
final public String toOptionalString()(Code)
Convert to object types, returning null if text is null. converted



toOptionalTime
final public Time toOptionalTime() throws StringValueConversionException(Code)
Convert to object types, returning null if text is null. converted
throws:
  StringValueConversionException -



toString
final public String toString()(Code)
The string value



toString
final public String toString(String defaultValue)(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null



toTime
final public Time toTime() throws StringValueConversionException(Code)
Convert this text to a time instance and convert unchecked NumberFormatExceptions to checked. Converted text
throws:
  StringValueConversionException -



toTime
final public Time toTime(Time defaultValue) throws StringValueConversionException(Code)
Convert to primitive types, returning default value if text is null.
Parameters:
  defaultValue - the default value to return of text is null the converted text as a primitive or the default if text is null
throws:
  StringValueConversionException -



valueOf
public static StringValue valueOf(double value)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  value - Double precision value String value formatted with one place after decimal



valueOf
public static StringValue valueOf(double value, int places, Locale locale)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  value - Double precision value
Parameters:
  places - Number of places after decimal
Parameters:
  locale - Locale to be used for formatting String value formatted with the given number of places afterdecimal



valueOf
public static StringValue valueOf(double value, Locale locale)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  value - Double precision value
Parameters:
  locale - Locale to be used for formatting String value formatted with one place after decimal



valueOf
public static StringValue valueOf(Object object)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  object - An object String value for object



valueOf
public static StringValue valueOf(Object object, Locale locale)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  object - An object
Parameters:
  locale - Locale to be used for formatting String value for object



valueOf
public static StringValue valueOf(String string)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  string - A string String value for string



valueOf
public static StringValue valueOf(String string, Locale locale)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  string - A string
Parameters:
  locale - Locale to be used for formatting String value for string



valueOf
public static StringValue valueOf(AppendingStringBuffer buffer)(Code)
Converts the given input to an instance of StringValue.
Parameters:
  buffer - A string buffer String value



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.