return null;
}
longInteger = Transformer
.longInteger(longIntegerString);
if (longInteger == null) {
throw new ConversionException(
"Not a valid Long integer: " + source);
}
} else {
throw new ConversionException(
"Not a valid Long integer: " + source);
}
} else if (targetClass == String.class) {
// from Long to String
if (source instanceof String) {
return source;
} else if (source instanceof Long) {
Long convertedLong = (Long) source;
String longIntegerString = Transformer
.string(convertedLong);
return longIntegerString;
} else {
throw new ConversionException(
"Not a valid Long integer: " + source);
}
} else {
throw new ConversionException("Not a valid Long integer: "
+ source);
}
}
} catch (Exception e) {
log.error("Error in LongConverter: " + targetClass.getName()