org.codehaus.waffle.bind.ognl
Class OgnlValueConverter

java.lang.Object
  extended by org.codehaus.waffle.bind.ognl.OgnlValueConverter
All Implemented Interfaces:
ValueConverter

public class OgnlValueConverter
extends java.lang.Object
implements ValueConverter

Ognl-based implementation of ValueConverter.

Author:
Mauro Talevi

Constructor Summary
OgnlValueConverter()
           
OgnlValueConverter(ognl.TypeConverter converter)
           
 
Method Summary
 boolean accept(java.lang.Class<?> type)
          Determines if converter is compatible with the given type
<T> T
convertValue(java.lang.String propertyName, java.lang.String value, java.lang.Class<T> toType)
          Converts a String value to an Object of a given type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OgnlValueConverter

public OgnlValueConverter()

OgnlValueConverter

public OgnlValueConverter(ognl.TypeConverter converter)
Method Detail

accept

public boolean accept(java.lang.Class<?> type)
Description copied from interface: ValueConverter
Determines if converter is compatible with the given type

Specified by:
accept in interface ValueConverter
Parameters:
type - the type of the field a value is to be bound to
Returns:
A boolean true is type is compatible

convertValue

public <T> T convertValue(java.lang.String propertyName,
                          java.lang.String value,
                          java.lang.Class<T> toType)
Description copied from interface: ValueConverter
Converts a String value to an Object of a given type

Specified by:
convertValue in interface ValueConverter
Parameters:
propertyName - the associated property name, which can be null
value - the String value
toType - the Object type
Returns:
The converted Object


Copyright © 2008. All Rights Reserved.