de.smartics.properties.api.core.domain
Class PropertyValidationMessageBean
java.lang.Object
de.smartics.exceptions.i18n.AbstractMessageBean
de.smartics.properties.api.core.app.AbstractBaseMessageBean
de.smartics.properties.api.core.domain.PropertyMessageBean
de.smartics.properties.api.core.domain.PropertyDescriptorMessageBean
de.smartics.properties.api.core.domain.PropertyValueMessageBean
de.smartics.properties.api.core.domain.PropertyValidationMessageBean
-
All Implemented Interfaces:
-
de.smartics.exceptions.i18n.MessageBean,
Serializable
-
Direct Known Subclasses:
-
PropertyValidationWithSourceMessageBean
-
public class PropertyValidationMessageBean
-
extends
PropertyValueMessageBean
Provides context information for errors concerning a property.
-
See Also:
-
Serialized Form
Fields inherited from class de.smartics.exceptions.i18n.AbstractMessageBean |
code, localizedInfo |
Methods inherited from class de.smartics.exceptions.i18n.AbstractMessageBean |
getCause, getCauseTrail, getCauseTrail, getClassLoader, getCode, getLocalizedInfo, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getLocalizedTextMessage, getLocalizedTextMessage, getLocalizedTextMessage, getMessage, getMessage, getMessage, getMessages, getMessages, toString |
PropertyValidationMessageBean
public PropertyValidationMessageBean(PropertyDescriptor propertyDescriptor,
List<? extends PropertyConstraint<?>> constraints,
Object value)
-
Convenience constructor with no message and no root cause.
-
Parameters:
-
propertyDescriptor
- the descriptor of the property raising the exception.
-
constraints
- the property constraints that failed to be met.
-
value
- the value of the property that does not meet the constraints. If the value is not serializable, its string representation is stored.
PropertyValidationMessageBean
public PropertyValidationMessageBean(Throwable cause,
PropertyDescriptor propertyDescriptor,
List<? extends PropertyConstraint<?>> constraints,
Object value)
-
Convenience constructor with cause.
-
Parameters:
-
cause
- the cause (which is saved for later retrieval by the
AbstractMessageBean.getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
propertyDescriptor
- the descriptor of the property raising the exception.
-
constraints
- the property constraints that failed to be met.
-
value
- the value of the property that does not meet the constraints. If the value is not serializable, its string representation is stored.
PropertyValidationMessageBean
public PropertyValidationMessageBean(PropertiesCode code,
Throwable cause,
PropertyDescriptor propertyDescriptor,
List<? extends PropertyConstraint<?>> constraints,
Object value)
-
Default constructor.
-
Parameters:
-
code
- the error or exception code of the exception.
-
cause
- the cause (which is saved for later retrieval by the
AbstractMessageBean.getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
-
propertyDescriptor
- the descriptor of the property raising the exception.
-
constraints
- the property constraints that failed to be met.
-
value
- the value of the property that does not meet the constraints. If the value is not serializable, its string representation is stored.
getConstraints
public final List<? extends PropertyConstraint<?>> getConstraints()
-
Returns the property constraints that failed to be met.
-
-
Returns:
-
the property constraints that failed to be met.
getValidationMessage
@MessageParam(value="validationMessage")
public final String getValidationMessage(Locale locale)
-
Returns the validation message provided by the validator.
-
-
Parameters:
-
locale
- the locale to use for message construction.
-
Returns:
-
the validation message provided by the validator.
Copyright © 2012-2013
Kronseder & Reiner GmbH - smartics. All Rights Reserved.