|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Documented @Target(value=TYPE) public @interface ParentMessageParam
Adds information to a field of the parent exception about which parameter in a message it provides information. This way the attributes (properties) 'message' and (more important) cause can be accessed to provide information for a place holder in a message template.
MessageParam
Optional Element Summary | |
---|---|
String |
detailsParamIndex The index of the place holder in the details message text the field provides information for. |
String |
headerParamIndex The index of the place holder in the header message text the field provides information for. |
String |
implicationsParamIndex The index of the place holder in the implications message text the field provides information for. |
String |
summaryParamIndex The index of the place holder in the summary message text the field provides information for. |
String |
todoParamIndex The index of the place holder in the todo message text the field provides information for. |
String |
urlParamIndex The index of the place holder in the URL message text the field provides information for. |
String |
value The index of the place holder in the message text the field provides information for. |
public abstract String value
If the index is not the same for every message text, use
headerParamIndex()
summaryParamIndex()
detailsParamIndex()
implicationsParamIndex()
todoParamIndex()
urlParamIndex()
to override this index.
If the index is not sufficient, because there is a certain property within the referenced entity, an OGNL (Object-Graph Navigation Language may be added to access a particular value.
Syntax
property=index:ognl-path
Example
cause=1:message
If several properties of a referenced entity are to be displayed at different indices, separate them by commas and the information for different properties separate by colons (;
).
Example
cause=1:message,3:message,4:localizedMessage; message=5
Example 1
Example:
@ParentMessageParam("cause=0:message") public class MethodAccessConfigurationException extends PropertyAccessConfigurationException
The parent property cause
provides the information for placeholder 1
by the throwable's message
text.
Example 2
Example:
@ParentMessageParam( "cause=1:message,3:message,4:localizedMessage; message=5") public class ExampleException extends AbstractLocalizedRuntimeException
The parent property
provides the information ( cause
) for placeholder message
1
and 3
(just to show how the same information can be used for different placeholders), the
provides information for placeholder localizedMessage
4
and the parent's
is used to supply a value for placeholder message
5
.
public abstract String headerParamIndex
public abstract String summaryParamIndex
public abstract String detailsParamIndex
public abstract String implicationsParamIndex
public abstract String todoParamIndex
public abstract String urlParamIndex
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |