Forge - Parent 2.0.0.Alpha1

org.jboss.forge.facets
Class AbstractFaceted<FACETTYPE extends Facet<?>>

java.lang.Object
  extended by org.jboss.forge.facets.AbstractFaceted<FACETTYPE>
Type Parameters:
FACETTYPE - the base Facet type supported by this Faceted type.
All Implemented Interfaces:
Faceted<FACETTYPE>
Direct Known Subclasses:
AbstractProject, AbstractResource, UIInputComponentBase

public abstract class AbstractFaceted<FACETTYPE extends Facet<?>>
extends Object
implements Faceted<FACETTYPE>

Author:
Lincoln Baxter, III

Constructor Summary
AbstractFaceted()
           
 
Method Summary
<F extends FACETTYPE>
F
getFacet(Class<F> type)
          Return the instance of the requested Facet type, or throw a FacetNotFoundException if no Facet of that type is installed.
 Iterable<FACETTYPE> getFacets()
          Return a Iterable of the currently installed Facets.
<F extends FACETTYPE>
Iterable<F>
getFacets(Class<F> type)
          Return a Iterable of the currently installed Facets matching the given type.
 boolean hasAllFacets(Class<? extends FACETTYPE>... types)
          Return true if all Facets of the given types are present; otherwise, if any of the given facet types is missing, return false.
 boolean hasAllFacets(Iterable<Class<? extends FACETTYPE>> iterable)
          Return true if all Facets of the given types are present; otherwise, if any of the given facet types is missing, return false.
 boolean hasFacet(Class<? extends FACETTYPE> type)
          Return true if a facet of the given type is present; return false otherwise.
 boolean install(FACETTYPE facet)
          Install and register the given Facet.
 boolean uninstall(FACETTYPE facet)
          Remove the given Facet from the internal collection of installed facets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.forge.facets.Faceted
supports
 

Constructor Detail

AbstractFaceted

public AbstractFaceted()
Method Detail

hasFacet

public boolean hasFacet(Class<? extends FACETTYPE> type)
Description copied from interface: Faceted
Return true if a facet of the given type is present; return false otherwise.

Specified by:
hasFacet in interface Faceted<FACETTYPE extends Facet<?>>

hasAllFacets

public boolean hasAllFacets(Iterable<Class<? extends FACETTYPE>> iterable)
Description copied from interface: Faceted
Return true if all Facets of the given types are present; otherwise, if any of the given facet types is missing, return false.

Specified by:
hasAllFacets in interface Faceted<FACETTYPE extends Facet<?>>

hasAllFacets

public boolean hasAllFacets(Class<? extends FACETTYPE>... types)
Description copied from interface: Faceted
Return true if all Facets of the given types are present; otherwise, if any of the given facet types is missing, return false.

Specified by:
hasAllFacets in interface Faceted<FACETTYPE extends Facet<?>>

getFacet

public <F extends FACETTYPE> F getFacet(Class<F> type)
                             throws FacetNotFoundException
Description copied from interface: Faceted
Return the instance of the requested Facet type, or throw a FacetNotFoundException if no Facet of that type is installed.

Specified by:
getFacet in interface Faceted<FACETTYPE extends Facet<?>>
Throws:
FacetNotFoundException

getFacets

public Iterable<FACETTYPE> getFacets()
Description copied from interface: Faceted
Return a Iterable of the currently installed Facets. Return an empty list if no facets of that type were found.

Specified by:
getFacets in interface Faceted<FACETTYPE extends Facet<?>>

getFacets

public <F extends FACETTYPE> Iterable<F> getFacets(Class<F> type)
Description copied from interface: Faceted
Return a Iterable of the currently installed Facets matching the given type.

Specified by:
getFacets in interface Faceted<FACETTYPE extends Facet<?>>

install

public boolean install(FACETTYPE facet)
Description copied from interface: Faceted
Install and register the given Facet. If the facet is already installed, return true.

Specified by:
install in interface Faceted<FACETTYPE extends Facet<?>>

uninstall

public boolean uninstall(FACETTYPE facet)
Description copied from interface: Faceted
Remove the given Facet from the internal collection of installed facets.

Specified by:
uninstall in interface Faceted<FACETTYPE extends Facet<?>>

Forge - Parent 2.0.0.Alpha1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.