Spring for Apache Hadoop

org.springframework.data.hadoop.config.common.annotation
Class AbstractAnnotationBuilder<O>

java.lang.Object
  extended by org.springframework.data.hadoop.config.common.annotation.AbstractAnnotationBuilder<O>
Type Parameters:
O - the type of Object that is being built
All Implemented Interfaces:
AnnotationBuilder<O>
Direct Known Subclasses:
AbstractConfiguredAnnotationBuilder

public abstract class AbstractAnnotationBuilder<O>
extends java.lang.Object
implements AnnotationBuilder<O>

A base AnnotationBuilder that ensures the object being built is only built one time.

Author:
Rob Winch, Janne Valkealahti

Constructor Summary
AbstractAnnotationBuilder()
           
 
Method Summary
 O build()
          Builds the object and returns it or null.
protected abstract  O doBuild()
          Subclasses should implement this to perform the build.
 O getObject()
          Gets the object that was built.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnnotationBuilder

public AbstractAnnotationBuilder()
Method Detail

build

public final O build()
              throws java.lang.Exception
Description copied from interface: AnnotationBuilder
Builds the object and returns it or null.

Specified by:
build in interface AnnotationBuilder<O>
Returns:
the Object to be built or null if the implementation allows it.
Throws:
java.lang.Exception - if an error occurred when building the Object

getObject

public final O getObject()
Gets the object that was built. If it has not been built yet an Exception is thrown.

Returns:
the Object that was built

doBuild

protected abstract O doBuild()
                      throws java.lang.Exception
Subclasses should implement this to perform the build.

Returns:
the object that should be returned by build().
Throws:
java.lang.Exception - if an error occurs

Spring for Apache Hadoop