}
catch (EnterpriseLayoutException e) {
String objectName = className.substring(className.lastIndexOf('.') + 1);
String errMessage = "Error setting " + objectName + "/" + variableName +
" to " + value + " Exception: " + e.getMessage();
throw new EnterpriseFieldException(errMessage, e);
}
if (variableName.indexOf("(") != -1) {
// there are parms to pass (i.e. - Date)
String fieldName = variableName.substring(variableName.indexOf("(") + 1, variableName.indexOf(")"));
logger.debug("setVariableValue: field: " + fieldName);
variableName = fieldName;
}
logger.debug("setVariableValue: " + methodPrefix + "ing " + variableName + " to " + value + " on " + mObj.getClass().getName());
try {
// get setter method
Method setter = null;
try {
setter = mObj.getClass().getMethod(methodPrefix + variableName, new Class[] {classType});
}
catch (Exception exc) {
String errMessage = "ERROR - locating method " + methodPrefix +
variableName + " on " + mObj.getClass().getName() +
". Exception: " + exc.getMessage();
throw new EnterpriseFieldException(errMessage, exc);
}
logger.debug("Setting '" + className + ":" + variableName + "' => '" + value + "'");
setter.invoke(mObj, new Object[] {value});
}
catch (Exception e1) {
String objectName = className.substring(className.lastIndexOf('.') + 1);
String errMessage = "ERROR - " + methodPrefix + "ing " + objectName + "/" +
variableName + " to '" + value + "' Exception: " + e1.getMessage();
throw new EnterpriseFieldException(errMessage, e1);
}
}