use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.
the class BRLConditionColumnDefinitionBuilder method makeRowData.
private List<DTCellValue52> makeRowData(final ColumnUtilities columnUtilities, final BRLConditionColumn brlColumn) {
final List<DTCellValue52> row = new ArrayList<>();
row.add(new DTCellValue52(1));
row.add(new DTCellValue52("desc"));
for (BRLConditionVariableColumn brlVariableColumn : brlColumn.getChildColumns()) {
final DataType.DataTypes dataType = columnUtilities.getDataType(brlVariableColumn);
row.add(makeCell(dataType));
}
return row;
}
use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.
the class BaseColumnDefinitionBuilder method makeRowData.
protected List<DTCellValue52> makeRowData(final ColumnUtilities columnUtilities, final BaseColumn column) {
final List<DTCellValue52> row = new ArrayList<>();
row.add(new DTCellValue52(1));
row.add(new DTCellValue52("desc"));
final DataType.DataTypes dataType = columnUtilities.getDataType(column);
row.add(makeCell(dataType));
return row;
}
use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.
the class BaseSynchronizer method makeModelCellValue.
protected DTCellValue52 makeModelCellValue(final BaseColumn modelColumn) {
DTCellValue52 dcv;
final DTCellValue52 defaultValue = modelColumn.getDefaultValue();
final DataType.DataTypes dataType = columnUtilities.getDataType(modelColumn);
if (modelColumn instanceof LimitedEntryCol) {
dcv = new DTCellValue52(Boolean.FALSE);
} else if (dataType == DataType.DataTypes.BOOLEAN) {
if (defaultValue == null) {
dcv = new DTCellValue52(false);
} else if (defaultValue.getBooleanValue() == null) {
dcv = new DTCellValue52(false);
} else {
dcv = new DTCellValue52(defaultValue.getBooleanValue());
}
} else {
dcv = new DTCellValue52(defaultValue);
}
cellUtilities.convertDTCellValueType(dataType, dcv);
return dcv;
}
use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.
the class TemplateDataCellValueFactory method convertModelCellValue.
/**
* Convert a Model cell to one that can be used in the UI
*
* @param column
* @param dcv
* @return
*/
@Override
public CellValue<? extends Comparable<?>> convertModelCellValue(TemplateDataColumn column, String dcv) {
DataType.DataTypes dataType = getDataType(column);
CellValue<? extends Comparable<?>> cell = null;
switch(dataType) {
case BOOLEAN:
Boolean b = Boolean.FALSE;
try {
b = Boolean.valueOf(dcv);
} catch (Exception e) {
}
cell = makeNewBooleanCellValue(b);
break;
case DATE:
Date d = null;
try {
if (DATE_CONVERTOR == null) {
throw new IllegalArgumentException("DATE_CONVERTOR has not been initialised.");
}
d = DATE_CONVERTOR.parse(dcv);
} catch (Exception e) {
}
cell = makeNewDateCellValue(d);
break;
case NUMERIC:
BigDecimal numericValue = null;
try {
numericValue = new BigDecimal(dcv);
} catch (Exception e) {
}
cell = makeNewNumericCellValue(numericValue);
break;
case NUMERIC_BIGDECIMAL:
BigDecimal bigDecimalValue = null;
try {
bigDecimalValue = new BigDecimal(dcv);
} catch (Exception e) {
}
cell = makeNewBigDecimalCellValue(bigDecimalValue);
break;
case NUMERIC_BIGINTEGER:
BigInteger bigIntegerValue = null;
try {
bigIntegerValue = new BigInteger(dcv);
} catch (Exception e) {
}
cell = makeNewBigIntegerCellValue(bigIntegerValue);
break;
case NUMERIC_BYTE:
Byte byteValue = null;
try {
byteValue = Byte.valueOf(dcv);
} catch (Exception e) {
}
cell = makeNewByteCellValue(byteValue);
break;
case NUMERIC_DOUBLE:
Double doubleValue = null;
try {
doubleValue = new Double(dcv);
} catch (Exception e) {
}
cell = makeNewDoubleCellValue(doubleValue);
break;
case NUMERIC_FLOAT:
Float floatValue = null;
try {
floatValue = new Float(dcv);
} catch (Exception e) {
}
cell = makeNewFloatCellValue(floatValue);
break;
case NUMERIC_INTEGER:
Integer integerValue = null;
try {
integerValue = Integer.valueOf(dcv);
} catch (Exception e) {
}
cell = makeNewIntegerCellValue(integerValue);
break;
case NUMERIC_LONG:
Long longValue = null;
try {
longValue = Long.valueOf(dcv);
} catch (Exception e) {
}
cell = makeNewLongCellValue(longValue);
break;
case NUMERIC_SHORT:
Short shortValue = null;
try {
shortValue = Short.valueOf(dcv);
} catch (Exception e) {
}
cell = makeNewShortCellValue(shortValue);
break;
default:
cell = makeNewStringCellValue(dcv);
}
return cell;
}
use of org.kie.soup.project.datamodel.oracle.DataType in project drools-wb by kiegroup.
the class AnalyzerUpdateTestBase method newRow.
private ArrayList<DTCellValue52> newRow(final DataType.DataTypes[] dataTypes) {
final ArrayList<DTCellValue52> row = new ArrayList<>();
// Row number
row.add(new DTCellValue52());
// Explanation
row.add(new DTCellValue52());
for (final DataType.DataTypes dataType : dataTypes) {
row.add(new DTCellValue52(dataType, true));
}
return row;
}
Aggregations