org.xins.common.collections
Class AbstractPropertyReader

java.lang.Object
  extended byorg.xins.common.collections.AbstractPropertyReader
All Implemented Interfaces:
PropertyReader, Serializable
Direct Known Subclasses:
BasicPropertyReader, PropertiesPropertyReader, ProtectedPropertyReader, ServletRequestPropertyReader

public abstract class AbstractPropertyReader
extends Object
implements PropertyReader

Base for PropertyReader implementations that use an underlying Map instance.

Since:
XINS 1.0.0
Version:
$Revision: 1.21 $ $Date: 2006/08/28 09:12:32 $
Author:
Ernst de Haan, Anthony Goubard
See Also:
Serialized Form

Constructor Summary
protected AbstractPropertyReader(Map map)
          Constructs a new AbstractPropertyReader.
 
Method Summary
 String get(String name)
          Gets the value of the property with the specified name.
 Iterator getNames()
          Gets an iterator that iterates over all the property names.
protected  Map getPropertiesMap()
          Returns the Map that contains the properties.
 int size()
          Returns the number of entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertyReader

protected AbstractPropertyReader(Map map)
                          throws IllegalArgumentException
Constructs a new AbstractPropertyReader.

Parameters:
map - the map containing the data of this PropertyReader, cannot be null.
Throws:
IllegalArgumentException - if map == null.
Since:
XINS 1.4.0
Method Detail

get

public String get(String name)
           throws IllegalArgumentException
Gets the value of the property with the specified name.

Specified by:
get in interface PropertyReader
Parameters:
name - the name of the property, cannot be null.
Returns:
the value of the property, or null if it is not set.
Throws:
IllegalArgumentException - if name == null.

getNames

public Iterator getNames()
Gets an iterator that iterates over all the property names. The Iterator will return only String instances.

Specified by:
getNames in interface PropertyReader
Returns:
the Iterator that will iterate over all the names, never null.

size

public int size()
Returns the number of entries.

Specified by:
size in interface PropertyReader
Returns:
the size, always >= 0.

getPropertiesMap

protected Map getPropertiesMap()
Returns the Map that contains the properties.

Returns:
the Map used to store the properties in, cannot be null.
Since:
XINS 1.4.0


See http://www.xins.org/.