org.apache.velocity.tools.config

## Class PropertiesFactoryConfiguration

- java.lang.Object
- - org.apache.velocity.tools.config.Configuration
  - - org.apache.velocity.tools.config.CompoundConfiguration<ToolboxConfiguration>
    - - org.apache.velocity.tools.config.FactoryConfiguration
      - - org.apache.velocity.tools.config.FileFactoryConfiguration
        - - org.apache.velocity.tools.config.PropertiesFactoryConfiguration

All Implemented Interfaces:
  Comparable<Configuration>

    public class PropertiesFactoryConfiguration
    extends FileFactoryConfiguration

This reads in configuration info formatted as a property file using `ExtProperties`.

Example usage:

     FactoryConfiguration cfg = new PropertiesFactoryConfiguration();
     cfg.read("my.properties");
     ToolboxFactory factory = cfg.createFactory();

This reads in a configuration such as:

     tools.toolbox = request,application
     tools.property.locale = en_us
     tools.property.locale.class = java.util.Locale
     tools.property.locale.converter = org.apache.velocity.tools.config.LocaleConverter
     tools.request.property.xhtml = true
     tools.request.render = org.apache.velocity.tools.view.ViewRenderTool
     tools.request.render.parseDepth = 5
     tools.request.search = com.foo.tools.MySearchTool
     tools.request.search.itemsPerPage = 10
     tools.application.math = org.apache.velocity.tools.generic.MathTool
     tools.data.foo = bar
     tools.data.foo.class = java.lang.String
     tools.data.foo.converter = org.apache.commons.beanutils.converter.StringConverter
     tools.data.version = 1.0
     tools.data.version.type = number
     tools.data.debug = false
     tools.data.debug.type = boolean

NOTE: "property", "data", and "toolbox" are reserved words do not use them as tool keys or toolbox scopes.

Version:
  $Id: PropertiesFactoryConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
Author:
  Nathan Bubna

### Constructor Summary

Constructors
Constructor and Description
`PropertiesFactoryConfiguration()`
`PropertiesFactoryConfiguration(String id)` Creates an instance using the specified string as an identifier to distinguish this instance when debugging.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `read(org.apache.velocity.util.ExtProperties factory)`
`protected void` `readData(org.apache.velocity.util.ExtProperties dataset)`
`protected void` `readImpl(URL url)` Reads an properties file from an `InputStream` and uses it to configure this `FactoryConfiguration`.
`protected void` `readProperties(org.apache.velocity.util.ExtProperties configProps, Configuration config)`
`protected void` `readToolboxes(org.apache.velocity.util.ExtProperties factory)`
`protected void` `readTools(org.apache.velocity.util.ExtProperties tools, ToolboxConfiguration toolbox)`
`protected void` `setProperties(org.apache.velocity.util.ExtProperties props, Data data)`

### Methods inherited from class org.apache.velocity.tools.config.FileFactoryConfiguration

`findURL, read, read, read, read, read, read`

### Methods inherited from class org.apache.velocity.tools.config.FactoryConfiguration

`addConfiguration, addData, addSource, addToolbox, createFactory, equals, getData, getData, getData, getSource, getSources, getToolbox, getToolboxes, hasData, hashCode, removeData, removeToolbox, setData, setSource, setToolboxes, toString, toString, validate`

### Methods inherited from class org.apache.velocity.tools.config.CompoundConfiguration

`addChild, addConfiguration, appendChildren, getChild, getChildren, hasChildren, removeChild, setChildren`

### Methods inherited from class org.apache.velocity.tools.config.Configuration

`addConfiguration, addProperty, appendProperties, compareTo, getProperties, getProperty, getPropertyMap, hasProperties, removeProperty, removeProperty, setProperties, setProperty, setPropertyMap`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PropertiesFactoryConfiguration

    public PropertiesFactoryConfiguration()

#### PropertiesFactoryConfiguration

    public PropertiesFactoryConfiguration(String id)

Creates an instance using the specified string as an identifier to distinguish this instance when debugging.

Parameters:
  `id` - the name of the "source" of this instance
See Also:
  `FactoryConfiguration.setSource(String)`

### Method Detail

#### readImpl

    protected void readImpl(URL url)
                     throws IOException

Reads an properties file from an `InputStream` and uses it to configure this `FactoryConfiguration`.

Specified by:
  `readImpl` in class `FileFactoryConfiguration`
Parameters:
  `url` - the URL to read from
Throws:
  `IOException` - if a problem occurs

#### read

    public void read(org.apache.velocity.util.ExtProperties factory)

#### readProperties

    protected void readProperties(org.apache.velocity.util.ExtProperties configProps,
                                  Configuration config)

#### readToolboxes

    protected void readToolboxes(org.apache.velocity.util.ExtProperties factory)

#### readTools

    protected void readTools(org.apache.velocity.util.ExtProperties tools,
                             ToolboxConfiguration toolbox)

#### readData

    protected void readData(org.apache.velocity.util.ExtProperties dataset)

#### setProperties

    protected void setProperties(org.apache.velocity.util.ExtProperties props,
                                 Data data)