org.kuali.student.common.messagebuilder.impl
Class SimpleBooleanMessageBuilder

java.lang.Object
  extended by org.kuali.student.common.messagebuilder.impl.SimpleBooleanMessageBuilder
All Implemented Interfaces:
MessageTreeBuilder

public class SimpleBooleanMessageBuilder
extends Object
implements MessageTreeBuilder

This class creates success messages for boolean binary tree nodes. Default display is a single line message (e.g. A OR (B AND (C OR D))). To display as multiple lines where each operator and message is on its own line. set the following:

 INDENT_CHAR = ' '
 INDENT_NUMBER_OF_SPACES = 4
 BOOLEAN_OPERATOR_PREFIX = "\n"
 BOOLEAN_OPERATOR_SUFFIX = "\n"
 Example:
 
    MATH101
 OR
        (MATH201
    AND
            (MATH301
        OR
            MATH401))
 


Constructor Summary
SimpleBooleanMessageBuilder(BooleanOperators bo)
          Creates a success message builder with boolean operators to use in building the success message.
SimpleBooleanMessageBuilder(String andOperator, String orOperator)
          Creates a success message builder with boolean operators to use in building the success message.
 
Method Summary
 String buildMessage(BooleanNode node)
          Builds and sets the success message for a single boolean node (b-tree node).
 String buildMessage(List<BooleanNode> nodeList)
          Builds and sets the success message for each of the boolean nodes (binary tree) in the nodeList.
 void setBooleanOperatorPrefix(String booleanOperatorPrefix)
           
 void setBooleanOperatorSuffix(String booleanOperatorSuffix)
           
 void setIndentCharacter(int indentChar)
           
 void setIndentNumberOfSpaces(int indentNumberOfSpaces)
           
 void setIndentString(String indentString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBooleanMessageBuilder

public SimpleBooleanMessageBuilder(String andOperator,
                                   String orOperator)
Creates a success message builder with boolean operators to use in building the success message.

Parameters:
andOperator - AND logical operator
orOperator - OR logical operator

SimpleBooleanMessageBuilder

public SimpleBooleanMessageBuilder(BooleanOperators bo)
Creates a success message builder with boolean operators to use in building the success message.

Parameters:
bo - Boolean operators to build success message
Method Detail

setIndentCharacter

public void setIndentCharacter(int indentChar)

setIndentNumberOfSpaces

public void setIndentNumberOfSpaces(int indentNumberOfSpaces)

setIndentString

public void setIndentString(String indentString)

setBooleanOperatorPrefix

public void setBooleanOperatorPrefix(String booleanOperatorPrefix)

setBooleanOperatorSuffix

public void setBooleanOperatorSuffix(String booleanOperatorSuffix)

buildMessage

public String buildMessage(List<BooleanNode> nodeList)
                    throws MessageBuilderException
Builds and sets the success message for each of the boolean nodes (binary tree) in the nodeList.

Specified by:
buildMessage in interface MessageTreeBuilder
Parameters:
nodeList - List of boolean nodes
Returns:
Complete success message
Throws:
MessageBuilderException

buildMessage

public String buildMessage(BooleanNode node)
Builds and sets the success message for a single boolean node (b-tree node).

Parameters:
node - Boolean node


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.