Java Doc for PropertyReaderUtils.java in  » Web-Services » xins » org » xins » common » collections » 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 » Web Services » xins » org.xins.common.collections 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xins.common.collections.PropertyReaderUtils

PropertyReaderUtils
final public class PropertyReaderUtils (Code)
Utility functions for dealing with PropertyReader objects.
version:
   $Revision: 1.59 $ $Date: 2007/09/13 11:31:30 $
author:
   Ernst de Haan
since:
   XINS 1.0.0
See Also:   PropertyReader


Field Summary
final public static  PropertyReaderEMPTY_PROPERTY_READER
     An empty and unmodifiable PropertyReader instance.


Method Summary
public static  PropertyReadercreatePropertyReader(InputStream in)
     Constructs a PropertyReader from the specified input stream.

The parsing done is similar to the parsing done by the Properties.load(InputStream) method.

final public static  booleanequals(PropertyReader pr, Object toCompare)
     Compares a PropertyReader instance with another object for equality.
public static  booleangetBooleanProperty(PropertyReader properties, String propertyName, boolean fallbackDefault)
     Gets the property with the specified name and converts it to a boolean.
public static  intgetIntProperty(PropertyReader properties, String propertyName)
     Gets the property with the specified name and converts it to an int.
public static  StringgetRequiredProperty(PropertyReader properties, String name)
     Retrieves the specified property and throws a MissingRequiredPropertyException if it is not set.
public  StringgetWithDefault(PropertyReader properties, String key, String fallbackValue)
     Retrieves a property with the specified name, falling back to a default value if the property is not set.
final public static  inthashCode(PropertyReader pr)
     Computes a hash code value for the specified PropertyReader object.
public static  voidserialize(PropertyReader properties, FastStringBuffer buffer, String valueIfEmpty)
     Serializes the specified PropertyReader to a FastStringBuffer.
public static  StringtoString(PropertyReader properties)
     Returns the String representation of the specified PropertyReader. For each entry, both the key and the value are encoded using the URL encoding (see URLEncoding ). The key and value are separated by a literal equals sign ('=').
public static  StringtoString(PropertyReader properties, String valueIfEmpty)
     Serializes the specified PropertyReader to a String.
public static  StringtoString(PropertyReader properties, String valueIfEmpty, String prefixIfNotEmpty, String suffix)
     Returns the String representation for the specified PropertyReader.
Parameters:
  properties - the PropertyReader to construct a String for, or null.
Parameters:
  valueIfEmpty - the value to return if the specified set of properties is eithernull or empty, can be null.
Parameters:
  prefixIfNotEmpty - the prefix to add to the value if the PropertyReaderis not empty, can be null.
Parameters:
  suffix - the suffix to add to the value, can be null.
public static  StringtoString(PropertyReader properties, String valueIfEmpty, String prefixIfNotEmpty, String suffix, int maxValueLength)
     Returns the String representation for the specified PropertyReader.
Parameters:
  properties - the PropertyReader to construct a String for, or null.
Parameters:
  valueIfEmpty - the value to return if the specified set of properties is eithernull or empty, can be null.
Parameters:
  prefixIfNotEmpty - the prefix to add to the value if the PropertyReaderis not empty, can be null.
Parameters:
  suffix - the suffix to add to the value, can be null.

Field Detail
EMPTY_PROPERTY_READER
final public static PropertyReader EMPTY_PROPERTY_READER(Code)
An empty and unmodifiable PropertyReader instance. This field is not null.
since:
   XINS 1.1.0





Method Detail
createPropertyReader
public static PropertyReader createPropertyReader(InputStream in) throws IllegalArgumentException, IOException(Code)
Constructs a PropertyReader from the specified input stream.

The parsing done is similar to the parsing done by the Properties.load(InputStream) method. Empty values will be ignored.
Parameters:
  in - the input stream to read from, cannot be null.a PropertyReader instance that contains all the propertiesdefined in the specified input stream.
throws:
  IllegalArgumentException - if in == null.
throws:
  IOException - if there was an I/O error while reading from the stream.




equals
final public static boolean equals(PropertyReader pr, Object toCompare)(Code)
Compares a PropertyReader instance with another object for equality.
Parameters:
  pr - the PropertyReader, can be null.
Parameters:
  toCompare - the object to compare the PropertyReader with,can be null.true if the objects are considered to be equal,false if they are considered different.
since:
   XINS 2.1



getBooleanProperty
public static boolean getBooleanProperty(PropertyReader properties, String propertyName, boolean fallbackDefault) throws IllegalArgumentException, InvalidPropertyValueException(Code)
Gets the property with the specified name and converts it to a boolean.
Parameters:
  properties - the set of properties to read from, cannot be null.
Parameters:
  propertyName - the name of the property to read, cannot be null.
Parameters:
  fallbackDefault - the fallback default value, returned if the value of the property iseither null or "" (an empty string).the value of the property.
throws:
  IllegalArgumentException - if properties == null || propertyName == null.
throws:
  InvalidPropertyValueException - if the value of the property is neither null nor"" (an empty string), nor "true" nor"false".



getIntProperty
public static int getIntProperty(PropertyReader properties, String propertyName) throws IllegalArgumentException, MissingRequiredPropertyException, InvalidPropertyValueException(Code)
Gets the property with the specified name and converts it to an int.
Parameters:
  properties - the set of properties to read from, cannot be null.
Parameters:
  propertyName - the name of the property to read, cannot be null.the value of the property, as an int.
