de.smartics.exceptions.i18n.message
Annotation Type ParentMessageParam


@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.

Author:
Robert Reiner
See Also:
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.
 

value

public abstract String value
The index of the place holder in the message text the field provides information for.

If the index is not the same for every message text, use

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 cause provides the information ( message) for placeholder 1 and 3 (just to show how the same information can be used for different placeholders), the localizedMessage provides information for placeholder 4 and the parent's message is used to supply a value for placeholder 5.

Returns:
the index of the parameter in the message text.
Default:
""

headerParamIndex

public abstract String headerParamIndex
The index of the place holder in the header message text the field provides information for.

Returns:
the index of the parameter in the header message text.
Default:
""

summaryParamIndex

public abstract String summaryParamIndex
The index of the place holder in the summary message text the field provides information for.

Returns:
the index of the parameter in the summary message text.
Default:
""

detailsParamIndex

public abstract String detailsParamIndex
The index of the place holder in the details message text the field provides information for.

Returns:
the index of the parameter in the details message text.
Default:
""

implicationsParamIndex

public abstract String implicationsParamIndex
The index of the place holder in the implications message text the field provides information for.

Returns:
the index of the parameter in the implications message text.
Default:
""

todoParamIndex

public abstract String todoParamIndex
The index of the place holder in the todo message text the field provides information for.

Returns:
the index of the parameter in the todo message text.
Default:
""

urlParamIndex

public abstract String urlParamIndex
The index of the place holder in the URL message text the field provides information for.

Returns:
the index of the parameter in the URL message text.
Default:
""


Copyright © 2007-null Kronseder & Reiner GmbH - smartics. All Rights Reserved.