case ValidationType.TIME: case ValidationType.TEXT_LENGTH: FormulaValuePair pair1 = toFormulaString(dvRecord.getFormula1(), book); FormulaValuePair pair2 = toFormulaString(dvRecord.getFormula2(), book); return new DVConstraint(dvRecord.getDataType(), dvRecord.getConditionOperator(), pair1.formula(), pair2.formula(), pair1.value(), pair2.value(), null); case ValidationType.LIST: if (dvRecord.getListExplicitFormula()) { String values = toFormulaString(dvRecord.getFormula1(), book).string(); if (values.startsWith("\"")) { values = values.substring(1); return createExplicitListConstraint(explicitListValues); } else { String listFormula = toFormulaString(dvRecord.getFormula1(), book).string(); return createFormulaListConstraint(listFormula); return createCustomFormulaConstraint(toFormulaString(dvRecord.getFormula1(), book).string()); default: throw new UnsupportedOperationException("validationType="+dvRecord.getDataType());
case ValidationType.TIME: case ValidationType.TEXT_LENGTH: FormulaValuePair pair1 = toFormulaString(dvRecord.getFormula1(), book); FormulaValuePair pair2 = toFormulaString(dvRecord.getFormula2(), book); return new DVConstraint(dvRecord.getDataType(), dvRecord.getConditionOperator(), pair1.formula(), pair2.formula(), pair1.value(), pair2.value(), null); case ValidationType.LIST: if (dvRecord.getListExplicitFormula()) { String values = toFormulaString(dvRecord.getFormula1(), book).string(); if (values.startsWith("\"")) { values = values.substring(1); return createExplicitListConstraint(explicitListValues); } else { String listFormula = toFormulaString(dvRecord.getFormula1(), book).string(); return createFormulaListConstraint(listFormula); return createCustomFormulaConstraint(toFormulaString(dvRecord.getFormula1(), book).string()); default: throw new UnsupportedOperationException("validationType="+dvRecord.getDataType());