public class IllegalHeaderException extends IllegalHeaderException
Example: Throwing an IllegalHeaderException
IllegalHeaderException e = new IllegalHeaderException(); e.addMessage(message); e.addMessage(Header.PROP_XYZ, message); throw e;
Constructor and Description |
---|
IllegalHeaderException()
Creates a new
IllegalHeaderException instance. |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(Message message)
Adds a message to the instance.
|
void |
addMessage(String propertyName,
Message message)
Adds a message bound to a property to the instance.
|
void |
addMessages(Messages messages)
Adds messages to the instance.
|
void |
addMessages(String propertyName,
Messages messages)
Adds messages bound to a property to the instance.
|
Message[] |
getMessages()
Gets all messages describing the exception.
|
Message[] |
getMessages(String propertyName)
Gets messages bound to a property removing these messages from the instance.
|
String[] |
getPropertyNames()
Gets the names of all properties for which the exception holds messages.
|
String |
toString()
Returns a string representation of the object.
|
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public IllegalHeaderException()
IllegalHeaderException
instance.public void addMessage(Message message)
message
- The message to add to the instance.NullPointerException
- if message
is null
.public void addMessage(String propertyName, Message message)
propertyName
- The name of a property message
is bound to.message
- The message to add to the instance.NullPointerException
- if either message
or propertyName
is null
.public final void addMessages(Messages messages)
messages
- The messages to add to the instance.NullPointerException
- if messages
is null
.public final void addMessages(String propertyName, Messages messages)
propertyName
- The name of a property messages
are bound to.messages
- The messages to add to the instance.NullPointerException
- if either messages
or propertyName
is null
.public Message[] getMessages()
getMessages
in class IllegalHeaderException
public Message[] getMessages(String propertyName)
getMessages
in class IllegalHeaderException
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 String[] getPropertyNames()
getPropertyNames
in class IllegalHeaderException
Copyright © 2005–2014 jDTAUS. All rights reserved.