Skip to content

Commit

Permalink
Parameter will be transformed from nearly any type into nearly any type
Browse files Browse the repository at this point in the history
  • Loading branch information
jlolling committed Nov 10, 2018
1 parent 4c1b508 commit 482e053
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ public void setAndConvertParameterCollectionValues(
* @param parameterName
* @param valuesAsString
* single value as string
* @param dataType
* @param targetDataType
* the data type of the parameter (the string values will be
* converted into this type)
* @param pattern
Expand All @@ -962,11 +962,11 @@ public void setAndConvertParameterCollectionValues(
public void setAndConvertParameterValue(
String parameterName,
Object value,
String dataType,
String targetDataType,
String pattern)
throws Exception {
parameterMap.put(parameterName,
Util.convertToDatatype(value, dataType, pattern));
Util.convertToDatatype(value, targetDataType, pattern));
}

public Object getParameterValue(String parameterName) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/jlo/talendcomp/jasperreportexec/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static java.util.List<Object> convertToList(String valuesSeparated, Strin
public static Object convertToDatatype(Object value, String targetDataType, String pattern) throws Exception {
if (value != null) {
if ("String".equalsIgnoreCase(targetDataType)) {
return value;
return convertToString(value, pattern);
} else if ("BigDecimal".equalsIgnoreCase(targetDataType)) {
return convertToBigDecimal(value);
} else if ("Boolean".equalsIgnoreCase(targetDataType)) {
Expand Down
Binary file not shown.

0 comments on commit 482e053

Please sign in to comment.