net.sourceforge.jfacets
Class JFacetsBuilder

java.lang.Object
  extended by net.sourceforge.jfacets.JFacetsBuilder

public class JFacetsBuilder
extends Object

Builder that eases creation and wiring of the JFacets bean when not relying on an external IoC container. Typical usage looks like this :

         jFacets = new JFacetsBuilder(
              new SimpleProfileRepository(),
              new FacetDescriptorManager("/test-instance-facets.xml")).
              build();
 


Constructor Summary
JFacetsBuilder(IProfileRepository profileRepository, IFacetDescriptorManager facetDescriptorManager)
          Create the builder with mandatory parameters
 
Method Summary
 JFacets build()
          Builds JFacets
 JFacetsBuilder setFacetContextFactory(IFacetContextFactory facetContextFactory)
          Set the facet context factory (defaults to DefaultFacetContextFactory
 JFacetsBuilder setFacetFactory(IFacetFactory facetFactory)
          Set the facet factory (defaults to DefaultFacetFactory
 JFacetsBuilder setFallbackProfileId(String fallbackProfileId)
          Set the fallback profile ID
 JFacetsBuilder setUseProfilesCache(boolean useProfilesCache)
          Use cache for profiles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFacetsBuilder

public JFacetsBuilder(IProfileRepository profileRepository,
                      IFacetDescriptorManager facetDescriptorManager)
Create the builder with mandatory parameters

Parameters:
profileRepository - the profile repository to be used
facetDescriptorManager - the facet descriptor manager to be used
Method Detail

setFacetFactory

public JFacetsBuilder setFacetFactory(IFacetFactory facetFactory)
Set the facet factory (defaults to DefaultFacetFactory

Parameters:
facetFactory - the Facet Factory to be used
Returns:
the builder, for chained call

setFacetContextFactory

public JFacetsBuilder setFacetContextFactory(IFacetContextFactory facetContextFactory)
Set the facet context factory (defaults to DefaultFacetContextFactory

Parameters:
facetContextFactory - the Facet Context Factory to be used
Returns:
the builder, for chained call

build

public JFacets build()
Builds JFacets

Returns:
the JFacets bean, ready for use

setFallbackProfileId

public JFacetsBuilder setFallbackProfileId(String fallbackProfileId)
Set the fallback profile ID

Parameters:
fallbackProfileId - the fallback profile ID
Returns:
the builder, for chained call

setUseProfilesCache

public JFacetsBuilder setUseProfilesCache(boolean useProfilesCache)
Use cache for profiles

Parameters:
useProfilesCache - true if you want to use the built-in profiles cache, false otherwise
Returns:
the builder, for chained call


Copyright © 2012. All Rights Reserved.