org.favabeans.base
Interface FacetRegistry

All Known Implementing Classes:
DefaultFacetRegistry

public interface FacetRegistry

A FacetRegistry creates Facet objects and maintains their association with their primary objects.


Method Summary
 boolean addFactory(Type primaryObjectType, Type facetType, FacetFactory factory)
          Add a FacetFactory to this FacetRegistry.
 void addTypeInfoListener(TypeInfoListener l)
           
 void clear()
          Clear all FacetFactory and Facet objects from this FacetRegistry.
 boolean clearFacets(Object primaryObject)
          Remove all references to any Facets for the supplied primary object from this FacetRegistry.
 Facet getFacet(Object primaryObject, Type facetType)
          Obtain a facet of the supplied Type for a given primary object.
 Set getFacetTypes(Object primaryObject)
          Obtain the set of facet Types which can be constructed for a given primary object.
 boolean removeFactory(Type primaryObjectType, Type facetType)
          Remove a FacetFactory from this FacetRegistry.
 void removeTypeInfoListener(TypeInfoListener l)
           
 

Method Detail

clear

public void clear()
Clear all FacetFactory and Facet objects from this FacetRegistry.

addFactory

public boolean addFactory(Type primaryObjectType,
                          Type facetType,
                          FacetFactory factory)
Add a FacetFactory to this FacetRegistry.
Parameters:
primaryObjectType - the Type of primary object to which this FacetFactory will be applicable.
facetType - the Type of the Facets which this FacetFactory will create.
factory - the FacetFactory to add.
Returns:
true if this FacetFactory was modified as a result of this operation; false otherwise.

removeFactory

public boolean removeFactory(Type primaryObjectType,
                             Type facetType)
Remove a FacetFactory from this FacetRegistry.
Parameters:
primaryObjectType - the Type of primary object to which the desired FacetFactory is applicable.
facetType - the Type of the Facets which the desired FacetFactory creates.
Returns:
true if this FacetFactory was modified as a result of this operation; false otherwise.

getFacetTypes

public Set getFacetTypes(Object primaryObject)
Obtain the set of facet Types which can be constructed for a given primary object.
Parameters:
primaryObject - the primary object for which to obtain the facet Types.
Returns:
the relevant facet Types, which may be an empty set but are never null.

getFacet

public Facet getFacet(Object primaryObject,
                      Type facetType)
Obtain a facet of the supplied Type for a given primary object.
Parameters:
primaryObject - the primary object.
facetType - the desired Type of the returned facet.
Returns:
an appropriate facet, or null if one could not be constructed.

clearFacets

public boolean clearFacets(Object primaryObject)
Remove all references to any Facets for the supplied primary object from this FacetRegistry.
Parameters:
primaryObject - the object for which to remove the Facets.
Returns:
true if this FacetRegistry was modified as a result of this operation; false otherwise.

addTypeInfoListener

public void addTypeInfoListener(TypeInfoListener l)

removeTypeInfoListener

public void removeTypeInfoListener(TypeInfoListener l)


Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.