| org.apache.tapestry.ioc.services.TypeCoercer
All known Subclasses: org.apache.tapestry.ioc.internal.services.TypeCoercerImpl,
TypeCoercer | public interface TypeCoercer (Code) | | Makes use of
Coercion s (via
CoercionTuple s) to convert between an input value
(of some specific type) and a desired output type. Smart about coercing, even if it requires
multiple coercing steps (i.e., via an intermediate type, such as String).
|
Method Summary | |
void | clearCache() Clears cached information stored by the TypeCoercer. | T | coerce(S input, Class<T> targetType) Performs a coercion from an input type to a desired output type. | String | explain(Class<S> inputType, Class<T> targetType) Used primarily inside test suites, this method performs the same steps as
TypeCoercer.coerce(Object,Class) , but returns a string describing the series of coercision,
such as "Object --> String --> Long --> Integer". |
clearCache | void clearCache()(Code) | | Clears cached information stored by the TypeCoercer.
|
coerce | T coerce(S input, Class<T> targetType)(Code) | | Performs a coercion from an input type to a desired output type. When the target type is a
primitive, the actual conversion will be to the equivalent wrapper type. In some cases, the
TypeCoercer will need to search for an appropriate coercion, and may even combine existing
coercions to form new ones; in those cases, the results of the search are cached.
< Parameters: S - >source type (input)< Parameters: T - >target type (output) Parameters: input - Parameters: targetType - defines the target type the coerced value |
explain | String explain(Class<S> inputType, Class<T> targetType)(Code) | | Used primarily inside test suites, this method performs the same steps as
TypeCoercer.coerce(Object,Class) , but returns a string describing the series of coercision,
such as "Object --> String --> Long --> Integer".
< Parameters: S - >source type (input)< Parameters: T - >target type (output) Parameters: inputType - the source coercion type (use void.class for coercions from null) Parameters: targetType - defines the target type a string identifying the series of coercions, or the empty string if no coercion isnecessary |
|
|