com.acsinet_solutions.util.build
Class SimpleBuildingContext

java.lang.Object
  extended by com.acsinet_solutions.util.build.SimpleBuildingContext
All Implemented Interfaces:
BuildingContext

public final class SimpleBuildingContext
extends java.lang.Object
implements BuildingContext

Implementation of a simple building context object

WARNING! This class is not meant to be thread safe

Author:
Santiago Arriaga

Constructor Summary
SimpleBuildingContext(java.lang.Object root)
           
 
Method Summary
 void enterObject(java.lang.String name, java.lang.Object block)
          Enter to a given level path
 void exitObject()
          Exit the current level path.
 java.util.Iterator<java.lang.Object> getBlockIterator()
          Get an iterator with all the blocks
 java.lang.Object getCurrent()
          Get the current building block
 java.lang.Object getRoot()
          Get the root building block
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBuildingContext

public SimpleBuildingContext(java.lang.Object root)
Parameters:
root - A not-null BuildingBlock instance
Method Detail

getRoot

public final java.lang.Object getRoot()
Get the root building block

Specified by:
getRoot in interface BuildingContext
Returns:
A not-null BuildingBlock instance

getCurrent

public final java.lang.Object getCurrent()
Get the current building block

Specified by:
getCurrent in interface BuildingContext
Returns:
A not-null BuildingBlock instance

enterObject

public final void enterObject(java.lang.String name,
                              java.lang.Object block)
Enter to a given level path

Specified by:
enterObject in interface BuildingContext
Parameters:
level - A not-null not-empty valid level value

exitObject

public final void exitObject()
Exit the current level path. Each call to exitBlock corresponds to a previous call to enterBlock

Specified by:
exitObject in interface BuildingContext

getBlockIterator

public final java.util.Iterator<java.lang.Object> getBlockIterator()
Get an iterator with all the blocks

Returns:
A not-null java.util.Iterator instance of BuildingBlock instances