fedora.server
Class Parameterized

java.lang.Object
  extended by fedora.server.Parameterized
All Implemented Interfaces:
Constants
Direct Known Subclasses:
DatastoreConfig, Pluggable

public abstract class Parameterized
extends java.lang.Object
implements Constants

Title: Parameterized.java

Description: Abstract superclass of all Fedora components that can be configured by a set of name-value pairs.

Version:
$Id: Parameterized.java 4875 2006-02-27 15:47:42Z eddie $
Author:
cwilper@cs.cornell.edu

Nested Class Summary
 
Nested classes/interfaces inherited from interface fedora.common.Constants
Constants.FedoraHome
 
Field Summary
 
Fields inherited from interface fedora.common.Constants
ACTION, BDEF, BMECH, DATASTREAM, DC, DISSEMINATOR, ENVIRONMENT, FEDORA, FEDORA_HOME, FEDORA_SYSTEM_DEF_PID, FEDORA_SYSTEM_DEF_URI, HTTP_REQUEST, MODEL, OBJECT, RDF, RECOVERY, RELS_EXT, RESOURCE, SUBJECT, TUCANA, VIEW, XSD
 
Constructor Summary
Parameterized()
          Creates a Parameterized with no parameters.
Parameterized(java.util.Map parameters)
          Creates a Parameterized with name-value pairs from the supplied Map.
 
Method Summary
 java.lang.String getParameter(java.lang.String name)
          Gets the value of a named configuration parameter.
 java.lang.String getParameter(java.lang.String name, boolean asAbsolutePath)
          Gets the value of a named configuration parameter.
 java.util.Map getParameters()
           
 java.util.Iterator parameterNames()
          Gets an Iterator over the names of parameters for this component.
protected  void setParameter(java.lang.String name, java.lang.String value)
           
protected  void setParameters(java.util.Map parameters)
          Sets the parameters with name-value pairs from the supplied Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameterized

public Parameterized()
Creates a Parameterized with no parameters.


Parameterized

public Parameterized(java.util.Map parameters)
Creates a Parameterized with name-value pairs from the supplied Map.

Parameters:
parameters - The map from which to derive the name-value pairs.
Method Detail

setParameters

protected final void setParameters(java.util.Map parameters)
Sets the parameters with name-value pairs from the supplied Map. This is protected because it is intended to only be called by subclasses where super(Map m) is not possible to call at the start of the constructor. Server.java:Server(URL) is an example of this.

Parameters:
parameters - The map from which to derive the name-value pairs.

getParameter

public final java.lang.String getParameter(java.lang.String name,
                                           boolean asAbsolutePath)
Gets the value of a named configuration parameter. Same as getParameter(String name) but prepends the location of FEDORA_HOME if asAbsolutePath is true and the parameter location does not already specify an absolute pathname.

Parameters:
name - The parameter name.
asAbsolutePath - Whether to return the parameter value as an absolute path relative to FEDORA_HOME.
Returns:
The value, null if undefined.

getParameter

public final java.lang.String getParameter(java.lang.String name)
Gets the value of a named configuration parameter.

Parameters:
name - The parameter name.
Returns:
String The value, null if undefined.

setParameter

protected final void setParameter(java.lang.String name,
                                  java.lang.String value)

getParameters

public java.util.Map getParameters()

parameterNames

public final java.util.Iterator parameterNames()
Gets an Iterator over the names of parameters for this component.

Returns:
Iterator The names.