|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IReporter
The interface used by IValidator's to report messages. The implementation of the IReporter could simply log the messages to stdout, a file, or retain them in a buffer for later access by a user interface.
Reporter implementations should keep non-localized versions of their messages.
Any messages which need to be displayed to the user are done through this class, and if the user cancels the current function, this class is the one which registers the cancellation.
The IReporter instance is created at the time validation begins and ends when validation is complete. There is only one IReporter instance created for all validators that are run on a IResource. The IResource provides a way to get messages put out each validator and add and delete messages for one validator at a time.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Method Summary | |
---|---|
void |
addMessage(IValidator origin,
IMessage message)
Add a locale-independent validation message. |
void |
displaySubtask(IValidator validator,
IMessage message)
Show a text representation of this message, formatted in the default Locale, to the user immediately. |
java.util.List |
getMessages()
|
boolean |
isCancelled()
Return true if the user canceled validation, and false otherwise. |
void |
removeAllMessages(IValidator origin)
Remove all validation messages entered by the identified validator. |
void |
removeAllMessages(IValidator origin,
java.lang.Object object)
Remove all validation messages, entered by the identified validator, pertaining to the Object provided. |
void |
removeMessageSubset(IValidator validator,
java.lang.Object obj,
java.lang.String groupName)
To support removal of a subset of validation messages, an IValidator may assign group names to IMessages. |
Method Detail |
---|
void addMessage(IValidator origin, IMessage message)
Add a locale-independent validation message. It will be displayed later, with all of the other validation messages.
The IValidator passed in is needed for incremental validation (when a message needs to be removed, one validator should not remove messages entered by another validator.) The validator is also queried for information about its resource bundle, to enable support for localization of messages in a client-server environment.
Both parameters must not be null.
origin
- The validator which is the source of the message.message
- A message to be reported.void displaySubtask(IValidator validator, IMessage message)
Both parameters must not be null.
validator
- The validator issuing the subtask message.message
- The message to be displayed to the user.java.util.List getMessages()
boolean isCancelled()
void removeAllMessages(IValidator origin)
The IValidator parameter must not be null.
origin
- Originator validator of the message.void removeAllMessages(IValidator origin, java.lang.Object object)
object
is null, then this method should remove all
messages owned by the validator. (i.e., the same behaviour as the
removeAllMessages(IValidator) method.) The IValidator parameter must not be null.
origin
- Originator validator of the message.object
- Object to which the message belongs. Object is the target object
that was set on the IMessage when adding the message as problem
marker.void removeMessageSubset(IValidator validator, java.lang.Object obj, java.lang.String groupName)
The IValidator parameter must not be null.
If object
is null, then this method should remove all
messages owned by the validator. (i.e., the same behaviour as the
removeAllMessages(IValidator) method.)
If groupName is null, that's the same as no group (i.e., the same
behaviour as the removeAllMessages(IValidator, Object)
method.)
validator
- Originator validator of the message.obj
- Object to which the message belongs.groupName
- Name of the group to which the message belongs.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |