jakartaee / jakartaee/faces

Declaring component attributes via annotations

Open
#1,193 17 comments 0 reactions 1 assignee Claimed by @arjantijms View on GitHub
Component: Components/Renderers ease_of_development no-xml Priority: Critical Type: New Feature
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.