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.9 $ $Date: 2000/07/21 23:54:08 $
Author:
Stefano Mazzocchi

Field Summary
protected  java.lang.String baseName
           
protected  java.util.Properties properties
           
 
Constructor Summary
Configurations()
           
Configurations(Configurations c)
          Create the class with given defaults.
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 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

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.
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.

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-2000 Apache Software Foundation. All Rights Reserved.