public class Message
extends java.lang.Object
Constructor and Description |
---|
Message(java.lang.String message,
int startPosition)
Creates a message.
|
Message(java.lang.String message,
int startPosition,
int length)
Creates a message.
|
Modifier and Type | Method and Description |
---|---|
int |
getLength()
Returns the length in characters of the original source file indicating
where the source fragment corresponding to this message ends.
|
java.lang.String |
getMessage()
Returns the localized message.
|
int |
getSourcePosition()
Deprecated.
Use
getStartPosition() instead. |
int |
getStartPosition()
Returns the character index into the original source file.
|
public Message(java.lang.String message, int startPosition)
message
- the localized message reported by the compilerstartPosition
- the 0-based character index into the
original source file, or -1
if no source position
information is to be recorded for this messagejava.lang.IllegalArgumentException
- if the message is nulljava.lang.IllegalArgumentException
- if the startPosition is lower than -1.public Message(java.lang.String message, int startPosition, int length)
message
- the localized message reported by the compilerstartPosition
- the 0-based character index into the
original source file, or -1
if no source position
information is to be recorded for this messagelength
- the length in character of the original source file indicating
where the source fragment corresponding to this message ends. 0 or a negative number
if none. A negative number will be converted to a 0-length.java.lang.IllegalArgumentException
- if the message is nulljava.lang.IllegalArgumentException
- if the startPosition is lower than -1.public java.lang.String getMessage()
public int getSourcePosition()
getStartPosition()
instead.-1
if no source position information is recorded for this
messagegetLength()
public int getStartPosition()
-1
if no source position information is recorded for this
messagegetLength()
public int getLength()
0
if no source length information is recorded for this messagegetStartPosition()
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.