Package dyntabs.annotation
Annotation Interface DynTabs
Container annotation for
@Repeatable support of the DynTab annotation.
This annotation exists solely because Java requires a "container" annotation
when using the @Repeatable mechanism. Developers never use it directly -
the Java compiler automatically generates it when a class has more than one
@DynTab annotation.
Why it is needed:
A single CDI bean can serve as the basis for multiple different tabs.
For example, a DocsBean can be used for both a "Documents" tab and an "All Documents" tab,
with different parameters. Without @Repeatable support, this would not be possible
since Java does not allow two identical annotations on the same class.
Example (developer writes only @DynTab, compiler automatically wraps in @DynTabs):
@Named
@TabScoped
@DynTab(name = "DocumentsDynTab",
title = "Documents",
includePage = "/WEB-INF/include/docs/docs.xhtml",
parameters = {"listAll=false"})
@DynTab(name = "AllDocsDynTab",
title = "All Documents",
includePage = "/WEB-INF/include/docs/docs.xhtml",
parameters = {"listAll=true"})
public class DocsBean implements DyntabBeanInterface {
// one bean, two different tabs with different parameters
}
- Author:
- DynTabs
- See Also:
-
Required Element Summary
Required Elements
-
Element Details
-
value
DynTab[] valueArray of@DynTabannotations placed on the class. Automatically populated by the Java compiler - developers do not use this directly.- Returns:
- all
@DynTabannotations from the class
-