public abstract class IllegalHeaderException extends IllegalArgumentException
Example: Catching an IllegalHeaderException
catch(IllegalHeaderException e) { if(e.getMessages().length > 0) { Fetch messages for well-known properties first (optional). e.getMessages(Header.PROP_XYZ); ... Fetch all remaining messages. e.getMessages(); ... } }
Constructor and Description |
---|
IllegalHeaderException()
Creates a new
IllegalHeaderException instance. |
Modifier and Type | Method and Description |
---|---|
String |
getMessage()
Returns the message of the exception.
|
abstract Message[] |
getMessages()
Gets all messages describing the exception.
|
abstract Message[] |
getMessages(String propertyName)
Gets messages bound to a property removing these messages from the instance.
|
abstract String[] |
getPropertyNames()
Gets the names of all properties for which the exception holds messages.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public IllegalHeaderException()
IllegalHeaderException
instance.public String getMessage()
getMessage
in class Throwable
public abstract Message[] getMessages()
public abstract Message[] getMessages(String propertyName)
propertyName
- the name of a property to return any messages for.propertyName
or an empty array if the instance does
not hold messages for a property with name propertyName
.NullPointerException
- if propertyName
is null
.public abstract String[] getPropertyNames()
Copyright © 2005–2014 jDTAUS. All rights reserved.