Forge - Parent 1.1.2-SNAPSHOT

org.jboss.forge.project
Class BaseProject

java.lang.Object
  extended by org.jboss.forge.project.BaseProject
All Implemented Interfaces:
Project
Direct Known Subclasses:
ProjectImpl

public abstract class BaseProject
extends Object
implements Project

Convenience base class for Project implementations.

Author:
Lincoln Baxter, III

Constructor Summary
BaseProject()
           
 
Method Summary
 boolean equals(Object obj)
           
 Object getAttribute(String key)
          Get an value from this project's internal attributes.
<F extends Facet>
F
getFacet(Class<F> type)
          Return the instance of the requested Facet type, or throw a FacetNotFoundException if no Facet of that type is registered.
 List<Facet> getFacets()
          Return a Collection of the currently installed Facets.
<F extends Facet>
List<F>
getFacets(Class<F> type)
          Return a Collection of the currently installed Facets matching the given type.
 boolean hasAllFacets(Class<? extends Facet>... facetDependencies)
          Return true if this project has all Facets of the given types; otherwise, if any of the given facet types is missing, return false.
 boolean hasAllFacets(Collection<Class<? extends Facet>> facetDependencies)
          Return true if this project has all Facets of the given types; otherwise, if any of the given facet types is missing, return false.
 boolean hasFacet(Class<? extends Facet> type)
          Return true if this project has a facet of the given type; return false otherwise.
 int hashCode()
           
 Project installFacet(Facet facet)
          Install and register the given Facet.
 Project registerFacet(Facet facet)
          Add the given Facet to this Project's internal collection of installed facets.
 void removeAttribute(String key)
          Remove a value from this project's internal attributes.
 Project removeFacet(Facet facet)
          Remove the given Facet from this Project's internal collection of installed facets.
 void setAttribute(String key, Object value)
          Set a value in this project's internal attributes.
 Project unregisterFacet(Facet facet)
          Remove the given Facet from this Project's internal collection of installed facets.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.forge.project.Project
exists, getProjectRoot
 

Constructor Detail

BaseProject

public BaseProject()
Method Detail

getAttribute

public Object getAttribute(String key)
Description copied from interface: Project
Get an value from this project's internal attributes. If the value is not set, return null instead.

Specified by:
getAttribute in interface Project
Parameters:
key - the attribute name

setAttribute

public void setAttribute(String key,
                         Object value)
Description copied from interface: Project
Set a value in this project's internal attributes.

Specified by:
setAttribute in interface Project

removeAttribute

public void removeAttribute(String key)
Description copied from interface: Project
Remove a value from this project's internal attributes.

Specified by:
removeAttribute in interface Project

hasFacet

public boolean hasFacet(Class<? extends Facet> type)
Description copied from interface: Project
Return true if this project has a facet of the given type; return false otherwise.

Specified by:
hasFacet in interface Project

hasAllFacets

public boolean hasAllFacets(Class<? extends Facet>... facetDependencies)
Description copied from interface: Project
Return true if this project has all Facets of the given types; otherwise, if any of the given facet types is missing, return false.

Specified by:
hasAllFacets in interface Project

hasAllFacets

public boolean hasAllFacets(Collection<Class<? extends Facet>> facetDependencies)
Description copied from interface: Project
Return true if this project has all Facets of the given types; otherwise, if any of the given facet types is missing, return false.

Specified by:
hasAllFacets in interface Project

getFacet

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

Specified by:
getFacet in interface Project

getFacets

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

Specified by:
getFacets in interface Project

getFacets

public <F extends Facet> List<F> getFacets(Class<F> type)
Description copied from interface: Project
Return a Collection of the currently installed Facets matching the given type.

Specified by:
getFacets in interface Project

registerFacet

public Project registerFacet(Facet facet)
Description copied from interface: Project
Add the given Facet to this Project's internal collection of installed facets.

Specified by:
registerFacet in interface Project

installFacet

public Project installFacet(Facet facet)
Description copied from interface: Project
Install and register the given Facet. If the facet is already installed, register it instead (See Project.registerFacet(Facet).

Specified by:
installFacet in interface Project

removeFacet

public Project removeFacet(Facet facet)
Description copied from interface: Project
Remove the given Facet from this Project's internal collection of installed facets.

Specified by:
removeFacet in interface Project
Returns:

unregisterFacet

public Project unregisterFacet(Facet facet)
Description copied from interface: Project
Remove the given Facet from this Project's internal collection of installed facets.

Specified by:
unregisterFacet in interface Project

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Forge - Parent 1.1.2-SNAPSHOT

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