Declaring component attributes via annotations
- Dominant language
- Java
- Stars
- 127
- Forks
- 59
- Avg merge
- 23h
- Merged PRs (30d)
- 7
Description
As of #594, custom components can be declared to be useable in Facelets via the @FacesComponent annotation. Via this it's no longer required to have an entry in a taglib.xml file.
However, if the component author wishes to declare the component's attributes (for documentation, tooling, etc), XML still has to be used.
I therefor would like to propose declaring these attributes via annotations as well.
E.g.
```
@FacesComponent(value="components.CustomComponent", createTag=true)
public class Foo extends UIComponentBase {
@Attribute
String color; // will be injected with getAttributes("color")
@Attribute(description="This will determine the ...", required=true)
String style;
@Attribute(description="The cost of ... ", default="100")
Integer cost;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.