|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.Errors
public class Errors
Errors utility used to file processing errors (e.g. validation, provider, resource building errors).
Error filing methods (#warning, #error, #fatal) can be invoked only in the "error scope" which is
created by process(Producer) or
processWithException(Producer) methods. Filed error messages are present also in this
scope.
TODO do not use static thread local?
| Nested Class Summary | |
|---|---|
static class |
Errors.ErrorMessage
Generic error message. |
static class |
Errors.ErrorMessagesException
Error message exception. |
| Method Summary | ||
|---|---|---|
static void |
error(Object source,
String message,
boolean isFatal)
Add an error message to the list of errors. |
|
static void |
error(String message,
boolean isFatal)
Add an error message to the list of errors. |
|
static void |
fatal(Object source,
String message)
Add a fatal error message to the list of errors. |
|
static boolean |
fatalIssuesFound()
Check whether a fatal error message is present in the list of all errors. |
|
static List<Errors.ErrorMessage> |
getErrorMessages()
Get the list of all error messages. |
|
static List<Errors.ErrorMessage> |
getErrorMessages(boolean afterMark)
Get the list of error messages. |
|
static void |
mark()
Set a mark at a current position in the errors messages list. |
|
static
|
process(Producer<T> producer)
Invoke given producer task and gather errors. |
|
static void |
process(Runnable task)
Invoke given task and gather errors. |
|
static
|
processWithException(Producer<T> producer)
Invoke given producer task and gather errors. |
|
static void |
processWithException(Runnable task)
Invoke given task and gather errors. |
|
static void |
reset()
Removes all issues that have been added since the last marked position. |
|
static void |
unmark()
Remove a previously set mark, if any. |
|
static void |
warning(Object source,
String message)
Add a warning message to the list of errors. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void error(String message,
boolean isFatal)
message - message of the error.isFatal - indicates whether this error should be treated as fatal error.
public static void error(Object source,
String message,
boolean isFatal)
source - source of the error.message - message of the error.isFatal - indicates whether this error should be treated as fatal error.
public static void fatal(Object source,
String message)
source - source of the error.message - message of the error.
public static void warning(Object source,
String message)
source - source of the error.message - message of the error.public static boolean fatalIssuesFound()
true if there are any fatal issues in this error context, false otherwise.public static <T> T process(Producer<T> producer)
producer - producer task to be invoked.
public static <T> T processWithException(Producer<T> producer)
exception is thrown.
producer - producer task to be invoked.
public static void process(Runnable task)
task - task to be invoked.public static void processWithException(Runnable task)
exception is thrown.
task - task to be invoked.public static List<Errors.ErrorMessage> getErrorMessages()
public static List<Errors.ErrorMessage> getErrorMessages(boolean afterMark)
afterMark flag indicates whether only those issues should be returned that were
added after a mark has been set.
afterMark - if true, only issues added after a mark has been set are returned,
if false all issues are returned.
public static void mark()
public static void unmark()
public static void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||