net.sourceforge.jfacets.impl
Class FacetRepositoryImpl

java.lang.Object
  extended by net.sourceforge.jfacets.impl.FacetRepositoryImpl
All Implemented Interfaces:
IFacetRepository

public class FacetRepositoryImpl
extends java.lang.Object
implements IFacetRepository

Implementation of the facet repository

Author:
Remi VANKEISBELCK - rvkb.com (remi 'at' rvkb.com)

Field Summary
private  IFacetContextFactory facetContextFactory
          the facet context factory to create contexts
private  IFacetDescriptorManager facetDescriptorManager
          the descriptors manager
private  IFacetFactory facetFactory
          the facet factory to be used for facet instantiation
private static JFacetsLogger logger
          the logger
private  IProfileRepository profileRepo
          a ref to the profile repository
 
Constructor Summary
FacetRepositoryImpl(IProfileRepository pRepo, IFacetFactory facetFactory, IFacetContextFactory facetContextFactory, IFacetDescriptorManager facetDescriptorManager)
          everything loaded at construction
 
Method Summary
private  java.lang.Object climbProfiles(java.lang.String facetName, IProfile profile, java.lang.Object targetObject, java.lang.Class targetObjectClass, java.util.List<FacetDescriptor> discardedDescriptors)
           
private  java.lang.Object climbTypes(java.lang.String facetName, IProfile profile, java.lang.Object targetObject, java.lang.Class targetObjectClass, java.util.List<java.lang.Class> alreadyCheckedClasses, java.util.List<FacetDescriptor> discardedDescriptors)
           
 FacetDescriptor[] getDescriptors(IProfile profile, java.lang.Class targetObjectType)
          Return all the facet descriptors that match passed profile and object type, handling inheritance.
static java.lang.Class[] getDirectSuperTypes(java.lang.Class objectType)
          returns first level supertypes for passed objectType
 java.lang.Object getFacet(java.lang.String facetName, IProfile profile, java.lang.Object targetObject)
          Method for retrieving facets.
 java.lang.Object getFacet(java.lang.String name, IProfile profile, java.lang.Object targetObject, java.lang.Class targetObjectType)
          Method for retrieving facets.
 IFacetContextFactory getFacetContextFactory()
          Return the FacetContextFactory
 IFacetDescriptorManager getFacetDescriptorManager()
          Return the FacetDescriptorManager
 IFacetFactory getFacetFactory()
          Return the FacetFactory
 IProfileRepository getProfileRepository()
          Return the ProfileRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profileRepo

private IProfileRepository profileRepo
a ref to the profile repository


facetFactory

private IFacetFactory facetFactory
the facet factory to be used for facet instantiation


facetContextFactory

private IFacetContextFactory facetContextFactory
the facet context factory to create contexts


facetDescriptorManager

private IFacetDescriptorManager facetDescriptorManager
the descriptors manager


logger

private static final JFacetsLogger logger
the logger

Constructor Detail

FacetRepositoryImpl

public FacetRepositoryImpl(IProfileRepository pRepo,
                           IFacetFactory facetFactory,
                           IFacetContextFactory facetContextFactory,
                           IFacetDescriptorManager facetDescriptorManager)
everything loaded at construction

Method Detail

getDirectSuperTypes

public static java.lang.Class[] getDirectSuperTypes(java.lang.Class objectType)
returns first level supertypes for passed objectType


getDescriptors

public FacetDescriptor[] getDescriptors(IProfile profile,
                                        java.lang.Class targetObjectType)
Description copied from interface: IFacetRepository
Return all the facet descriptors that match passed profile and object type, handling inheritance.

Specified by:
getDescriptors in interface IFacetRepository

getProfileRepository

public IProfileRepository getProfileRepository()
Description copied from interface: IFacetRepository
Return the ProfileRepository

Specified by:
getProfileRepository in interface IFacetRepository

getFacetFactory

public IFacetFactory getFacetFactory()
Description copied from interface: IFacetRepository
Return the FacetFactory

Specified by:
getFacetFactory in interface IFacetRepository

getFacetContextFactory

public IFacetContextFactory getFacetContextFactory()
Description copied from interface: IFacetRepository
Return the FacetContextFactory

Specified by:
getFacetContextFactory in interface IFacetRepository

getFacetDescriptorManager

public IFacetDescriptorManager getFacetDescriptorManager()
Description copied from interface: IFacetRepository
Return the FacetDescriptorManager

Specified by:
getFacetDescriptorManager in interface IFacetRepository

getFacet

public java.lang.Object getFacet(java.lang.String facetName,
                                 IProfile profile,
                                 java.lang.Object targetObject)
Description copied from interface: IFacetRepository
Method for retrieving facets. Uses targetObject's run-time type.

Specified by:
getFacet in interface IFacetRepository
Returns:
the facet (with assigned context if implementing IFacet) if found, null if not found

getFacet

public java.lang.Object getFacet(java.lang.String name,
                                 IProfile profile,
                                 java.lang.Object targetObject,
                                 java.lang.Class targetObjectType)
Description copied from interface: IFacetRepository
Method for retrieving facets. Uses passed targetObjectClass, therefore you can pass null targetObjects !

Specified by:
getFacet in interface IFacetRepository
Returns:
the facet (with assigned context if implementing) if found, null if not found

climbProfiles

private java.lang.Object climbProfiles(java.lang.String facetName,
                                       IProfile profile,
                                       java.lang.Object targetObject,
                                       java.lang.Class targetObjectClass,
                                       java.util.List<FacetDescriptor> discardedDescriptors)

climbTypes

private java.lang.Object climbTypes(java.lang.String facetName,
                                    IProfile profile,
                                    java.lang.Object targetObject,
                                    java.lang.Class targetObjectClass,
                                    java.util.List<java.lang.Class> alreadyCheckedClasses,
                                    java.util.List<FacetDescriptor> discardedDescriptors)


Copyright © 2010. All Rights Reserved.