|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Converter
Type converter to convert an object to a target type.
Method Summary | |
---|---|
boolean |
canConvert(java.lang.Object sourceObject,
ReifiedType targetType)
Return if this converter is able to convert the specified object to the specified type. |
java.lang.Object |
convert(java.lang.Object sourceObject,
ReifiedType targetType)
Convert the specified object to an instance of the specified type. |
Method Detail |
---|
boolean canConvert(java.lang.Object sourceObject, ReifiedType targetType)
sourceObject
- The source object s
to convert.targetType
- The target type T
.
true
if the conversion is possible,
false
otherwise.java.lang.Object convert(java.lang.Object sourceObject, ReifiedType targetType) throws java.lang.Exception
sourceObject
- The source object s
to convert.targetType
- The target type T
.
java.lang.Exception
- If the conversion cannot succeed. This exception should
not be thrown when the canConvert
method has
returned true
.
|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |