|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.osjava.sj.loader.convert.ConstructorConverter
public class ConstructorConverter
Convert a text value to any object whose constructor takes a single String object. For example, to get an Integer object for the lookup key com.example.Foo you would have a com/example.properties file containing the following three lines.
Foo=42 Foo.type=java.lang.Integer Foo.converter=org.osjava.sj.loader.convert.Constructor
Constructor Summary | |
---|---|
ConstructorConverter()
|
Method Summary | |
---|---|
java.lang.Object |
convert(java.util.Properties properties,
java.lang.String type)
Turn a String-based tree-structure into an Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstructorConverter()
Method Detail |
---|
public java.lang.Object convert(java.util.Properties properties, java.lang.String type)
Converter
Turn 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, "".
TODO: No way for a converter to know the delimiter-type.
convert
in interface Converter
properties
- a Properties data structuretype
- a String representation of object desired
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |