sp.getExtensionByKey(SpeedoProperties.FIELD_CONVERTER);
if (se == null) {
return;
}
f.userFieldMapping = se.value;
UserFieldMapping ufm = null;
try {
ufm = (UserFieldMapping) java.lang.Class.forName(se.value)
.newInstance();
} catch (Exception e) {
throw new SpeedoException(
"Impossible to instanciate the UserFieldMapping class '"
+ se.value + "' for the field '" + sp.name
+ "' of the class '" + sp.moClass.getFQName() + "':", e);
}
if (ufm.getStorageType().isPrimitive()) {
f.toMemory = "new "
+ getJavaLangType(ufm.getStorageType())
+ "(" + f.toMemory + ")";
}
if (ufm.getMemoryType().isPrimitive()) {
f.toStorage = "new "
+ getJavaLangType(ufm.getMemoryType())
+ "(" + f.toStorage + ")";
}
f.toMemory = f.name + "UFM.toMemory(" + f.toMemory + ")";
f.toStorage = f.name + "UFM.toStorage(" + f.toStorage + ")";
if (ufm.getStorageType().isPrimitive()) {
f.toStorage = "(("
+ getJavaLangType(ufm.getStorageType())
+ ") " + f.toStorage + ")."
+ getValueGetter(ufm.getStorageType()) + "()";
} else {
f.toStorage = "("
+ ufm.getStorageType().getName()
+ ") " + f.toStorage;
}
if (ufm.getMemoryType().isPrimitive()) {
f.toMemory = "(("
+ getJavaLangType(ufm.getMemoryType())
+ ") " + f.toMemory + ")."
+ getValueGetter(ufm.getMemoryType()) + "()";
} else {
f.toMemory = "("
+ ufm.getMemoryType().getName()
+ ") " + f.toMemory;
}
}