de.interactive_instruments.ShapeChange.Ocl
Class MessageCollection

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Ocl.MessageCollection

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().

Version:
0.1
Author:
Reinhard Erstling (c) interactive instruments GmbH, Bonn, Germany

Nested Class Summary
 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 Summary
MessageCollection()
           
 
Method Summary
 MessageCollection.Message[] getMessages()
          Inquire all messages from the MessageCollection object with this method.
 int getNumberOfMessages()
          Inquire number of messages in this MessageCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageCollection

public MessageCollection()
Method Detail

getMessages

public MessageCollection.Message[] getMessages()

Inquire all messages from the MessageCollection object with this method.

Returns:
Array of Messages.

getNumberOfMessages

public int getNumberOfMessages()

Inquire number of messages in this MessageCollection.

Returns:
Number of messages in collection


Copyright © 2015. All rights reserved.