|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.knipp.rritoolkit.response.ErrorMapper<E>
E
- the type error codes are mapped topublic class ErrorMapper<E>
helper class that maps the DENIC error codes to objects (typically enum constants)
Nested Class Summary | |
---|---|
private class |
ErrorMapper.Visitor
small inner class that implements the visitor interface for the patterns |
Field Summary | |
---|---|
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
accessPatterns
the patterns to investigate for a cetain access code |
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
applicationPatterns
the patterns to investigate for a certain application code |
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
classPatterns
the patterns to investigate for a certain error class code |
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
codePatterns
the patterns to investigate for a certain code |
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
componentPatterns
the patterns to investigate for a certain component code |
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> |
errorPatterns
the patterns to investiage for a certain error code |
private java.util.List<ErrorPattern> |
genericPatterns
list of pattern that need to be tested in any case |
private java.util.Map<ErrorPattern,E> |
patternMap
the mapping from the pattern to the user object |
private ErrorMapper.Visitor |
visitor
our visitor for adding new patterns |
Constructor Summary | |
---|---|
ErrorMapper()
constructor |
Method Summary | |
---|---|
void |
add(ErrorPattern pattern,
E obj)
add a new pattern to the mapper. |
static java.util.List<ResultMessage> |
filter(java.lang.Iterable<ResultMessage> msgs,
ErrorPattern... patterns)
filter the given result messages that match one of the given patterns |
boolean |
findMatches(ErrorCode ec,
java.util.Collection<E> result)
test the given error code and add all objects whose related pattern matches to the given collection |
void |
findMatches(java.lang.Iterable<ResultMessage> msgs,
java.util.Collection<E> result)
test the given result messages and add all objects whose related pattern matches to the given list of messages |
void |
findMatches(Response resp,
java.util.Collection<E> result)
test the given response and add all objects whose related pattern matches any result message of the resposne |
boolean |
findMatches(ResultMessage msg,
java.util.Collection<E> result)
test the given result message and add all objects whose related pattern matches to the given collection |
private boolean |
testList(java.util.List<ErrorPattern> list,
ErrorCode ec,
java.util.Collection<E> result)
test all patterns in the given list for a match. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<ErrorPattern,E> patternMap
private java.util.List<ErrorPattern> genericPatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> codePatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> classPatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> accessPatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> applicationPatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> componentPatterns
private java.util.Map<java.lang.String,java.util.List<ErrorPattern>> errorPatterns
private ErrorMapper.Visitor visitor
Constructor Detail |
---|
public ErrorMapper()
Method Detail |
---|
public void add(ErrorPattern pattern, E obj)
pattern
- the patternobj
- the user objectprivate boolean testList(java.util.List<ErrorPattern> list, ErrorCode ec, java.util.Collection<E> result)
list
- the list, may be null
ec
- the error code to matchresult
- the collection, to which the found elements
are added
true
if at least one match
has been foundpublic boolean findMatches(ErrorCode ec, java.util.Collection<E> result)
ec
- the error coderesult
- the collection, to which the found elements
are added
true
if at least one match
has been foundpublic boolean findMatches(ResultMessage msg, java.util.Collection<E> result)
msg
- the result messageresult
- the collection, to which the found elements
are added
true
if at least one match
has been foundpublic void findMatches(java.lang.Iterable<ResultMessage> msgs, java.util.Collection<E> result)
msgs
- the result messagesresult
- the collection, to which the found elements
are addedpublic void findMatches(Response resp, java.util.Collection<E> result)
resp
- the resposneresult
- the collection, to which the found elements
are addedpublic static java.util.List<ResultMessage> filter(java.lang.Iterable<ResultMessage> msgs, ErrorPattern... patterns)
msgs
- the messagespatterns
- the patterns
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |