public abstract class AbstractConverter extends Object implements IConverter
Adds default behaviors common to most converters, including
checking for null
values and wrapping exceptions
in ConverterException
.
ConverterException
Constructor and Description |
---|
AbstractConverter() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
protected abstract String |
nullSafeToString(Object object) |
protected abstract <T> T |
nullSafeToType(String value,
Class<T> type) |
String |
toString() |
String |
toString(Object object) |
protected ConverterException |
toStringException(Object object) |
protected ConverterException |
toStringException(Object object,
Throwable e) |
<T> T |
toType(String value,
Class<T> type) |
protected ConverterException |
toTypeException(String value,
Class<?> type) |
protected ConverterException |
toTypeException(String value,
Class<?> type,
Throwable e) |
protected ConverterException |
toUnsupportedTypeException(Object obj) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toString, toType
public final <T> T toType(String value, Class<T> type)
toType
in interface IConverter
public final String toString(Object object)
toString
in interface IConverter
protected abstract <T> T nullSafeToType(String value, Class<T> type) throws Exception
Exception
protected abstract String nullSafeToString(Object object) throws Exception
Exception
protected ConverterException toUnsupportedTypeException(Object obj)
protected ConverterException toTypeException(String value, Class<?> type)
protected ConverterException toTypeException(String value, Class<?> type, Throwable e)
protected ConverterException toStringException(Object object)
protected ConverterException toStringException(Object object, Throwable e)
Copyright © 2008–2023 Norconex Inc.. All rights reserved.