public class LookupException extends SemanticException
Actual instances of this exception are usually more specific, being either
AmbiguousLookupException
s or InvalidLookupException
s.
AmbiguousLookupException
,
InvalidLookupException
,
Serialized FormConstructor and Description |
---|
LookupException(String msg)
Initializes me with a user-friendly message describing the nature of
the lookup failure.
|
LookupException(String msg,
List<?> matches)
Initializes me with a user-friendly message describing the nature of
the lookup that resulted in these zero or more matches.
|
LookupException(String msg,
Object firstMatch,
Object secondMatch,
Object... otherMatches)
Initializes me with a user-friendly message describing the nature of
the lookup failure and at least two objects that were ambiguous matches.
|
Modifier and Type | Method and Description |
---|---|
List<?> |
getAmbiguousMatches()
Obtains the list of ambiguous matches, if the problem was one of
ambiguity, in the order in which they were found.
|
List<?> |
getMatches()
Obtains all matches, in the order in which they were found.
|
getDiagnostic
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public LookupException(String msg)
msg
- the exception messagepublic LookupException(String msg, List<?> matches)
msg
- the exception messagematches
- the objects found by the lookuppublic LookupException(String msg, Object firstMatch, Object secondMatch, Object... otherMatches)
msg
- the exception messagefirstMatch
- the first object found by the look-upsecondMatch
- the second object found by the look-upotherMatches
- any further objects found by the look-uppublic List<?> getMatches()
getAmbiguousMatches()
,
InvalidLookupException.getInvalidMatch()
public List<?> getAmbiguousMatches()
InvalidLookupException.getInvalidMatch()
,
getMatches()
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.