@Override protected V convertToModel(String componentRawValue) throws ConversionException { String value = StringUtils.trimToNull(emptyToNull(componentRawValue)); Datatype<V> datatype = getDatatypeInternal(); if (datatype != null) { try { return datatype.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } if (valueBinding != null && valueBinding.getSource() instanceof EntityValueSource) { EntityValueSource entityValueSource = (EntityValueSource) valueBinding.getSource(); Datatype<V> propertyDataType = entityValueSource.getMetaPropertyPath().getRange().asDatatype(); try { return propertyDataType.parse(componentRawValue, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } return super.convertToModel(componentRawValue); }
@Override protected V convertToModel(String componentRawValue) throws ConversionException { String value = emptyToNull(componentRawValue); if (isTrimming()) { value = StringUtils.trimToNull(value); } if (datatype != null) { try { return datatype.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } if (valueBinding != null && valueBinding.getSource() instanceof EntityValueSource) { EntityValueSource entityValueSource = (EntityValueSource) valueBinding.getSource(); Datatype<V> propertyDataType = entityValueSource.getMetaPropertyPath().getRange().asDatatype(); try { return propertyDataType.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } return super.convertToModel(value); }
@Override protected V convertToModel(String componentRawValue) throws ConversionException { String value = emptyToNull(componentRawValue); if (isTrimming()) { value = StringUtils.trimToNull(value); } if (datatype != null) { try { return datatype.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } if (valueBinding != null && valueBinding.getSource() instanceof EntityValueSource) { EntityValueSource entityValueSource = (EntityValueSource) valueBinding.getSource(); Datatype<V> propertyDataType = entityValueSource.getMetaPropertyPath().getRange().asDatatype(); try { return propertyDataType.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } return super.convertToModel(value); }
@Override protected V convertToModel(String componentRawValue) throws ConversionException { String value = emptyToNull(componentRawValue); if (datatype != null) { try { return datatype.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } if (valueBinding != null && valueBinding.getSource() instanceof EntityValueSource) { EntityValueSource entityValueSource = (EntityValueSource) valueBinding.getSource(); Datatype<V> propertyDataType = entityValueSource.getMetaPropertyPath().getRange().asDatatype(); try { return propertyDataType.parse(value, locale); } catch (ValueConversionException e) { throw new ConversionException(e.getLocalizedMessage(), e); } catch (ParseException e) { throw new ConversionException(getConversionErrorMessage(), e); } } return super.convertToModel(value); }
protected boolean distributeAggregation(AggregationInputValueChangeContext context) { if (distributionProvider != null) { String value = context.getValue(); Object columnId = context.getColumnId(); try { Object parsedValue = getParsedAggregationValue(value, columnId); //noinspection unchecked AggregationDistributionContext<E> distributionContext = new AggregationDistributionContext<E>(getColumn(columnId.toString()), parsedValue, getDatasource().getItems(), context.isTotalAggregation()); distributionProvider.onDistribution(distributionContext); } catch (ValueConversionException e) { showParseErrorNotification(e.getLocalizedMessage()); return false; // rollback to previous value } catch (ParseException e) { showParseErrorNotification(messages.getMainMessage("validationFail")); return false; // rollback to previous value } } return true; }
distributionProvider.onDistribution(aggregationDistribution); } catch (ValueConversionException e) { showParseErrorNotification(e.getLocalizedMessage()); return false; // rollback to previous value } catch (ParseException e) {
v = datatype.parse(e.getValue(), userSessionSource1.getLocale()); } catch (ValueConversionException ex) { showParseExceptionNotification(ex.getLocalizedMessage()); return; } catch (ParseException ex) {