juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Bognar (Jira)" <j...@apache.org>
Subject [jira] [Created] (JUNEAU-169) Dynamic annotations.
Date Wed, 01 Jan 2020 15:48:00 GMT
James Bognar created JUNEAU-169:
-----------------------------------

             Summary: Dynamic annotations.
                 Key: JUNEAU-169
                 URL: https://issues.apache.org/jira/browse/JUNEAU-169
             Project: Juneau
          Issue Type: Bug
          Components: Code
    Affects Versions: 8.1.2
            Reporter: James Bognar
            Assignee: James Bognar


Add the ability to define Juneau annotations to be applied beans/methods indirectly for cases
when you don't have access to the source code.

For example, defining a hyperlink on a bean property can be done using the @Html annotation
like so:
{{}}
{code:java}
public class Filespace {
   @Html(link="servlet:/drive/{drive}")
   public String getDrive() {...}
}{code}
A better approach may be to define it via config annotations like so:
{code:java}
public class Filespace {
   public String getDrive() {...}
}

@RestMethod(...)
@HtmlConfig(
   annotateHtml(
      @Html(on="Filespace", link="servlet:/drive/{drive}")
   )
)
public Object doGet() {...}{code}
The "on" annotation would be a comma-delimited list of simple or full class or method names.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message