com.redijedi.tapestry.internal.DoubleValueEncoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redijedi-t5-components
Show all versions of redijedi-t5-components
A collection of components built specifically for Tapestry 5.
The newest version!
package com.redijedi.tapestry.internal;
import org.apache.tapestry.ValueEncoder;
/**
* @author torr
*
*/
public class DoubleValueEncoder implements ValueEncoder {
public String toClient(Double value) {
return value == null ? "" : value.toString();
}
public Double toValue(String clientValue) {
try {
return new Double(clientValue);
} catch (NumberFormatException e) {
return null;
}
}
}