S - 转换对象G - Typepublic abstract class AbstractToStringConvertor<S,G extends cn.featherfly.common.lang.reflect.Type<S>> extends java.lang.Object implements ToStringConvertor<S>
抽象转换器
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger
日志
|
| 构造器和说明 |
|---|
AbstractToStringConvertor() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract S |
doToObject(java.lang.String value,
G genericType)
字符串转换为对象
|
protected abstract java.lang.String |
doToString(S value,
G genericType)
对象转换为字符串
|
TypePolicys |
getPolicy()
返回policy
|
java.lang.Class<S> |
getSourceType()
返回转换器支持的转换源的类型
|
java.lang.Class<java.lang.String> |
getTargetType()
返回转换器支持的转换目标的类型
|
void |
setPolicy(TypePolicys policy)
设置policy
|
<GT extends cn.featherfly.common.lang.reflect.Type<S>> |
sourceToTarget(S value,
GT genericType)
对象转换为字符串
|
protected abstract boolean |
supportFor(cn.featherfly.common.lang.reflect.Type<S> generecType)
是否提供对传入类型的支持
|
<GT extends cn.featherfly.common.lang.reflect.Type<S>> |
targetToSource(java.lang.String value,
GT genericType)
字符串转换为对象
|
protected abstract boolean supportFor(cn.featherfly.common.lang.reflect.Type<S> generecType)
是否提供对传入类型的支持
generecType - generecTypeprotected abstract java.lang.String doToString(S value, G genericType)
对象转换为字符串
value - 对象genericType - 指定对象的上下文属性protected abstract S doToObject(java.lang.String value, G genericType)
字符串转换为对象
value - 字符串genericType - 指定对象的上下文属性public <GT extends cn.featherfly.common.lang.reflect.Type<S>> java.lang.String sourceToTarget(S value, GT genericType)
对象转换为字符串
sourceToTarget 在接口中 Convertor<S,java.lang.String>sourceToTarget 在接口中 ToStringConvertor<S>GT - Type子类泛型value - 对象genericType - 指定对象的上下文属性public <GT extends cn.featherfly.common.lang.reflect.Type<S>> S targetToSource(java.lang.String value, GT genericType)
字符串转换为对象
targetToSource 在接口中 Convertor<S,java.lang.String>targetToSource 在接口中 ToStringConvertor<S>GT - Type子类泛型value - 字符串genericType - 指定对象的上下文属性public java.lang.Class<S> getSourceType()
返回转换器支持的转换源的类型
getSourceType 在接口中 Convertor<S,java.lang.String>public java.lang.Class<java.lang.String> getTargetType()
返回转换器支持的转换目标的类型
getTargetType 在接口中 Convertor<S,java.lang.String>getTargetType 在接口中 ToStringConvertor<S>public TypePolicys getPolicy()
getPolicy 在接口中 ToStringConvertor<S>public void setPolicy(TypePolicys policy)
policy - policy