|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jfacets.annotations.AnnotatedFacetDescriptorManager
public class AnnotatedFacetDescriptorManager
The AnnotatedFacetDescriptorManager : loads and manages descriptors for facets
using the @FacetKey annotation.
This manager scans the classpath in order to find classes that implement
the IFacet interface and are marked with a @FacetKey annotation. If found,
a descriptor is crated and added for this facet, based on the information
supplied in the annotation's attributes.
IMPORTANT : You HAVE to provide at least one base package when
creating this objects.
| Field Summary | |
|---|---|
private java.util.List<java.lang.String> |
basePackages
base packages list to search facet scripts in |
private java.util.ArrayList<FacetDescriptor> |
descriptors
the list of loaded descriptors |
private static JFacetsLogger |
logger
|
private int |
nbDesc
|
| Constructor Summary | |
|---|---|
AnnotatedFacetDescriptorManager(java.util.List<java.lang.String> basePackages)
Create the manager and set base packages. |
|
| Method Summary | |
|---|---|
private FacetDescriptor |
createDescriptorForAnnotation(FacetKey annot,
java.lang.Class facetClass)
Create a descriptor for passed FacetKey and facet class and adds it to the descriptors list |
FacetDescriptor |
getDescriptor(java.lang.String name,
java.lang.String profileId,
java.lang.Class targetObjectType)
Return the descriptor sctrictly associated to passed params if any, null of not found. |
FacetDescriptor[] |
getDescriptors()
Return all descriptors in an array. |
void |
initialize()
Loads all available Facet Descriptors by scanning the CLASSPATH with specified base packages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final JFacetsLogger logger
private java.util.List<java.lang.String> basePackages
private java.util.ArrayList<FacetDescriptor> descriptors
private int nbDesc
| Constructor Detail |
|---|
public AnnotatedFacetDescriptorManager(java.util.List<java.lang.String> basePackages)
basePackages - | Method Detail |
|---|
public void initialize()
private FacetDescriptor createDescriptorForAnnotation(FacetKey annot,
java.lang.Class facetClass)
annot - The FacetKey annotationfacetClass - The facet implementation class
public FacetDescriptor getDescriptor(java.lang.String name,
java.lang.String profileId,
java.lang.Class targetObjectType)
getDescriptor in interface IFacetDescriptorManagerpublic FacetDescriptor[] getDescriptors()
getDescriptors in interface IFacetDescriptorManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||