org.xins.common.servlet
Class ServletConfigPropertyReader

java.lang.Object
  extended byorg.xins.common.servlet.ServletConfigPropertyReader
All Implemented Interfaces:
PropertyReader, Serializable

public final class ServletConfigPropertyReader
extends Object
implements PropertyReader

Implementation of a PropertyReader that returns the initialization properties from a ServletConfig object.

Since:
XINS 1.0.0
Version:
$Revision: 1.20 $ $Date: 2008/07/04 10:22:56 $
Author:
Ernst de Haan
See Also:
Serialized Form

Constructor Summary
ServletConfigPropertyReader(ServletConfig servletConfig)
          Constructs a new ServletConfigPropertyReader.
 
Method Summary
 boolean equals(Object obj)
          Compares this object with the specified argument for equality.
 String get(String name)
          Retrieves the value of the property with the specified name.
 Iterator getNames()
          Returns an Iterator that returns all property names.
 int hashCode()
          Returns a hash code value for this object.
 int size()
          Determines the number of properties.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletConfigPropertyReader

public ServletConfigPropertyReader(ServletConfig servletConfig)
                            throws IllegalArgumentException
Constructs a new ServletConfigPropertyReader.

Parameters:
servletConfig - the ServletConfig object, cannot be null.
Throws:
IllegalArgumentException - if servletConfig == null.
Method Detail

get

public String get(String name)
           throws IllegalArgumentException
Retrieves 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, possibly null.
Throws:
IllegalArgumentException - if name == null.

getNames

public Iterator getNames()
Returns an Iterator that returns all property names.

Specified by:
getNames in interface PropertyReader
Returns:
an Iterator for all property names, never null.

size

public int size()
Determines the number of properties.

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

equals

public boolean equals(Object obj)
Compares this object with the specified argument for equality.

Parameters:
obj - the object to compare with, can be null.
Returns:
true if the objects a and b are considered to be equal, false if they are considered different.

hashCode

public int hashCode()
Returns a hash code value for this object.

Returns:
a hash code value for this object.


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