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.

See Also:
MessageParam

Optional Element Summary
 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 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.

Default:
""


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