public class PropertyTypeConverter extends Object implements ognl.TypeConverter
PropertyEditor
-based implementation of OGNL TypeConverter
.
This converter uses the PropertyEditor
implementations in
mina-integration-beans module to perform conversion. To use this
converter:
OgnlContext ctx = Ognl.createDefaultContext(root);
ctx.put(OgnlContext.TYPE_CONVERTER_CONTEXT_KEY, new PropertyTypeConverter());
You can also override getPropertyEditor(Class, String, Class)
method to have more control over how an appropriate PropertyEditor
is chosen.Constructor and Description |
---|
PropertyTypeConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
convertValue(Map ctx,
Object target,
Member member,
String attrName,
Object value,
Class toType) |
protected PropertyEditor |
getPropertyEditor(Class<?> type,
String attrName,
Class<?> attrType) |
public Object convertValue(Map ctx, Object target, Member member, String attrName, Object value, Class toType)
convertValue
in interface ognl.TypeConverter
protected PropertyEditor getPropertyEditor(Class<?> type, String attrName, Class<?> attrType)
Copyright © 2004–2018 Apache MINA Project. All rights reserved.