类 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
- 所有已实现的接口:
Comparable<Configuration>
This reads in configuration info formatted as a property
file using ExtendedProperties
from Commons-Collections.
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 = booleanNOTE: "property", "data", and "toolbox" are reserved words do not use them as tool keys or toolbox scopes.
- 版本:
- $Id: PropertiesFactoryConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
- 作者:
- Nathan Bubna
-
构造器概要
构造器构造器说明Creates an instance using the specified string as an identifier to distinguish this instance when debugging. -
方法概要
修饰符和类型方法说明void
read
(ExtendedProperties factory) Reads an configuration from anInputStream
.void
read
(InputStream input) Reads an properties file from anInputStream
and uses it to configure thisFactoryConfiguration
.protected void
readData
(ExtendedProperties dataset) protected void
readProperties
(ExtendedProperties configProps, Configuration config) protected void
readToolboxes
(ExtendedProperties factory) protected void
readTools
(ExtendedProperties tools, ToolboxConfiguration toolbox) protected void
setProperties
(ExtendedProperties props, Data data) 从类继承的方法 org.apache.velocity.tools.config.FileFactoryConfiguration
findURL, read, read, read, read, read
从类继承的方法 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
从类继承的方法 org.apache.velocity.tools.config.CompoundConfiguration
addChild, addConfiguration, appendChildren, getChild, getChildren, hasChildren, removeChild, setChildren
从类继承的方法 org.apache.velocity.tools.config.Configuration
addConfiguration, addProperty, appendProperties, compareTo, getProperties, getProperty, getPropertyMap, hasProperties, removeProperty, removeProperty, setProperties, setProperty, setPropertyMap
-
构造器详细资料
-
PropertiesFactoryConfiguration
public PropertiesFactoryConfiguration() -
PropertiesFactoryConfiguration
Creates an instance using the specified string as an identifier to distinguish this instance when debugging.- 参数:
id
- the name of the "source" of this instance- 另请参阅:
-
-
方法详细资料
-
read
Reads an properties file from an
InputStream
and uses it to configure thisFactoryConfiguration
.- 指定者:
read
在类中FileFactoryConfiguration
- 参数:
input
- the InputStream to read from- 抛出:
IOException
-
read
public void read(ExtendedProperties factory) 从类复制的说明:FileFactoryConfiguration
Reads an configuration from an
InputStream
.- 指定者:
read
在类中FileFactoryConfiguration
- 参数:
factory
- the InputStream to read from
-
readProperties
-
readToolboxes
protected void readToolboxes(ExtendedProperties factory) -
readTools
-
readData
protected void readData(ExtendedProperties dataset) -
setProperties
-