org.nakedobjects.metamodel.facets
Interface FacetHolder

All Known Subinterfaces:
Identified, NakedObjectAction, NakedObjectActionParameter, NakedObjectActionParamPeer, NakedObjectActionPeer, NakedObjectAssociation, NakedObjectAssociationPeer, NakedObjectFeature, NakedObjectMember, NakedObjectMemberPeer, NakedObjectSpecification, NamedAndDescribedFacetHolder, OneToManyAssociation, OneToManyFeature, OneToOneActionParameter, OneToOneAssociation, OneToOneFeature, ParseableEntryActionParameter, ParseableEntryFeature, Specification, TypedSpecification
All Known Implementing Classes:
FacetHolderImpl, IdentifiedImpl, InstanceCollectionSpecification, IntrospectableSpecificationAbstract, JavaNakedObjectActionParamPeer, JavaNakedObjectActionPeer, JavaNakedObjectAssociationPeer, JavaNakedObjectMemberPeer, JavaOneToManyAssociationPeer, JavaOneToOneAssociationPeer, JavaSpecification, NakedObjectActionImpl, NakedObjectActionParameterAbstract, NakedObjectActionParameterParseable, NakedObjectActionPeerDecorator, NakedObjectActionSet, NakedObjectAssociationAbstract, NakedObjectAssociationPeerDecorator, NakedObjectMemberAbstract, NakedObjectSpecificationNoMember, NamedAndDescribedFacetHolderImpl, OneToManyAssociationImpl, OneToOneActionParameterImpl, OneToOneAssociationImpl

public interface FacetHolder

Anything in the metamodel (which also includes peers in the reflector) that can be extended.


Method Summary
 void addFacet(Facet facet)
          Adds the facet, extracting its type as the key.
 void addFacet(MultiTypedFacet facet)
          Adds the multi-typed facet, extracting each of its types as keys.
 boolean containsFacet(java.lang.Class<? extends Facet> facetType)
          Whether there is a facet registered of the specified type.
<T extends Facet>
T
getFacet(java.lang.Class<T> cls)
          Get the facet of the specified type (as per the type it reports from Facet.facetType()).
 Facet[] getFacets(Filter<Facet> filter)
          Returns all Facets matching the specified FacetFilter.
 java.lang.Class<? extends Facet>[] getFacetTypes()
          Get the list of all facet types that are supported by objects of this specification.
 void removeFacet(java.lang.Class<? extends Facet> facetType)
          Remove the facet of the specified type.
 void removeFacet(Facet facet)
          Remove the facet whose type is that reported by Facet.facetType().
 

Method Detail

getFacetTypes

java.lang.Class<? extends Facet>[] getFacetTypes()
Get the list of all facet types that are supported by objects of this specification.


containsFacet

boolean containsFacet(java.lang.Class<? extends Facet> facetType)
Whether there is a facet registered of the specified type.

Convenience; saves having to getFacet(Class) and then check if null.


getFacet

<T extends Facet> T getFacet(java.lang.Class<T> cls)
Get the facet of the specified type (as per the type it reports from Facet.facetType()).


getFacets

Facet[] getFacets(Filter<Facet> filter)
Returns all Facets matching the specified FacetFilter.

Parameters:
filter -
Returns:

addFacet

void addFacet(Facet facet)
Adds the facet, extracting its type as the key.

If there are any facet of the same type, they will be overwritten provided that either the Facet specifies to always replace or if the existing Facet is a no-op.


addFacet

void addFacet(MultiTypedFacet facet)
Adds the multi-typed facet, extracting each of its types as keys.

If there are any facet of the same type, they will be overwritten provided that either the Facet specifies to always replace or if the existing Facet is a no-op.


removeFacet

void removeFacet(Facet facet)
Remove the facet whose type is that reported by Facet.facetType().


removeFacet

void removeFacet(java.lang.Class<? extends Facet> facetType)
Remove the facet of the specified type.



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.