/** * Default constructor. * * @param original the original property validation exception without the * origin information. * @param source the source where the property value has been defined. */ public PropertyExpressionWithSourceMessageBean( final PropertyValueResolveException original, final PropertyLocation source) { super(ConfigurationCode.INVALID_CONFIGURATION_DUE_TO_RESOLVE_WITH_SOURCE, original.getCause(), original.getMessageBean().getPropertyDescriptor(), original.getMessageBean().getExpression()); this.source = source; }
private static boolean isResolvementFailureOfPlaceholder( final PropertyValueResolveException e, final Property property) { return !property.getName().equals(e.getPropertyKey().toString()); }
/** * Returns the key of the property raising the exception. * * @return the key of the property raising the exception. */ public PropertyKey getPropertyKey() { return getMessageBean().getPropertyKey(); }
private String resolveValue(final PropertyDescriptor descriptor, final String value) { try { final String resolvedValue = resolver.resolve((String) value); return resolvedValue; } catch (final ResolveConfigurationException e) { throw new PropertyValueResolveException( new PropertyExpressionMessageBean(e, descriptor, e.getExpression())); } }
private static PropertyValueResolveException wrapWithPropertyValueSourceInformation( final PropertyValueResolveException e, final PropertyDescriptor descriptor, final Property property) { final PropertyValueResolveException cause = isResolvementFailureOfPlaceholder(e, property) ? new PropertyValueResolveException( new PropertyExpressionMessageBean(e, descriptor, property.getValue())) : e; if (!(cause instanceof PropertyValueResolveWithSourceException)) { final PropertyLocation source = property.getSource(); return new PropertyValueResolveWithSourceException( new PropertyExpressionWithSourceMessageBean(cause, source)); } return e; }
private static PropertyValueResolveException wrapWithPropertyValueSourceInformation( final PropertyValueResolveException e, final PropertyDescriptor descriptor, final Property property) { final PropertyValueResolveException cause = isResolvementFailureOfPlaceholder(e, property) ? new PropertyValueResolveException( new PropertyExpressionMessageBean(e, descriptor, property.getValue())) : e; if (!(cause instanceof PropertyValueResolveWithSourceException)) { final PropertyLocation source = property.getSource(); return new PropertyValueResolveWithSourceException( new PropertyExpressionWithSourceMessageBean(cause, source)); } return e; }
private static boolean isResolvementFailureOfPlaceholder( final PropertyValueResolveException e, final Property property) { return !property.getName().equals(e.getPropertyKey().getName()); }