Package com.adobe.aemds.guide.common
Class GuideValidationResult
- java.lang.Object
-
- com.adobe.aemds.guide.common.GuideValidationResult
-
public class GuideValidationResult extends java.lang.Object
Class representing the result of server side validation performed for an adaptive form. This class provides APIs to access the list of errors in the submitted adaptive form- Since:
- AEM 6.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GuideValidationResult.OriginCodeStatus
-
Constructor Summary
Constructors Constructor Description GuideValidationResult()
GuideValidationResult(GuideSubmitErrorCause errorCausedBy, int originCode, java.lang.String originMessage)
GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String errorMessage)
GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String originCode, java.lang.String originMessage)
GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String errorMessage, java.util.List<GuideError> guideErrorList)
GuideValidationResult(java.util.List<GuideError> guideErrorList)
Deprecated.from 6.3 use GuideValidationResult(ListguideErrorList, GuideSubmitErrorCause errorCausedBy) instead. GuideValidationResult(java.util.List<GuideError> guideErrorList, GuideSubmitErrorCause errorCausedBy)
GuideValidationResult(java.util.Map<java.lang.String,java.lang.String>[] errorList, java.lang.String excludeFromDorData, GuideSubmitErrorCause errorCausedBy)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GuideSubmitErrorCause
getErrorCause()
java.util.Map<java.lang.String,java.lang.String>[]
getErrorList()
java.lang.String
getErrorMessage()
java.lang.String
getExcludeFromDorData()
java.util.List<GuideError>
getGuideErrorList()
Returns the list of error messages in the server side validationjava.lang.String
getOriginCode()
java.lang.String
getOriginMessage()
org.apache.sling.commons.json.JSONObject
getValidationPayload()
boolean
hasErrors()
Identify if there are any server side validation errorsvoid
setErrorList(java.util.Map<java.lang.String,java.lang.String>[] errorList)
void
setErrorMessage(java.lang.String errorMessage)
void
setExcludeFromDorData(java.lang.String excludeFromDorData)
void
setGuideErrorList(java.util.List<GuideError> guideErrorList)
Deprecated.from 6.3 use setGuideErrorList(ListguideErrorList, GuideSubmitErrorCause errorCausedBy) instead. void
setGuideErrorList(java.util.List<GuideError> guideErrorList, GuideSubmitErrorCause errorCausedBy)
This sets List of error and the cause of errorvoid
setOriginCode(java.lang.String originCode)
void
setOriginDetails(java.lang.String originCode, java.lang.String originDetails)
void
setOriginMessage(java.lang.String originMessage)
-
-
-
Constructor Detail
-
GuideValidationResult
public GuideValidationResult()
-
GuideValidationResult
public GuideValidationResult(java.util.List<GuideError> guideErrorList)
Deprecated.from 6.3 use GuideValidationResult(ListguideErrorList, GuideSubmitErrorCause errorCausedBy) instead. - Parameters:
guideErrorList
- : list of Guide errors
-
GuideValidationResult
public GuideValidationResult(java.util.List<GuideError> guideErrorList, GuideSubmitErrorCause errorCausedBy)
- Parameters:
guideErrorList
- : list of Guide errorserrorCausedBy
- : cause of error
-
GuideValidationResult
public GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String errorMessage)
-
GuideValidationResult
public GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String errorMessage, java.util.List<GuideError> guideErrorList)
- Parameters:
guideErrorList
- : list of Guide errorserrorCausedBy
- : cause of errorerrorMessage
- : top level error message sent by service. This is not localized.
-
GuideValidationResult
public GuideValidationResult(GuideSubmitErrorCause errorCausedBy, java.lang.String originCode, java.lang.String originMessage)
- Parameters:
errorCausedBy
- : cause of errororiginCode
- : Error code sent by invoked service:StringoriginMessage
- : Error message sent by invoked service
-
GuideValidationResult
public GuideValidationResult(java.util.Map<java.lang.String,java.lang.String>[] errorList, java.lang.String excludeFromDorData, GuideSubmitErrorCause errorCausedBy)
-
GuideValidationResult
public GuideValidationResult(GuideSubmitErrorCause errorCausedBy, int originCode, java.lang.String originMessage)
- Parameters:
errorCausedBy
- : cause of errororiginCode
- : Error code sent by invoked service: IntegeroriginMessage
- : Error message sent by invoked service
-
-
Method Detail
-
getGuideErrorList
public java.util.List<GuideError> getGuideErrorList()
Returns the list of error messages in the server side validation- Returns:
- List of error messages
-
setGuideErrorList
public void setGuideErrorList(java.util.List<GuideError> guideErrorList)
Deprecated.from 6.3 use setGuideErrorList(ListguideErrorList, GuideSubmitErrorCause errorCausedBy) instead. This setter should be used when errors occurred due to server side validation.
-
getErrorList
public java.util.Map<java.lang.String,java.lang.String>[] getErrorList()
-
setErrorList
public void setErrorList(java.util.Map<java.lang.String,java.lang.String>[] errorList)
-
getExcludeFromDorData
public java.lang.String getExcludeFromDorData()
-
setExcludeFromDorData
public void setExcludeFromDorData(java.lang.String excludeFromDorData)
-
setOriginDetails
public void setOriginDetails(java.lang.String originCode, java.lang.String originDetails)
-
setErrorMessage
public void setErrorMessage(java.lang.String errorMessage)
-
setOriginCode
public void setOriginCode(java.lang.String originCode)
- Parameters:
originCode
- : error code sent by service
-
setOriginMessage
public void setOriginMessage(java.lang.String originMessage)
- Parameters:
originMessage
- : error message sent by service
-
setGuideErrorList
public void setGuideErrorList(java.util.List<GuideError> guideErrorList, GuideSubmitErrorCause errorCausedBy)
This sets List of error and the cause of error- Parameters:
guideErrorList
- : list of Guide errorserrorCausedBy
- : cause of error
-
getErrorCause
public GuideSubmitErrorCause getErrorCause()
- Returns:
- cause of error.
-
getErrorMessage
public java.lang.String getErrorMessage()
- Returns:
- top level error message not localized.
-
getOriginCode
public java.lang.String getOriginCode()
- Returns:
- The error code sent by service
-
getOriginMessage
public java.lang.String getOriginMessage()
- Returns:
- The error message sent by service
-
hasErrors
public boolean hasErrors()
Identify if there are any server side validation errors- Returns:
- true if the list contains error, false otherwise.
-
getValidationPayload
public org.apache.sling.commons.json.JSONObject getValidationPayload()
-
-