|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Converter
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.
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 objet to a CharSequence object in the requested format. |
Field Detail |
---|
static final java.lang.String CONVERTER_CLASSES
static final int INSPECT
static final int LINE
static final int PART
Method Detail |
---|
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
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |