Package org.codehaus.plexus.compiler
Class CompilerMessage
- java.lang.Object
-
- org.codehaus.plexus.compiler.CompilerMessage
-
- Direct Known Subclasses:
CompilerError
public class CompilerMessage extends java.lang.ObjectThis class encapsulates a message produced by a programming language processor (whether interpreted or compiled).- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCompilerMessage.KindAs we are still 1.5 required we use a wrapper to Diagnostic.Kind and some compilers don't know jdk constants.
-
Field Summary
Fields Modifier and Type Field Description private intendcolumnThe end column number of the offending program textprivate intendlineThe end line number of the offending program textprivate java.lang.StringfileThe name of the file containing the offending program textprivate static java.lang.StringJDK_6_NOTE_PREFIXprivate static java.lang.StringJDK_6_WARNING_PREFIXprivate CompilerMessage.KindkindThe kind of message.private java.lang.StringmessageThe actual message text produced by the language processorprivate intstartcolumnThe start column number of the offending program textprivate intstartlineThe start line number of the offending program text
-
Constructor Summary
Constructors Constructor Description CompilerMessage(java.lang.String message)Deprecated.UseCompilerMessage(String, Kind)insteadCompilerMessage(java.lang.String message, boolean error)Deprecated.UseCompilerMessage(String, Kind)insteadCompilerMessage(java.lang.String file, boolean error, int startline, int startcolumn, int endline, int endcolumn, java.lang.String message)Deprecated.CompilerMessage(java.lang.String message, CompilerMessage.Kind kind)Constructs a compiler message.CompilerMessage(java.lang.String file, CompilerMessage.Kind kind, int startline, int startcolumn, int endline, int endcolumn, java.lang.String message)Constructs a compiler message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringcleanupMessage(java.lang.String msg)intgetEndColumn()Returns the ending column number of the program text originating this compiler message.intgetEndLine()Return the ending line number of the program text originating this compiler message.java.lang.StringgetFile()Returns the filename associated with this compiler message.CompilerMessage.KindgetKind()Returns the kind of the compiler message.java.lang.StringgetMessage()Returns the message produced by the language processor.intgetStartColumn()Returns the starting column number of the program text originating this compiler message.intgetStartLine()Returns the starting line number of the program text originating this compiler message.booleanisError()Asserts whether this is an error message or not.java.lang.StringtoString()
-
-
-
Field Detail
-
JDK_6_NOTE_PREFIX
private static final java.lang.String JDK_6_NOTE_PREFIX
- See Also:
- Constant Field Values
-
JDK_6_WARNING_PREFIX
private static final java.lang.String JDK_6_WARNING_PREFIX
- See Also:
- Constant Field Values
-
kind
private final CompilerMessage.Kind kind
The kind of message.
-
startline
private int startline
The start line number of the offending program text
-
startcolumn
private int startcolumn
The start column number of the offending program text
-
endline
private int endline
The end line number of the offending program text
-
endcolumn
private int endcolumn
The end column number of the offending program text
-
file
private java.lang.String file
The name of the file containing the offending program text
-
message
private final java.lang.String message
The actual message text produced by the language processor
-
-
Constructor Detail
-
CompilerMessage
@Deprecated public CompilerMessage(java.lang.String file, boolean error, int startline, int startcolumn, int endline, int endcolumn, java.lang.String message)Deprecated.Constructs a compiler message.- Parameters:
file- The name of the file containing the offending program texterror-trueif this is a error message, orfalseif it is a warning messagestartline- The start line number of the offending program textstartcolumn- The start column number of the offending program textendline- The end line number of the offending program textendcolumn- The end column number of the offending program textmessage- The actual message text produced by the language processor
-
CompilerMessage
public CompilerMessage(java.lang.String file, CompilerMessage.Kind kind, int startline, int startcolumn, int endline, int endcolumn, java.lang.String message)Constructs a compiler message.- Parameters:
file- The name of the file containing the offending program textkind- The kind of messagestartline- The start line number of the offending program textstartcolumn- The start column number of the offending program textendline- The end line number of the offending program textendcolumn- The end column number of the offending program textmessage- The actual message text produced by the language processor
-
CompilerMessage
@Deprecated public CompilerMessage(java.lang.String message)
Deprecated.UseCompilerMessage(String, Kind)insteadThe warning message constructor.- Parameters:
message- The actual message text produced by the language processor
-
CompilerMessage
@Deprecated public CompilerMessage(java.lang.String message, boolean error)Deprecated.UseCompilerMessage(String, Kind)insteadConstructs a compiler message.- Parameters:
message- The actual message text produced by the language processorerror-trueif this is a error message, orfalseif it is a warning message
-
CompilerMessage
public CompilerMessage(java.lang.String message, CompilerMessage.Kind kind)Constructs a compiler message.- Parameters:
message- The actual message text produced by the language processorkind- The kind of message- Since:
- 2.0
-
-
Method Detail
-
getFile
public java.lang.String getFile()
Returns the filename associated with this compiler message.- Returns:
- The filename associated with this compiler message
-
isError
public boolean isError()
Asserts whether this is an error message or not.- Returns:
- Whether the message is an error message
-
getStartLine
public int getStartLine()
Returns the starting line number of the program text originating this compiler message.- Returns:
- The starting line number of the program text originating this message
-
getStartColumn
public int getStartColumn()
Returns the starting column number of the program text originating this compiler message.- Returns:
- The starting column number of the program text originating this message
-
getEndLine
public int getEndLine()
Return the ending line number of the program text originating this compiler message.- Returns:
- The ending line number of the program text originating this message
-
getEndColumn
public int getEndColumn()
Returns the ending column number of the program text originating this compiler message.- Returns:
- The ending column number of the program text originating this message
-
getMessage
public java.lang.String getMessage()
Returns the message produced by the language processor.- Returns:
- The message produced by the language processor
-
getKind
public CompilerMessage.Kind getKind()
Returns the kind of the compiler message.- Returns:
- the kind of the message
- Since:
- 2.0
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
cleanupMessage
private java.lang.String cleanupMessage(java.lang.String msg)
-
-