Logo Search packages:      
Sourcecode: velocity version File versions  Download package

org::apache::velocity::runtime::configuration::Configuration Class Reference

Inherits java::util::Hashtable.

List of all members.


Detailed Description

This class extends normal Java properties by adding the possibility to use the same key many times concatenating the value strings instead of overwriting them.

The Extended Properties syntax is explained here:

Here is an example of a valid extended properties file:

      # lines starting with # are comments

      # This is the simplest property
      key = value

      # A long property may be separated on multiple lines
      longvalue = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
                  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

      # This is a property with many tokens
      tokens_on_a_line = first token, second token

      # This sequence generates exactly the same result
      tokens_on_multiple_lines = first token
      tokens_on_multiple_lines = second token

      # commas may be escaped in tokens
      commas.excaped = Hi\, what'up?
 

NOTE: this class has not been written for performance nor low memory usage. In fact, it's way slower than it could be and generates too much memory garbage. But since performance is not an issue during intialization (and there is not much time to improve it), I wrote it this way. If you don't like it, go ahead and tune it up!

Author:
Stefano Mazzocchi

Jon S. Stevens

Dave Bryson

Jason van Zyl

Geir Magnusson Jr.

Leon Messerschmidt

<a href="mailto:kjohnson@transparent.com>Kent Johnson

Version:
Id
Configuration.java,v 1.34 2003/05/04 17:14:37 geirm Exp

Deprecated:
As of version 1.1, please use ExtendedProperties from the Jakarta Commons Collections component.

Definition at line 174 of file Configuration.java.


Public Member Functions

void addProperty (String key, Object token)
void clearProperty (String key)
void combine (Configuration c)
 Configuration (String file, String defaultFile) throws IOException
 Configuration (String file) throws IOException
 Configuration ()
void display ()
Boolean getBoolean (String key, Boolean defaultValue)
boolean getBoolean (String key, boolean defaultValue)
boolean getBoolean (String key)
Byte getByte (String key, Byte defaultValue)
byte getByte (String key, byte defaultValue)
byte getByte (String key)
Double getDouble (String key, Double defaultValue)
double getDouble (String key, double defaultValue)
double getDouble (String key)
ExtendedProperties getExtendedProperties ()
Float getFloat (String key, Float defaultValue)
float getFloat (String key, float defaultValue)
float getFloat (String key)
String getInclude ()
int getInt (String name, int def)
int getInt (String name)
Integer getInteger (String key, Integer defaultValue)
int getInteger (String key, int defaultValue)
int getInteger (String key)
Iterator getKeys (String prefix)
Iterator getKeys ()
Long getLong (String key, Long defaultValue)
long getLong (String key, long defaultValue)
long getLong (String key)
Properties getProperties (String key, Properties defaults)
Properties getProperties (String key)
Object getProperty (String key)
Short getShort (String key, Short defaultValue)
short getShort (String key, short defaultValue)
short getShort (String key)
String getString (String key, String defaultValue)
String getString (String key)
String[] getStringArray (String key)
Vector getVector (String key, Vector defaultValue)
Vector getVector (String key)
boolean isInitialized ()
synchronized void load (InputStream input) throws IOException
synchronized void save (OutputStream output, String Header) throws IOException
void setInclude (String inc)
void setProperty (String key, Object value)
Configuration subset (String prefix)
String testBoolean (String value)

Static Public Member Functions

static Configuration convertProperties (Properties p)

Protected Attributes

String basePath
String file
String fileSeparator = System.getProperty("file.separator")
boolean isInitialized = false
ArrayList keysAsListed = new ArrayList()

Static Protected Attributes

static String include = "include"

Private Member Functions

void addStringProperty (String key, String token)
void init (Configuration exp) throws IOException

Private Attributes

Configuration defaults
ExtendedProperties deprecationCrutch = new ExtendedProperties()

Classes

class  PropertiesReader
class  PropertiesTokenizer

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index