com.zphinx.spine.core
Class AbstractBuilder

java.lang.Object
  extended by com.zphinx.spine.core.AbstractBuilder

public abstract class AbstractBuilder
extends Object

AbstractBuilder is a base builder for use by a MultiViewProcessor. It provides base methods for developers who wish to utilize the dependency injected builder from configuration within the MultiViewProcessor or the associated BusinessDelegate.

Version:
$1.0

Copyright ©Zphinx Software Solutions

Author:
David Ladapo

Field Summary
static String RUN_RESET
           
 
Constructor Summary
AbstractBuilder()
          Default Constructor
AbstractBuilder(String delegateName, String processorName)
          Public Constructor - Sets the names of the default associates of this Builder
 
Method Summary
 SpineBean createBean(String s)
          Creates a SpineBean from the given string
 SpineBean createBeanFromIndex(int pageIndex)
          Creates a Spine bean using the stated index and the default values of the delegateName and processorNames
 void resetSpineBean(SpineBean sBean)
          Resets the SpineBean by reseting Modified date and the bean's description
protected  void resetSpineBean(SpineBean sBean, Object wrapper)
          Resets the SpineBean by reseting Modified date and the bean's description
 Object runMethod(SpineBean sBean, String runType, Object[] wrapper)
          Invokes the relevant method in this object.
 void setDefaults(String delegateName, String processorName)
          Sets the names of the default associates of this Builder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUN_RESET

public static final String RUN_RESET
See Also:
Constant Field Values
Constructor Detail

AbstractBuilder

public AbstractBuilder()
Default Constructor


AbstractBuilder

public AbstractBuilder(String delegateName,
                       String processorName)
Public Constructor - Sets the names of the default associates of this Builder

Parameters:
delegateName - The name of the delegate which is directly associated to this builder
processorName - The name of the processor which invoked this builder
Method Detail

runMethod

public Object runMethod(SpineBean sBean,
                        String runType,
                        Object[] wrapper)
                 throws SpineException
Invokes the relevant method in this object. The method which will be called is named using the prefix to the method e.g reset and the short/simple name of the objectClass. eg if we have a method resetLetter, set the runType to reset and pass in the full name of the SpineBean.

Parameters:
sBean - The SpineBean whose methods are to be run
runType - The prefix to the method we wish to run
wrapper - An object array used to convey for any other parameters we wish to pass to our method, null if the method expects no parameters.
Throws:
SpineException - The exception thrown if this call fails

resetSpineBean

protected void resetSpineBean(SpineBean sBean,
                              Object wrapper)
Resets the SpineBean by reseting Modified date and the bean's description

Parameters:
sBean - The SpineBean to reset
wrapper - The object passed to this method, is not used in this implementation

resetSpineBean

public void resetSpineBean(SpineBean sBean)
Resets the SpineBean by reseting Modified date and the bean's description

Parameters:
sBean - The SpineBean to reset

createBean

public SpineBean createBean(String s)
                     throws SpineException
Creates a SpineBean from the given string

Parameters:
s - The string which represents the SpineBean type to create
Returns:
An initialised SpineBean of the type denoted by string s
Throws:
SpineException

createBeanFromIndex

public SpineBean createBeanFromIndex(int pageIndex)
                              throws SpineException
Creates a Spine bean using the stated index and the default values of the delegateName and processorNames

Parameters:
pageIndex - The int which is associated with the SpineBean type to create
Returns:
An initialised SpineBean of the type denoted by string s
Throws:
SpineException

setDefaults

public void setDefaults(String delegateName,
                        String processorName)
Sets the names of the default associates of this Builder

Parameters:
delegateName - The name of the delegate which is directly associated to this builder
processorName - The name of the processor which invoked this builder