org.opencms.gwt.shared
Class CmsValidationResult

java.lang.Object
  extended by 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
static CmsValidationResult VALIDATION_OK
          Convenience constant which contains a validation result for successful validations.
 
Constructor Summary
protected CmsValidationResult()
          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
 String getErrorMessage()
          Returns the error message, or null if the validation has succeeded.
 String getNewValue()
          Returns the replacement for the field value.
 boolean hasNewValue()
          Returns true if the field value should be replaced.
 boolean isOk()
          Returns true if the validation has succeeded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATION_OK

public static final CmsValidationResult VALIDATION_OK
Convenience constant which contains a validation result for successful validations.

Constructor Detail

CmsValidationResult

public CmsValidationResult(String errorMessage)
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

public CmsValidationResult(String errorMessage,
                           String newValue)
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 error
newValue - the replacement for the field value

CmsValidationResult

protected CmsValidationResult()
Hidden default constructor.

Method Detail

getErrorMessage

public String getErrorMessage()
Returns the error message, or null if the validation has succeeded.

Returns:
an error message or null the

getNewValue

public String getNewValue()
Returns the replacement for the field value.

Returns:
the replacement for the field value

hasNewValue

public boolean hasNewValue()
Returns true if the field value should be replaced.

Returns:
true if the field value should be replaced

isOk

public boolean isOk()
Returns true if the validation has succeeded.

Returns:
true if the validation has succeeded