You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by "James Bognar (Jira)" <ji...@apache.org> on 2020/01/01 15:48:00 UTC

[jira] [Created] (JUNEAU-169) Dynamic annotations.

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)