de.interactive_instruments.ShapeChange.Ocl
Class MessageCollection.Message

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Ocl.MessageCollection.Message
Enclosing class:
MessageCollection

public class MessageCollection.Message
extends Object

Message objects stand for messages from the OCL compilation process. They consist of an message number, an associated message text, which contains substitution points, a severity code and a collection of source code references.

The default severity code of a message is ERROR, except for those messages, which stand for a compiler malfunction. In the latter case the code SYSTEMERROR is chosen.

A Message object is always part of a MessageCollection. You have to create Messages by means of the new operator, qualified by the associated MessageCollection object.


Method Summary
 String getFormattedSourceReferences(int offLine, int offCol, String[] delims)
          Use this method to obtain a formatted representation of the source references of a message.
 String getMessageText()
          This method returns the text of the message object.
 MessageCollection.Severity getSeverity()
          Inquire the severity of a Message by means of this method.
 SourceReference[] getSourceReferences()
          This method lets you inquire the source code references of the message as an array of SourceReference objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSourceReferences

public SourceReference[] getSourceReferences()
This method lets you inquire the source code references of the message as an array of SourceReference objects.

Returns:
Array of SourceReference objects

getSeverity

public MessageCollection.Severity getSeverity()
Inquire the severity of a Message by means of this method.

Returns:
Severity of message

getMessageText

public String getMessageText()
This method returns the text of the message object.

Returns:
Message text as String object

getFormattedSourceReferences

public String getFormattedSourceReferences(int offLine,
                                           int offCol,
                                           String[] delims)

Use this method to obtain a formatted representation of the source references of a message.

The format will be: line/col1:col2,line/col1:col2,..., where "/", ":" and "," can be defined with other strings in index 0, 1 and 2 of the delims array.

Parameters:
offLine - Offset to add to line numbers, originally counting from 0.
offCol - Offset to add to column numbers, originally counting from 0.
delims - Array of Strings defining delimiters "/", ":" and ",".
Returns:
Formatted string


Copyright © 2015. All rights reserved.