com.townleyenterprises.common
Class PropertyParser

java.lang.Object
  extended bycom.townleyenterprises.common.PropertyParser

public final class PropertyParser
extends java.lang.Object

This is a static utility class to perform parsing of property values to primitive types.

Version:
$Id: PropertyParser.java,v 1.3 2004/07/28 10:33:58 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
PropertyParser()
          The default constructor assumes the properties to parse come from the System class.
PropertyParser(java.util.Properties props)
          This constructor takes the properties containing the value to parse.
 
Method Summary
 boolean booleanValue(java.lang.String name)
          This method is a more forgiving parser for boolean values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyParser

public PropertyParser()
The default constructor assumes the properties to parse come from the System class.


PropertyParser

public PropertyParser(java.util.Properties props)
This constructor takes the properties containing the value to parse.

Parameters:
props - the properties
Method Detail

booleanValue

public boolean booleanValue(java.lang.String name)
This method is a more forgiving parser for boolean values. It accepts anything starting with 'y' or 't' as true and anything else as false.

Parameters:
name - the name of the property to find
Returns:
the parsed boolean value or false if the property was not found


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.