public abstract class Severity extends Object implements javax.validation.Payload
ConstraintViolation
. Severity levels are
extraneous to the javax.validation framework and can only be conveyed using generic
Payload
objects. Unfortunately, only the class of those objects is communicated
back to the client. The class is the message. Concrete instances or enum
s (an obvious choice for severity levels) cannot function as Payload
objects.
The Severity class enables you to program using true Severity instances (one for each
level), while behind the scenes only the class of those instances is taken into
account.Modifier and Type | Class and Description |
---|---|
static class |
Severity.Error |
static class |
Severity.Notice |
static class |
Severity.Warning |
Modifier and Type | Field and Description |
---|---|
static Severity.Error |
ERROR |
static Severity.Notice |
NOTICE |
static Severity.Warning |
WARNING |
Modifier and Type | Method and Description |
---|---|
static Severity |
forName(String name)
Get
Severity object for the specified String representation. |
static Severity |
getSeverity(javax.validation.ConstraintViolation<?> error)
Get the
Severity of the specified ConstraintViolation . |
String |
toString() |
public static final Severity.Notice NOTICE
public static final Severity.Warning WARNING
public static final Severity.Error ERROR
public static Severity forName(String name)
name
- The String
representation of Severity
object you want.Severity
objectpublic static Severity getSeverity(javax.validation.ConstraintViolation<?> error)
Severity
of the specified ConstraintViolation
.error
- The ConstraintViolation
Severity
Copyright © 2007-2014 EDIT. All Rights Reserved.