private void validateChildren(Map<String, Serializable> inputs, ErrorReporter errorReporter, SInputDefinition inputDefinition) { if (inputDefinition.hasChildren() && inputDefinition.getType() == null) { if (inputDefinition.isMultiple()) { for (final Map<String, Serializable> complexItem : (List<Map<String, Serializable>>) inputs.get(inputDefinition.getName())) { // we tolerate (and ignore) null values in lists: if (complexItem != null) { validateInputContainer(inputDefinition, complexItem, errorReporter); } } } else { validateInputContainer(inputDefinition, (Map<String, Serializable>) inputs.get(inputDefinition.getName()), errorReporter); } } }
private void validateChildren(Map<String, Serializable> inputs, ErrorReporter errorReporter, SInputDefinition inputDefinition) { if (inputDefinition.hasChildren() && inputDefinition.getType() == null) { if (inputDefinition.isMultiple()) { for (final Map<String, Serializable> complexItem : (List<Map<String, Serializable>>) inputs.get(inputDefinition.getName())) { // we tolerate (and ignore) null values in lists: if (complexItem != null) { validateInputContainer(inputDefinition, complexItem, errorReporter); } } } else { validateInputContainer(inputDefinition, (Map<String, Serializable>) inputs.get(inputDefinition.getName()), errorReporter); } } }
public boolean validate(final SInputDefinition definition, final Object object, ErrorReporter errorReporter) { if (definition.hasChildren() && definition.getType() == null) { if (!isValidForComplexType(definition, object, errorReporter)) { errorReporter.addError(object + " cannot be assigned to " + (definition.isMultiple() ? "multiple " : "") + "COMPLEX type"); return false; } } else { if (!isValidForSimpleType(definition, object)) { errorReporter.addError(object + " cannot be assigned to " + (definition.isMultiple() ? "multiple " : "") + definition.getType()); return false; } } return true; }
public boolean validate(final SInputDefinition definition, final Object object, ErrorReporter errorReporter) { if (definition.hasChildren() && definition.getType() == null) { if (!isValidForComplexType(definition, object, errorReporter)) { errorReporter.addError(object + " cannot be assigned to " + (definition.isMultiple() ? "multiple " : "") + "COMPLEX type"); return false; } } else { if (!isValidForSimpleType(definition, object)) { errorReporter.addError(object + " cannot be assigned to " + (definition.isMultiple() ? "multiple " : "") + definition.getType()); return false; } } return true; }