net.sourceforge.scopes.builders.impl
Class StateBuilderImpl<T>

java.lang.Object
  extended by net.sourceforge.scopes.builders.impl.StateBuilderImpl<T>
Type Parameters:
T - The object containing the raw data, usually a request.
All Implemented Interfaces:
StateBuilder<T>

public class StateBuilderImpl<T>
extends java.lang.Object
implements StateBuilder<T>

This is a simple implementation of a state builder.


Constructor Summary
StateBuilderImpl()
          Constructor.
 
Method Summary
 void addAllManagers(java.util.Map<java.lang.String,ScopeManager<? super T>> managerMap)
          Adds all the managers contained in the map.
 void addManager(java.lang.String scopeName, ScopeManager<? super T> manager)
          Adds a scope manager to the builder, to add a context to the resulting state.
 void clear()
          Clears the list of contained scope managers.
 State createState(T request)
          Creates a state from raw data, usually a request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateBuilderImpl

public StateBuilderImpl()
Constructor.

Method Detail

addManager

public void addManager(java.lang.String scopeName,
                       ScopeManager<? super T> manager)
Description copied from interface: StateBuilder
Adds a scope manager to the builder, to add a context to the resulting state.

Specified by:
addManager in interface StateBuilder<T>
Parameters:
scopeName - The name of the scope.
manager - The manager that can build a scope.

addAllManagers

public void addAllManagers(java.util.Map<java.lang.String,ScopeManager<? super T>> managerMap)
Description copied from interface: StateBuilder
Adds all the managers contained in the map.

Specified by:
addAllManagers in interface StateBuilder<T>
Parameters:
managerMap - A map of type: scope name -> scope manager.

clear

public void clear()
Description copied from interface: StateBuilder
Clears the list of contained scope managers.

Specified by:
clear in interface StateBuilder<T>

createState

public State createState(T request)
Description copied from interface: StateBuilder
Creates a state from raw data, usually a request.

Specified by:
createState in interface StateBuilder<T>
Parameters:
request - The raw data, i.e. the request.
Returns:
The created state.