org.kuali.student.common.messagebuilder
Interface MessageBuilder

All Known Implementing Classes:
MessageBuilderImpl

public interface MessageBuilder


Method Summary
 BooleanFunctionResult build(String booleanRule, MessageContainer messageContainer)
          Builds and evaluates a boolean expression and returns the message and result of the expression.
 BooleanFunctionResult build(String booleanRule, MessageContainer messageContainer, Map<String,Object> messageContextMap)
          Builds and evaluates a boolean expression and returns the message and result of the expression.
 String buildMessage(String booleanRule, MessageContainer messageContainer)
          Builds a message from a list of message using a boolean expression.
 

Method Detail

build

BooleanFunctionResult build(String booleanRule,
                            MessageContainer messageContainer)

Builds and evaluates a boolean expression and returns the message and result of the expression.

Note: Order of boolean operation: ANDs before ORs and operations inside parentheses before anything else.

Example 1: 'A AND B OR C AND D' internally evaluates to '(A AND B) OR (C AND D)'
booleanExpression = "A*B+C*D"
Example 2: '(M1 AND M2) OR M3'
booleanExpression = "(M1*M2)+M3"

Parameters:
booleanRule - Boolean expression
messageContainer - Contains a list of messages
Returns:
Boolean function result
Throws:
MessageBuilderException - Errors building message

build

BooleanFunctionResult build(String booleanRule,
                            MessageContainer messageContainer,
                            Map<String,Object> messageContextMap)

Builds and evaluates a boolean expression and returns the message and result of the expression.

Note: Order of boolean operation: ANDs before ORs and operations inside parentheses before anything else.

if messageContainer contains any velocity templates with keys/tokens then messageContextMap must be set.

Example 1: 'A AND B OR C AND D' internally evaluates to '(A AND B) OR (C AND D)'
booleanExpression = "A*B+C*D"
Example 2: '(M1 AND M2) OR M3'
booleanExpression = "(M1*M2)+M3"

Parameters:
booleanRule - Boolean expression
messageContainer - Contains a list of messages
messageContextMap - Message context template map
Returns:
Boolean function result
Throws:
MessageBuilderException - Errors building message

buildMessage

String buildMessage(String booleanRule,
                    MessageContainer messageContainer)
Builds a message from a list of message using a boolean expression. Example: (M1 AND M2) OR M3 -> (M1*M2)+M3

Parameters:
booleanRule - Boolean expression
messageContainer - Contains a list of messages
Returns:
A message
Throws:
MessageBuilderException - Errors building message


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