org.apache.shale.tiger.managed.package.html Maven / Gradle / Ivy
This package contains Java SE 5 annotations that support declaring
JavaServer Faces managed beans through annotations in the class source
code, rather than requiring <managed-bean>
declarations in
a faces-config.xml
configuration resource. The following annotation
types are supported:
- Bean - Declares this class to represent an instance
of a managed bean, specifying the managed bean name and (optionally)
the scope into which newly created instances should be placed.
- Value - Declares that the annotated field is
represented by a property setter, which will use the content of this
element as either a literal String representing the value to be assigned
(after appropriate conversion), or as a value binding expression to be
evaluated in order to acquire the value to which this property should
be set.
It is possible for configuration entries to override the information
configured via annotations. Simply specify a <managed-bean>
with the same managed bean name, and override whatever settings you wish.
Note that, for this use case, it would be ideal if the bean class or property
type elements would not be required (since they can be inferred from the
source code of the annotated class). However, these elements are required
by the DTDs for JavaServer Faces 1.0 and 1.1 configuration resources.
A typical bean class using these annotations might look like this:
// Replaces configuration information in faces-config.xml
@Bean(name="mybean" scope=Scope.SESSION)
public class MyBeanClass {
// Name a property that will be initialized via expression
@Value("#{otherBean.otherProperty}")
private String name = null;
public String getName() { return this.name; }
public void setName(String name) { this.name = name; }
}
API STATUS: Experimental.
IMPLEMENTATION STATUS: Represented by the following classes:
- org.apache.shale.tiger.config.FacesConfigParser
- Preconfigured
Digester
instance that utilizes all of
the defined rule sets, returning a
FacesConfigConfig
instance representing all of the parsed configuration elements.
- org.apache.shale.tiger.faces.LifecycleListener
- Servlet context listener that parses all of the application's
configuraiton resources, using the parsing rules for managed beans.
- org.apache.shale.tiger.faces.VariableResolverImpl
- Custom JavaServer Faces
VariableResolver
that implements the
standard managed bean functionality, plus support for annotated
managed beans.
- org.apache.shale.tiger.managed.config.* -
Beans that represent configuration elements (related to managed beans)
from a JavaServer Faces configuration resource.
- org.apache.shale.tiger.managed.rules.* -
Digester parsing rules (and a rule set) used for parsing managed bean
information from a JavaServer Faces configuration resource.
WARNING - The current implementation is incomplete
(compared to the functionality required by JSF), in that
<list-entries>
and <map-entries>
elements are not recognized, on either a managed bean or a managed
property. This restriction will be lifted later.
@since 1.0.1