Class MessageReference
- java.lang.Object
-
- org.apache.olingo.odata2.api.exception.MessageReference
-
public abstract class MessageReference extends Object
APPLICATION DEVELOPERS: Please useODataApplicationExceptionto throw custom exceptions. This class is used inside the library only.A
MessageReferencereferences to the used message for anODataMessageExceptionand its sub classes. It supports internationalization and translation of exception messages.
Theses classes contain aMessageReferenceobject which can be mapped to a related key and message text in the resource bundles.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageReferenceaddContent(Object... content)Adds given content to message reference.MessageReferencecreate()static MessageReferencecreate(Class<? extends ODataException> clazz, String key)booleanequals(Object obj)MessageReferences are equal if their message keys have the same value.List<?>getContent()Receives content for thisMessageReference.StringgetKey()Returns message key.inthashCode()MessageReferenceupdateContent(List<?> oldContent, Object... newContent)
-
-
-
Method Detail
-
create
public static MessageReference create(Class<? extends ODataException> clazz, String key)
Creates aMessageReferencefor givenclassandkey. This combination ofclassandkeyhas to be provided by a resource bundle.- Parameters:
clazz-ODataMessageExceptionfor which thisMessageReferenceshould be usedkey- unique key (in context ofODataMessageException) for reference to message text in resource bundle- Returns:
- created
MessageReference
-
create
public MessageReference create()
-
getKey
public String getKey()
Returns message key.- Returns:
- Chave
-
addContent
public MessageReference addContent(Object... content)
Adds given content to message reference.- Parameters:
content- Conteudo- Returns:
- Referencia
-
getContent
public List<?> getContent()
Receives content for thisMessageReference. Beware that returned list is immutable.- Returns:
- Lista
-
equals
public boolean equals(Object obj)
MessageReferences are equal if their message keys have the same value.
-
updateContent
public MessageReference updateContent(List<?> oldContent, Object... newContent)
-
-