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

David Lloyd (JIRA) issues at jboss.org
Fri May 29 13:41:02 EDT 2015


David Lloyd created LOGTOOL-91:
----------------------------------

             Summary: 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.3.15#6346)


More information about the jboss-jira mailing list