Class Data
java.lang.Object
org.apache.velocity.tools.config.Data
- All Implemented Interfaces:
Comparable<Data>
- Direct Known Subclasses:
Property
This class represents configured data. If added to a
FactoryConfiguration, its values will be made
available in the application-scoped toolboxes
produced by any ToolboxFactory configured using
that configuration.
This class also implements all the functionality of
Propertys, which may added to any
Configuration subclass, including
ToolConfiguration, ToolboxConfiguration,
and FactoryConfiguration. In other words,
anything you can do in a Data configuration, you
can do with a Property.
Some features supported here are:
- built in
Data.Types for strings, booleans, numbers, fields and lists thereof - auto-conversion of numbers, booleans and fields in data with no explicit type
- support for any Commons-BeanUtils
Converterimplementation
- Version:
- $Id: Data.java 511959 2007-02-26 19:24:39Z nbubna $
- Author:
- Nathan Bubna
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classprotected static enumDelineates the standard, known types and their associated target classes (setTargetClass(Class)and converters (setConverter(Class)). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected ObjectvoidconvertWith(org.apache.commons.beanutils.Converter converter) This is a convenience method for those doing configuration in java.booleanorg.apache.commons.beanutils.ConvertergetKey()getType()getValue()inthashCode()voidThis doesn't take aClassparameter because this class was not created for all-java configuration.voidsetClassname(String classname) voidsetConverter(Class clazz) voidsetConverter(String classname) voidvoidsetTargetClass(Class clazz) voidprotected voidvoidtoString()voidvalidate()
-
Field Details
-
DEFAULT_TYPE
-
-
Constructor Details
-
Data
public Data()
-
-
Method Details
-
setKey
-
setValue
-
setClassname
-
setClass
-
setType
-
setType
-
setTargetClass
-
setConverter
-
setConverter
-
convertWith
public void convertWith(org.apache.commons.beanutils.Converter converter) This is a convenience method for those doing configuration in java. It cannot be named setConverter(), or else it would confuse BeanUtils.- Parameters:
converter- value converter
-
getKey
-
getType
-
getValue
-
getTargetClass
-
getConverter
public org.apache.commons.beanutils.Converter getConverter() -
getConvertedValue
-
validate
public void validate() -
compareTo
- Specified by:
compareToin interfaceComparable<Data>
-
hashCode
-
equals
-
toString
-
convert
-