Enum Class ValidationMode
- All Implemented Interfaces:
Serializable
,Comparable<ValidationMode>
,Constable
PermazenTransaction
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionObjects are enqueued for validation automatically (if necessary) when they are modified.Validation is disabled.Objects are enqueued for validation only whenPermazenObject.revalidate(java.lang.Class<?>...)
is explicitly invoked. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationMode
Returns the enum constant of this class with the specified name.static ValidationMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISABLED
Validation is disabled. No objects are enqueued for validation, even ifPermazenObject.revalidate(java.lang.Class<?>...)
is invoked. -
MANUAL
Objects are enqueued for validation only whenPermazenObject.revalidate(java.lang.Class<?>...)
is explicitly invoked. -
AUTOMATIC
Objects are enqueued for validation automatically (if necessary) when they are modified.In this mode, objects are enqueued for validation whenever
PermazenObject.revalidate(java.lang.Class<?>...)
is invoked; in addition, objects are enqueued for validation automatically as if byPermazenObject.revalidate(java.lang.Class<?>...)
when:- An instance is created, and the Java model type (or any super-type)
has a JSR 303 annotated public method or
@OnValidate
annoted method - An instance is migrated, and the Java model type (or any super-type)
has a JSR 303 annotated public method or
@OnValidate
annoted method - An instance field is modified, and the corresponding Java model "getter" method has any JSR 303 annotations
Note that the presence of a
@OnValidate
annotation on a method does not in itself result in automatic validation when any field changes (it merely specifies an action to take when validation occurs). To trigger revalidation after field changes, add@OnChange
-annotated method(s) that invokethis.revalidate()
.Note that
AUTOMATIC
enqueues as if byPermazenObject.revalidate(java.lang.Class<?>...)
, i.e., theDefault
validation group applies. Therefore, if a constraint has explicitgroups()
, and none extendDefault
, then it will not be applied automatically. - An instance is created, and the Java model type (or any super-type)
has a JSR 303 annotated public method or
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-