Package org.opencms.gwt.shared
Class CmsValidationResult
java.lang.Object
org.opencms.gwt.shared.CmsValidationResult
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsValidationResult
extends Object
implements com.google.gwt.user.client.rpc.IsSerializable
The result of a single field validation.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsValidationResult
Convenience constant which contains a validation result for successful validations. -
Constructor Summary
ModifierConstructorDescriptionprotected
Hidden default constructor.CmsValidationResult
(String errorMessage) Creates a new validation result which doesn't replace the current field value.CmsValidationResult
(String errorMessage, String newValue) Creates a new validation result which also replaces the current field value. -
Method Summary
Modifier and TypeMethodDescriptionReturns the error message, or null if the validation has succeeded.Returns the replacement for the field value.boolean
Returns true if the field value should be replaced.boolean
isOk()
Returns true if the validation has succeeded.
-
Field Details
-
VALIDATION_OK
Convenience constant which contains a validation result for successful validations.
-
-
Constructor Details
-
CmsValidationResult
Creates a new validation result which doesn't replace the current field value.- Parameters:
errorMessage
- the error message to display, or null if there
-
CmsValidationResult
Creates a new validation result which also replaces the current field value.- Parameters:
errorMessage
- the error message to display, or null if there was no errornewValue
- the replacement for the field value
-
CmsValidationResult
protected CmsValidationResult()Hidden default constructor.
-
-
Method Details
-
getErrorMessage
Returns the error message, or null if the validation has succeeded.- Returns:
- an error message or null the
-
getNewValue
Returns the replacement for the field value.- Returns:
- the replacement for the field value
-
hasNewValue
Returns true if the field value should be replaced.- Returns:
- true if the field value should be replaced
-
isOk
Returns true if the validation has succeeded.- Returns:
- true if the validation has succeeded
-