Class ConstraintViolationBean<T>
java.lang.Object
jp.ecuacion.lib.core.util.ReflectionUtil
jp.ecuacion.lib.core.jakartavalidation.bean.ConstraintViolationBean<T>
Stores
ConstraintViolation info.
The reason of the existence of the class is that the violations
which are not created by Jakarata Validation can also be treated
just like the one created by Jakarata Validation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStores field-unit parameters.static final recordStores parameters of information on a message for ValidationAppException. -
Constructor Summary
ConstructorsConstructorDescriptionConstraintViolationBean(jakarta.validation.ConstraintViolation<T> cv) Constructs a new instance withConstraintViolation.ConstraintViolationBean(T rootBean, String message, String validatorClass, String rootRecordNameForForm, String itemPropertyPath) Constructs a new instance with parameters, not a ConstraintViolation. -
Method Summary
Modifier and TypeMethodDescriptiongetItemDependentValues(String fullPropertyPath, Class<?> leafBeanClass, Object rootBean, String rootRecordNameForForm) SetsitemNameKeyandshowsValue.static voidgetItemDependentValues(List<ConstraintViolationBean.FieldInfoBean> beanList, Object rootBean, Object leafBean, String rootRecordNameForForm) Gets item dependent values.Gets message created by jakarta validation.booleanvoidsetMessagePostfix(PropertyFileUtil.Arg messagePostfix) voidsetMessagePrefix(PropertyFileUtil.Arg messagePrefix) voidsetMessageWithItemName(boolean isMessageWithItemName) toString()Outputs a string for logs.Methods inherited from class ReflectionUtil
classExists, getField, getLeafBean, getValue, newInstance, searchAnnotationPlacedAtClass
-
Constructor Details
-
ConstraintViolationBean
-
ConstraintViolationBean
Constructs a new instance withConstraintViolation.- Parameters:
cv- ConstraintViolation
-
-
Method Details
-
toString
-
getItemDependentValues
public static void getItemDependentValues(List<ConstraintViolationBean.FieldInfoBean> beanList, Object rootBean, Object leafBean, String rootRecordNameForForm) Gets item dependent values. -
getItemDependentValues
public static ConstraintViolationBean.FieldInfoBean getItemDependentValues(String fullPropertyPath, Class<?> leafBeanClass, Object rootBean, String rootRecordNameForForm) SetsitemNameKeyandshowsValue.It does not consider
@ItemNameKeyClass. In order to consider it,getRootRecordNameConsideringItemNameKeyClass(itemPropertyPath)needs to be used together.- Parameters:
fullPropertyPath- itemPropertyPath- Returns:
- itemNameKey
-
getRootBean
-
getLeafBean
-
getOriginalMessage
Gets message created by jakarta validation.DO NOT USE for user interface. Use the message obtained by ExceptionUtil instead.
- Returns:
- original message
-
getValidatorClass
-
getInvalidValue
-
getMessageId
-
isMessageWithItemName
public boolean isMessageWithItemName() -
setMessageWithItemName
public void setMessageWithItemName(boolean isMessageWithItemName) -
getMessagePrefix
-
setMessagePrefix
-
getMessagePostfix
-
setMessagePostfix
-
getRootRecordNameForForm
-
getFieldInfoBeanList
-
getFieldInfoBeans
-
getParamMap
-
getMessageParameterSet
-