[jboss-jira] [JBoss JIRA] (LOGTOOL-91) Add ability to provide constant values for properties

David Lloyd (JIRA) issues at jboss.org
Fri Feb 5 08:06:00 EST 2016


    [ https://issues.jboss.org/browse/LOGTOOL-91?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159223#comment-13159223 ] 

David Lloyd commented on LOGTOOL-91:
------------------------------------

Yeah looks good. I'd probably default to 0 rather than MIN_VALUE though.

> Add ability to provide constant values for properties
> -----------------------------------------------------
>
>                 Key: LOGTOOL-91
>                 URL: https://issues.jboss.org/browse/LOGTOOL-91
>             Project: Log Tool
>          Issue Type: Feature Request
>            Reporter: David Lloyd
>            Assignee: James Perkins
>
> Right now I have to do this:
> {code}
>     @Message(id = 28, value = "An unexpected protocol error occurred")
>     XAException protocolErrorXA(@Property int errorCode);
> // ... then later ...
>     throw Log.log.protocolErrorXA(XAException.XAER_RMFAIL);
> {code}
> I'd rather be able to do this:
> {code}
>     @Message(id = 28, value = "An unexpected protocol error occurred")
>     @Property(name = "errorCode", intValue = XAException.XAER_RMFAIL)
>     XAException protocolErrorXA();
> // ... then later ...
>     throw Log.log.protocolErrorXA();
> {code}
> The same annotation ({{@Property}}) could be reused by making it multi-valued (i.e. invisible wrapper annotation) and adding in defaulted {{xxxValue}} parameters (primitive types, {{Class<XX>}}, and {{String}}) which are rejected when applied directly to a method parameter.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list