public class BeanConverter extends Object implements ConverterIF
name=Arthur answer=42 type=com.example.Person converter=org.osjava.sj.loader.convert.BeanConverter
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
BeanConverter() |
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(Properties properties,
String type)
Turn a String-based tree-structure into an Object.
|
private static Object |
convert(String value,
Class<?> toWhat) |
private static PropertyDescriptor |
findPropertyDescriptorWithSetter(Class<?> clazz,
String propertyName) |
private static PropertyDescriptor findPropertyDescriptorWithSetter(Class<?> clazz, String propertyName)
public Object convert(Properties properties, String type)
ConverterIFTurn a String-based tree-structure into an Object. Additionally the type of object desired is known. This is usually a Java class, but this is not mandatory.
The properties structure is located at the point of the lookup key, so if the code asked for a com.example.Foo object, the properties structure would be everything below Foo.
To get at the value of com.example.Foo itself, request the empty string, "".
IMPROVE: No way for a converter to know the delimiter-type.
convert in interface ConverterIFproperties - a Properties data structuretype - a String representation of object desiredCopyright © 2020. All rights reserved.