jitas.core
Interface Feedback

All Known Implementing Classes:
SimpleFeedback

public interface Feedback

Abstract Feedback class. Should be subclassed specifically for different domains.

Version:
18 August 2007
Author:
DeathMarch (c314g2)

Method Summary
 void addAdditionalData(java.lang.String s, java.lang.String key, java.lang.String value)
          Adds additional data to a message.
 void addMessage(java.lang.String s)
          Add a message to the Errors, with no additional data.
 void addMessage(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> map)
          Add a message to the Errors, with a Map of additional data.
 void addSatisfiedConstraint(java.lang.String name)
          Add the name of a satisfied constraint to the collection of violated constraints.
 void addViolatedConstraint(java.lang.String name)
          Add the name of a violated constraint to the collection of violated constraints.
 java.util.Map<java.lang.String,java.lang.String> getAdditionalData(java.lang.String message)
          Get any additional data associated with a given message.
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getErrors()
          Get all the errors, including all additional data
 java.util.Set<java.lang.String> getMessages()
          Get the feedback messages, ignoring any additional data
 java.util.Set<java.lang.String> getRelevantConstraints()
          Get the Set of relevant constraints.
 java.util.Collection<java.lang.String> getSatisfiedConstraints()
          Get the collection of satisfied constraint names
 java.util.Collection<java.lang.String> getViolatedConstraints()
          Get the collection of violated constraint names
 

Method Detail

addMessage

void addMessage(java.lang.String s)
Add a message to the Errors, with no additional data.

Parameters:
s - The message to add

addMessage

void addMessage(java.lang.String s,
                java.util.Map<java.lang.String,java.lang.String> map)
Add a message to the Errors, with a Map of additional data.

Parameters:
s - The message to add
map - The map of additional data

addAdditionalData

void addAdditionalData(java.lang.String s,
                       java.lang.String key,
                       java.lang.String value)
Adds additional data to a message. If the message already exists, the key-value pair is added to the additional data for that message. If the message doesn't exist, a new error Map entry is made, with additional data of the key-value pair.

Parameters:
s - The existing message
key - The key for the additional data
value - The value for the additional data

getMessages

java.util.Set<java.lang.String> getMessages()
Get the feedback messages, ignoring any additional data

Returns:
A set of feedback messages

getAdditionalData

java.util.Map<java.lang.String,java.lang.String> getAdditionalData(java.lang.String message)
Get any additional data associated with a given message.

Parameters:
message - The message you want the additional data of
Returns:
A map of additional data.

getErrors

java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getErrors()
Get all the errors, including all additional data

Returns:
A Map> of messages-additional data pairs.

addViolatedConstraint

void addViolatedConstraint(java.lang.String name)
Add the name of a violated constraint to the collection of violated constraints.

Parameters:
name - The name of the constraint to add

getViolatedConstraints

java.util.Collection<java.lang.String> getViolatedConstraints()
Get the collection of violated constraint names

Returns:
The violated constraints names

getSatisfiedConstraints

java.util.Collection<java.lang.String> getSatisfiedConstraints()
Get the collection of satisfied constraint names

Returns:
The satisfied constraint names

addSatisfiedConstraint

void addSatisfiedConstraint(java.lang.String name)
Add the name of a satisfied constraint to the collection of violated constraints.

Parameters:
name - The name of the constraint to add

getRelevantConstraints

java.util.Set<java.lang.String> getRelevantConstraints()
Get the Set of relevant constraints. This is just a union of all satisfied and violated constraints, with duplicates removed.

Returns:
The set of relevant constraints