Is there way to do compile-time annotation processing in Java?
Consider this example:
@Name("appName") private Field<String> appName; public void setAppName(String name) { appName.setValue(name); } public String getAppName(String name) { return appName.getValue(); } public void someFunction() { String whatFieldName = appName.getName(); }
Where the annotation Name
will be processed at compile-time to set the value for Field
That is without the common runtime annotation processing. As such, when appName.getName();
(the Field
) is accessed it will return the typed value.
没有评论:
发表评论