Class GshTemplateCompileDiagnostic
java.lang.Object
edu.internet2.middleware.grouper.app.gsh.template.GshTemplateCompileDiagnostic
One diagnostic produced by the Java compiler when compiling a GSH template
source — an error, warning, or note. Carries the line and column where the
problem was detected, plus a human-readable message. The line and column
come straight from javac (1-based), with -1 used when the compiler could
not pin the diagnostic to a specific position.
See GshTemplateJavaCompiler for the producing API.
GRP-7006
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong1-based column number; -1 if not associated with a columnlong1-based line number; -1 if not associated with a linehuman-readable diagnostic messageseverity of the diagnosticname of the source object the diagnostic refers to, or nullsource-context snippet (offending line + caret), or nullbooleanisError()true if this diagnostic represents an error (not a warning, note, etc.)voidsetColumnNumber(long columnNumber) 1-based column number; -1 if not associated with a columnvoidsetLineNumber(long lineNumber) 1-based line number; -1 if not associated with a linevoidsetMessage(String message) human-readable diagnostic messagevoidsetSeverity(String severity) severity of the diagnosticvoidsetSourceClassName(String sourceClassName) name of the source object the diagnostic refers to, or nullvoidsetSourceContext(String sourceContext) source-context snippet (offending line + caret), or nulltoString()
-
Constructor Details
-
GshTemplateCompileDiagnostic
public GshTemplateCompileDiagnostic()
-
-
Method Details
-
getSeverity
severity of the diagnostic- Returns:
- severity (ERROR, WARNING, MANDATORY_WARNING, NOTE, or OTHER)
-
setSeverity
severity of the diagnostic- Parameters:
severity-
-
getLineNumber
public long getLineNumber()1-based line number; -1 if not associated with a line- Returns:
- line number
-
setLineNumber
public void setLineNumber(long lineNumber) 1-based line number; -1 if not associated with a line- Parameters:
lineNumber-
-
getColumnNumber
public long getColumnNumber()1-based column number; -1 if not associated with a column- Returns:
- column number
-
setColumnNumber
public void setColumnNumber(long columnNumber) 1-based column number; -1 if not associated with a column- Parameters:
columnNumber-
-
getMessage
human-readable diagnostic message- Returns:
- message
-
setMessage
human-readable diagnostic message- Parameters:
message-
-
getSourceClassName
name of the source object the diagnostic refers to, or null- Returns:
- source class name
-
setSourceClassName
name of the source object the diagnostic refers to, or null- Parameters:
sourceClassName-
-
getSourceContext
source-context snippet (offending line + caret), or null- Returns:
- source context
-
setSourceContext
source-context snippet (offending line + caret), or null- Parameters:
sourceContext-
-
isError
public boolean isError()true if this diagnostic represents an error (not a warning, note, etc.)- Returns:
- is error
-
toString
-