throws:
  IllegalArgumentException - if properties == null || propertyName == null.
throws:
  MissingRequiredPropertyException - if the specified property is not set, or if it is set to an emptystring.
throws:
  InvalidPropertyValueException - if the conversion to an int failed.



getRequiredProperty
public static String getRequiredProperty(PropertyReader properties, String name) throws IllegalArgumentException, MissingRequiredPropertyException(Code)
Retrieves the specified property and throws a MissingRequiredPropertyException if it is not set.
Parameters:
  properties - the set of properties to retrieve a specific proeprty from, cannot benull.
Parameters:
  name - the name of the property, cannot be null.the value of the property, guaranteed not to be null andguaranteed to contain at least one character.
throws:
  IllegalArgumentException - if properties == null || name == null.
throws:
  MissingRequiredPropertyException - if the value of the property is either null or an emptystring.



getWithDefault
public String getWithDefault(PropertyReader properties, String key, String fallbackValue) throws IllegalArgumentException(Code)
Retrieves a property with the specified name, falling back to a default value if the property is not set.
Parameters:
  properties - the set of properties to retrieve a property from,cannot be null.
Parameters:
  key - the property key, cannot be null.
Parameters:
  fallbackValue - the fallback default value, returned in case the property is not set in properties, cannot be null.the value of the property or the fallback value.
throws:
  IllegalArgumentException - if properties == null || key == null || fallbackValue == null.
since:
   XINS 2.1



hashCode
final public static int hashCode(PropertyReader pr) throws NullPointerException(Code)
Computes a hash code value for the specified PropertyReader object.
Parameters:
  pr - the PropertyReader instance to compute a hash code valuefor, cannot be null.the hash code value.
throws:
  NullPointerException - if pr == null.
since:
   XINS 2.1



serialize
public static void serialize(PropertyReader properties, FastStringBuffer buffer, String valueIfEmpty) throws IllegalArgumentException(Code)
Serializes the specified PropertyReader to a FastStringBuffer. For each entry, both the key and the value are encoded using the URL encoding (see URLEncoding ). The key and value are separated by a literal equals sign ('='). The entries are separated using an ampersand ('&').

If the value for an entry is either null or an empty string (""), then nothing is added to the buffer for that entry.
Parameters:
  properties - the PropertyReader to serialize, can be null.
Parameters:
  buffer - the buffer to write the serialized data to, cannot benull.
Parameters:
  valueIfEmpty - the string to append to the buffer in caseproperties == null || properties.size() == 0; if thisargument is null, however, then nothing will be appendedin the mentioned case.
throws:
  IllegalArgumentException - if properties == null || buffer == null.PropertyReaderUtils.toString(PropertyReader,String)




toString
public static String toString(PropertyReader properties)(Code)
Returns the String representation of the specified PropertyReader. For each entry, both the key and the value are encoded using the URL encoding (see URLEncoding ). The key and value are separated by a literal equals sign ('='). The entries are separated using an ampersand ('&').

If the value for an entry is either null or an empty string (""), then nothing is added to the String for that entry.
Parameters:
  properties - the PropertyReader to serialize, cannot be null.the String representation of the specified PropertyReader.
since:
   XINS 2.0.




toString
public static String toString(PropertyReader properties, String valueIfEmpty)(Code)
Serializes the specified PropertyReader to a String. For each entry, both the key and the value are encoded using the URL encoding (see URLEncoding ). The key and value are separated by a literal equals sign ('='). The entries are separated using an ampersand ('&').

If the value for an entry is either null or an empty string (""), then nothing is added to the String for that entry.
Parameters:
  properties - the PropertyReader to serialize, can be null.
Parameters:
  valueIfEmpty - the string to append to the buffer in caseproperties == null || properties.size() == 0.the String representation of the PropertyReader or the valueIfEmpty, never null.If all parameters are null then an empty String is returned.




toString
public static String toString(PropertyReader properties, String valueIfEmpty, String prefixIfNotEmpty, String suffix)(Code)
Returns the String representation for the specified PropertyReader.
Parameters:
  properties - the PropertyReader to construct a String for, or null.
Parameters:
  valueIfEmpty - the value to return if the specified set of properties is eithernull or empty, can be null.
Parameters:
  prefixIfNotEmpty - the prefix to add to the value if the PropertyReaderis not empty, can be null.
Parameters:
  suffix - the suffix to add to the value, can be null. The suffixwill be added even if the PropertyReaderis empty.the String representation of the PropertyReader with the different artifacts, never null.If all parameters are null then an empty String is returned.
since:
   XINS 2.0



toString
public static String toString(PropertyReader properties, String valueIfEmpty, String prefixIfNotEmpty, String suffix, int maxValueLength)(Code)
Returns the String representation for the specified PropertyReader.
Parameters:
  properties - the PropertyReader to construct a String for, or null.
Parameters:
  valueIfEmpty - the value to return if the specified set of properties is eithernull or empty, can be null.
Parameters:
  prefixIfNotEmpty - the prefix to add to the value if the PropertyReaderis not empty, can be null.
Parameters:
  suffix - the suffix to add to the value, can be null. The suffixwill be added even if the PropertyReaderis empty.
Parameters:
  maxValueLength - the maximum of characters to set for the value, if the value is longerthan this limit '...' will be added after the limit.If the value is -1, no limit will be set.the String representation of the PropertyReader with the different artifacts, never null.If all parameters are null then an empty String is returned.
since:
   XINS 2.0



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.