public abstract class MessageReference extends Object
ODataApplicationException to throw custom exceptions. This class is used
inside the library only.
A MessageReference references to the used message for an ODataMessageException and its sub
classes. It supports
internationalization and translation of exception messages.
Theses classes contain a MessageReference object which
can be mapped to a related key and message text in the resource bundles.
| Modifier and Type | Field and Description |
|---|---|
protected List<Object> |
content |
protected String |
key |
| Modifier and Type | Method and Description |
|---|---|
MessageReference |
addContent(Object... content)
Adds given content to message reference.
|
MessageReference |
create() |
static MessageReference |
create(Class<? extends ODataException> clazz,
String key)
|
boolean |
equals(Object obj)
MessageReferences are equal if their message keys have the same value. |
List<?> |
getContent()
Receives content for this
MessageReference. |
String |
getKey()
Returns message key.
|
int |
hashCode() |
MessageReference |
updateContent(List<?> oldContent,
Object... newContent) |
public static MessageReference create(Class<? extends ODataException> clazz, String key)
MessageReference for given class and key.
This combination of class and key has to be provided
by a resource bundle.clazz - ODataMessageException for which this MessageReference should be usedkey - unique key (in context of ODataMessageException) for reference
to message text in resource bundleMessageReferencepublic MessageReference create()
public String getKey()
public MessageReference addContent(Object... content)
public List<?> getContent()
MessageReference.
Beware that returned list is immutable.public boolean equals(Object obj)
MessageReferences are equal if their message keys have the same value.public MessageReference updateContent(List<?> oldContent, Object... newContent)
Copyright © 2013-2022 The Apache Software Foundation. All Rights Reserved.