org.apache.hivemind.service.impl
Class BuilderFacet

java.lang.Object
  |
  +--org.apache.hivemind.impl.BaseLocatable
        |
        +--org.apache.hivemind.service.impl.BuilderFacet
All Implemented Interfaces:
Locatable, LocationHolder
Direct Known Subclasses:
BuilderClassResolverFacet, BuilderErrorHandlerFacet, BuilderLogFacet, BuilderMessagesFacet, BuilderPropertyFacet, BuilderServiceIdFacet, BuilderSmartPropertyFacet

public abstract class BuilderFacet
extends BaseLocatable

Represents one facet of constructing a service implementation instance. A facet is either a property to be set on the constructed instance, or a parameter to the instance class' constructor. Facets are nested properties within BuilderParameter, and are used by BuilderFactory.

Author:
Howard Lewis Ship

Constructor Summary
BuilderFacet()
           
 
Method Summary
 void autowire(java.lang.Object target, java.lang.String serviceId, Module invokingModule)
           
protected  java.lang.String getDefaultPropertyName()
          Returns null.
protected  java.lang.Class getFacetType()
          Returns the type of property assigned by this facet, if known.
abstract  java.lang.Object getFacetValue(java.lang.String serviceId, Module invokingModule, java.lang.Class targetType)
          Implemented in subclasses to provide a specific value for the facet (for use as a constructor parameter, or as a value to set a property to).
 java.lang.String getPropertyName()
           
 void setPropertyName(java.lang.String string)
           
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderFacet

public BuilderFacet()
Method Detail

getFacetValue

public abstract java.lang.Object getFacetValue(java.lang.String serviceId,
                                               Module invokingModule,
                                               java.lang.Class targetType)
Implemented in subclasses to provide a specific value for the facet (for use as a constructor parameter, or as a value to set a property to).

Parameters:
invokingModule - the Module which invoked the BuilderFactory
targetType - the desired property type (extracted from the property type of the property to be updated, when a property is known)

getPropertyName

public java.lang.String getPropertyName()

setPropertyName

public void setPropertyName(java.lang.String string)

autowire

public void autowire(java.lang.Object target,
                     java.lang.String serviceId,
                     Module invokingModule)

getDefaultPropertyName

protected java.lang.String getDefaultPropertyName()
Returns null. Subclasses can provide the default name for a property used by #autowire(Object).


getFacetType

protected java.lang.Class getFacetType()
Returns the type of property assigned by this facet, if known. Returns null otherwise. This implementation returns null. Used by autowire(Object, String, Module).