public class Data extends Object implements Comparable<Data>
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:
Data.Types for strings, booleans, numbers, fields
and lists thereofConverter implementation| Modifier and Type | Class and Description |
|---|---|
protected static class |
Data.AutoConverter |
protected static class |
Data.FieldConverter |
protected static class |
Data.NumberConverter |
protected static class |
Data.Type
Delineates the standard, known types and their
associated target classes (
setTargetClass(java.lang.Class) and
converters (setConverter(java.lang.Class)). |
| Modifier and Type | Field and Description |
|---|---|
protected static Data.Type |
DEFAULT_TYPE |
| Constructor and Description |
|---|
Data() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Data datum) |
protected Object |
convert(Object value) |
void |
convertWith(org.apache.commons.beanutils.Converter converter)
This is a convenience method for those doing configuration in java.
|
boolean |
equals(Object obj) |
Object |
getConvertedValue() |
org.apache.commons.beanutils.Converter |
getConverter() |
String |
getKey() |
Class |
getTargetClass() |
String |
getType() |
Object |
getValue() |
int |
hashCode() |
void |
setClass(String classname)
This doesn't take a
Class parameter because
this class was not created for all-java configuration. |
void |
setClassname(String classname) |
void |
setConverter(Class clazz) |
void |
setConverter(String classname) |
void |
setKey(String key) |
void |
setTargetClass(Class clazz) |
protected void |
setType(Data.Type type) |
void |
setType(String t) |
void |
setValue(Object value) |
String |
toString() |
void |
validate() |
protected static final Data.Type DEFAULT_TYPE
public void setKey(String key)
public void setValue(Object value)
public void setClassname(String classname)
public void setClass(String classname)
Class parameter because
this class was not created for all-java configuration.classname - class nameprotected void setType(Data.Type type)
public void setType(String t)
public void setTargetClass(Class clazz)
public void setConverter(Class clazz)
public void setConverter(String classname)
public void convertWith(org.apache.commons.beanutils.Converter converter)
converter - value converterpublic String getKey()
public String getType()
public Object getValue()
public Class getTargetClass()
public org.apache.commons.beanutils.Converter getConverter()
public Object getConvertedValue()
public void validate()
public int compareTo(Data datum)
compareTo in interface Comparable<Data>Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.