Class CompilerMessage
- java.lang.Object
-
- net.emustudio.emulib.plugins.compiler.CompilerMessage
-
public class CompilerMessage extends java.lang.ObjectMessages are passed to compiler listeners when the compiler wishes to say something.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCompilerMessage.MessageTypeMessage type.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMSG_ERRORstatic java.lang.StringMSG_INFOstatic java.lang.StringMSG_WARNINGstatic java.lang.StringPOSITION_FORMAT
-
Constructor Summary
Constructors Constructor Description CompilerMessage(java.lang.String message)This constructor creates the Message object.CompilerMessage(CompilerMessage.MessageType type, java.lang.String message)This constructor creates the Message object.CompilerMessage(CompilerMessage.MessageType messageType, java.lang.String message, int line, int column)This constructor creates the Message object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumn()Get column of the source code that the message belongs to.java.lang.StringgetFormattedMessage()Return formatted string that represents this Message object.intgetLine()Get line of the source code that the message belongs to.java.lang.StringgetMessage()Get the text of the message.CompilerMessage.MessageTypegetMessageType()Get the type of the message.java.lang.StringtoString()
-
-
-
Field Detail
-
MSG_INFO
public static final java.lang.String MSG_INFO
- See Also:
- Constant Field Values
-
MSG_ERROR
public static final java.lang.String MSG_ERROR
- See Also:
- Constant Field Values
-
MSG_WARNING
public static final java.lang.String MSG_WARNING
- See Also:
- Constant Field Values
-
POSITION_FORMAT
public static final java.lang.String POSITION_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CompilerMessage
public CompilerMessage(CompilerMessage.MessageType messageType, java.lang.String message, int line, int column)
This constructor creates the Message object. Messages are created by compiler.- Parameters:
messageType- Type of the message.message- Text of the messageline- Line in the source codecolumn- Column in the source code
-
CompilerMessage
public CompilerMessage(java.lang.String message)
This constructor creates the Message object. Messages are created by compiler.- Parameters:
message- Text of the message
-
CompilerMessage
public CompilerMessage(CompilerMessage.MessageType type, java.lang.String message)
This constructor creates the Message object. Messages are created by compiler.- Parameters:
type- Type of the message.message- Text of the message
-
-
Method Detail
-
getFormattedMessage
public java.lang.String getFormattedMessage()
Return formatted string that represents this Message object.- Returns:
- formatted message
-
getLine
public int getLine()
Get line of the source code that the message belongs to.- Returns:
- the line, starting from 0. Negative values indicate that this value is not valid.
-
getColumn
public int getColumn()
Get column of the source code that the message belongs to.- Returns:
- the column, starting from 0. Negative values indicate that this value is not valid.
-
getMessage
public java.lang.String getMessage()
Get the text of the message.- Returns:
- text of the message
-
getMessageType
public CompilerMessage.MessageType getMessageType()
Get the type of the message.- Returns:
- the message type
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-