|
Knopflerfish OSGi 3.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A converter is a service that can help create specific object types from a string, and vice versa. The shell is capable of coercing arguments to the their proper type. However, sometimes commands require extra help to do this conversion. This service can implement a converter for a number of types. The command shell will rank these services in order of service.ranking and will then call them until one of the converters succeeds. TODO The javadoc in this class need a good scrub before release.
| Field Summary | |
static java.lang.String |
CONVERTER_CLASSES
This property is a string, or array of strings, and defines the classes or interfaces that this converter recognizes. |
static int |
INSPECT
Print the object in detail. |
static int |
LINE
Print the object as a row in a table. |
static int |
PART
Print the value in a small format so that it is identifiable. |
| Method Summary | |
java.lang.Object |
convert(java.lang.Class desiredType,
java.lang.Object in)
Convert an object to the desired type. |
java.lang.CharSequence |
format(java.lang.Object target,
int level,
Converter escape)
Convert an object to a CharSequence object in the requested format. |
| Field Detail |
public static final java.lang.String CONVERTER_CLASSES
public static final int INSPECT
public static final int LINE
public static final int PART
| Method Detail |
public java.lang.Object convert(java.lang.Class desiredType,
java.lang.Object in)
throws java.lang.Exception
desiredType - The type that the returned object can be assigned toin - The object that must be converted
java.lang.Exception
public java.lang.CharSequence format(java.lang.Object target,
int level,
Converter escape)
throws java.lang.Exception
target - The object to be converted to a Stringlevel - One of INSPECT, LINE, or PART.escape - Use this object to format sub ordinate objects.
java.lang.Exception
|
Knopflerfish OSGi 3.2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||