Cocoon API: Class Configurations

org.apache.cocoon.framework
Class Configurations

java.lang.Object
  |
  +--org.apache.cocoon.framework.Configurations
Direct Known Subclasses:
XMLConfigurations

public class Configurations
extends java.lang.Object

This class encapsulates all the configurations needed by a Configurable class to work.

Version:
$Revision: 1.11 $ $Date: 2000/11/14 18:23:41 $
Author:
Stefano Mazzocchi

Field Summary
protected  java.lang.String baseName
           
protected  java.util.Properties properties
           
protected  Configurations root
           
 
Constructor Summary
Configurations()
           
Configurations(Configurations c)
          Create the class with given defaults.
Configurations(Configurations parent, java.lang.String base)
          Create a subconfiguration starting from the base node.
Configurations(java.io.InputStream stream)
          Create the class from a the InputStream
Configurations(java.io.InputStream stream, Configurations defaults)
          Create the class with given defaults and from the URL resource
Configurations(java.lang.String file)
          Create the class from a the file
Configurations(java.lang.String file, Configurations defaults)
          Create the class with given defaults and from the file
 
Method Summary
 java.lang.Object get(java.lang.String key)
          Get the configuration.
 java.lang.Object get(java.lang.String key, java.lang.Object def)
          Get the configuration and use the given default value if not found.
 Configurations getAnyConfig(java.lang.Class c, java.lang.Object x)
          For use by superclasses and support classes.
 Configurations getConfigurations(java.lang.String base)
          Create a subconfiguration starting from the base node.
 java.lang.Object getNotNull(java.lang.String key)
          Get the configuration, throw an exception if not present.
 java.util.Properties getProperties()
          Get the Properties from the Configuration
 java.util.Vector getVector(java.lang.String key)
          Get a vector of configurations when the syntax is incremental
 java.util.Enumeration keys()
          Used by XSPProcessor, but this maybe should be getKeys()?
 void put(java.lang.String key, java.lang.Object value)
          The JavaModule interpreter is using this method.
 void set(java.lang.String key, java.lang.Object value)
          Set the configuration.
 void setBasename(java.lang.String baseName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected Configurations root

baseName

protected java.lang.String baseName

properties

protected java.util.Properties properties
Constructor Detail

Configurations

public Configurations()

Configurations

public Configurations(java.lang.String file)
               throws java.lang.Exception
Create the class from a the file

Configurations

public Configurations(java.lang.String file,
                      Configurations defaults)
               throws java.lang.Exception
Create the class with given defaults and from the file

Configurations

public Configurations(java.io.InputStream stream)
               throws java.lang.Exception
Create the class from a the InputStream

Configurations

public Configurations(java.io.InputStream stream,
                      Configurations defaults)
               throws java.lang.Exception
Create the class with given defaults and from the URL resource

Configurations

public Configurations(Configurations c)
Create the class with given defaults.

Configurations

public Configurations(Configurations parent,
                      java.lang.String base)
Create a subconfiguration starting from the base node.
Method Detail

set

public void set(java.lang.String key,
                java.lang.Object value)
Set the configuration.

put

public void put(java.lang.String key,
                java.lang.Object value)
The JavaModule interpreter is using this method. should it?

get

public java.lang.Object get(java.lang.String key)
Get the configuration.

get

public java.lang.Object get(java.lang.String key,
                            java.lang.Object def)
Get the configuration and use the given default value if not found.

getNotNull

public java.lang.Object getNotNull(java.lang.String key)
Get the configuration, throw an exception if not present.

getVector

public java.util.Vector getVector(java.lang.String key)
Get a vector of configurations when the syntax is incremental

getConfigurations

public Configurations getConfigurations(java.lang.String base)
Create a subconfiguration starting from the base node.

getAnyConfig

public Configurations getAnyConfig(java.lang.Class c,
                                   java.lang.Object x)
                            throws java.lang.IllegalAccessException
For use by superclasses and support classes. Gets the configuration for the specified class from the root configurations object.
Parameters:
c - - the superclass that is to be configured.
x - - the object that is to be configured, for validation.
Throws:
java.lang.IllegalAccessException - if this object is not allowed to access configuration information for the given class.

getProperties

public java.util.Properties getProperties()
Get the Properties from the Configuration

setBasename

public void setBasename(java.lang.String baseName)

keys

public java.util.Enumeration keys()
Used by XSPProcessor, but this maybe should be getKeys()?


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.