org.keridwen.core.messaging.internal
Class DefaultCondition

java.lang.Object
  extended by org.keridwen.core.messaging.internal.DefaultCondition
All Implemented Interfaces:
Condition

public class DefaultCondition
extends Object
implements Condition

This is the default implementation of the Condition interface.


Constructor Summary
DefaultCondition()
          Default constructor.
 
Method Summary
 void addConditionListener(ConditionListener listener)
          Adds a ConditionListener to the Condition.
 Collection<Class<? extends Command<?,?>>> getValidationCommands()
          Gets the list of Commands that validate the Condition.
 boolean isValid()
          Indicates if the Condition is fulfilled or not.
 void registerValidationCommand(Class<? extends Command<?,?>> command)
          Registers a Command that validates the Condition.
 void removeConditionListener(ConditionListener listener)
          Removes the given ConditionListener that observes the Condition.
 void setValid(boolean validity)
          Sets the Condition validity.
 void unregisterValidationCommand(Class<? extends Command<?,?>> command)
          Unregisters the given Command from the list of Commands able to validate the Condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCondition

public DefaultCondition()
Default constructor.

Method Detail

addConditionListener

public final void addConditionListener(ConditionListener listener)
Description copied from interface: Condition
Adds a ConditionListener to the Condition.

Specified by:
addConditionListener in interface Condition
Parameters:
listener - the ConditionListener to add.

getValidationCommands

public final Collection<Class<? extends Command<?,?>>> getValidationCommands()
Description copied from interface: Condition
Gets the list of Commands that validate the Condition.

Specified by:
getValidationCommands in interface Condition
Returns:
the list of Commands that validate the Condition.

isValid

public final boolean isValid()
Description copied from interface: Condition
Indicates if the Condition is fulfilled or not.

Specified by:
isValid in interface Condition
Returns:
true if the Condition is fulfilled

registerValidationCommand

public final void registerValidationCommand(Class<? extends Command<?,?>> command)
Description copied from interface: Condition
Registers a Command that validates the Condition.

Specified by:
registerValidationCommand in interface Condition
Parameters:
command - a Command that validates the Condition

removeConditionListener

public final void removeConditionListener(ConditionListener listener)
Description copied from interface: Condition
Removes the given ConditionListener that observes the Condition.

Specified by:
removeConditionListener in interface Condition
Parameters:
listener - the ConditionListener to remove

setValid

public final void setValid(boolean validity)
Description copied from interface: Condition
Sets the Condition validity.

Specified by:
setValid in interface Condition
Parameters:
validity - the validity to set

unregisterValidationCommand

public final void unregisterValidationCommand(Class<? extends Command<?,?>> command)
Description copied from interface: Condition
Unregisters the given Command from the list of Commands able to validate the Condition.

Specified by:
unregisterValidationCommand in interface Condition
Parameters:
command - the Command to unregister


Copyright © 2010-2013 Artenum. All Rights Reserved.