net.sf.qualitytest.blueprint
Class BlueprintSession

java.lang.Object
  extended by net.sf.qualitytest.blueprint.BlueprintSession

@NotThreadSafe
public final class BlueprintSession
extends Object

A BlueprintSession holds information acquired while doing a blueprint of a class. This includes cycle detection as well as statistical information.

Author:
Dominik Seichter

Constructor Summary
BlueprintSession()
           
 
Method Summary
 Set<Class<?>> getBlueprintClasses()
          Retrieve all classes that have been blueprinted in the current session.
 int getBlueprintCount()
          Retrieve the number of objects which have been blueprinted in the current session.
 String getContext()
          Get the current blueprinting context as string.
 void pop()
          Call after creating a blueprint of a class.
 boolean push(Class<?> clazz)
          Call before creating a blueprint of a class.
 void setLastAction(String lastAction)
          Specify the last action performed on an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlueprintSession

public BlueprintSession()
Method Detail

getBlueprintClasses

public Set<Class<?>> getBlueprintClasses()
Retrieve all classes that have been blueprinted in the current session.

Returns:
a set of classes encountered while creating the blueprint

getBlueprintCount

public int getBlueprintCount()
Retrieve the number of objects which have been blueprinted in the current session.

Returns:
number of objects that have been blueprinted in the current session

getContext

public String getContext()
Get the current blueprinting context as string. This is useful to describe the context in which blueprinting errors have occured.

Returns:
context as string.

pop

public void pop()
Call after creating a blueprint of a class.


push

public boolean push(@Nonnull
                    Class<?> clazz)
Call before creating a blueprint of a class. The internal stack is used to do cycle detection in the blueprinting graph.

Parameters:
clazz - the class for which a blueprint is created
Returns:
true if a cycle in the blueprinting graph was detected

setLastAction

public void setLastAction(@Nonnull
                          String lastAction)
Specify the last action performed on an object. This will be added to the BlueprintSession.getContext() to allow for simpler debugging.

Parameters:
lastAction - A description of the last action.


Copyright © 2012-2013. All Rights Reserved.