public class MessageCollection extends Object
A MessageCollection object collects all messages obtained from parsing an OCL expression.
Message is an inner class of MessageCollection. You create Messages from outside by qualified new, which causes Messages to automatically register with their MessageCollection. When creating Messages you specify a message number, which refers to a text statically defined in this class construct. These texts may contain substitution points of the form %number%, which can be substituted on Message objects by String values. You can also attach a severity code and source references to a Message. The default severity code is MessageCollection.Severity.ERROR.
The state of MessageCollections can be captured and restored by means of a pair of methods - captureState() and restoreState().
Modifier and Type | Class and Description |
---|---|
class |
MessageCollection.Message
Message objects stand for messages from the OCL compilation process.
|
static class |
MessageCollection.Severity
The Severity enum class exposes two members, which stand for different
levels of severity of diagnostics regarding the OCL translation.
|
Constructor and Description |
---|
MessageCollection() |
Modifier and Type | Method and Description |
---|---|
MessageCollection.Message[] |
getMessages()
Inquire all messages from the MessageCollection object with this
method.
|
int |
getNumberOfMessages()
Inquire number of messages in this MessageCollection.
|
public MessageCollection.Message[] getMessages()
Inquire all messages from the MessageCollection object with this method.
public int getNumberOfMessages()
Inquire number of messages in this MessageCollection.
Copyright © 2018. All rights reserved.