net.sf.qualitytest.blueprint.strategy.cycle
Class ExceptionCycleHandlingStrategy

java.lang.Object
  extended by net.sf.qualitytest.blueprint.strategy.cycle.ExceptionCycleHandlingStrategy
All Implemented Interfaces:
CycleHandlingStrategy<Object>

public class ExceptionCycleHandlingStrategy
extends Object
implements CycleHandlingStrategy<Object>

The default handling strategy for cycles in the blueprinting graph, which throws a BlueprintCycleException.

Author:
dominik.seichter

Constructor Summary
ExceptionCycleHandlingStrategy()
           
 
Method Summary
 Object handleCycle(BlueprintSession session, Class<?> clazz)
          Handle the situation that a BlueprintCycle was detected for a particular class.
 boolean isActiveForType(Class<?> clazz)
          Decide whether this strategy is active for a given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionCycleHandlingStrategy

public ExceptionCycleHandlingStrategy()
Method Detail

handleCycle

@Nullable
public Object handleCycle(@Nonnull
                                   BlueprintSession session,
                                   @Nonnull
                                   Class<?> clazz)
Description copied from interface: CycleHandlingStrategy
Handle the situation that a BlueprintCycle was detected for a particular class. Is only called if isActiveForType is true for a specific class.

Specified by:
handleCycle in interface CycleHandlingStrategy<Object>
Parameters:
session - The current BlueprintSession
clazz - The class which caused cycle in the blueprinting graph
Returns:
a blue printed instance of T
See Also:
Blueprint

isActiveForType

public boolean isActiveForType(@Nonnull
                               Class<?> clazz)
Description copied from interface: CycleHandlingStrategy
Decide whether this strategy is active for a given type.

Specified by:
isActiveForType in interface CycleHandlingStrategy<Object>
Parameters:
clazz - The class which caused cycle in the blueprinting graph
Returns:
a blue printed instance of T
See Also:
Blueprint


Copyright © 2012-2013. All Rights Reserved.