Class TraceDiagnostic<S extends JavaFileObject>
java.lang.Object
io.github.ascopes.jct.diagnostics.TraceDiagnostic<S>
- Type Parameters:
S
- the file type.
- All Implemented Interfaces:
Diagnostic<S>
A wrapper around a
Diagnostic
which contains additional information about where the
diagnostic was reported.- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Nested Class Summary
Nested classes/interfaces inherited from interface javax.tools.Diagnostic
Diagnostic.Kind
-
Field Summary
Fields inherited from interface javax.tools.Diagnostic
NOPOS
-
Constructor Summary
ConstructorDescriptionTraceDiagnostic
(Instant timestamp, long threadId, @Nullable String threadName, List<StackTraceElement> stackTrace, Diagnostic<? extends S> original) Initialize this diagnostic. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
long
long
getKind()
long
getMessage
(@Nullable Locale locale) long
Get the stacktrace of where the diagnostic was written from.long
long
Get the thread ID for the thread that created this diagnostic.Get the thread name for the thread that created this diagnostic.Get the timestamp that the diagnostic was created at.toString()
-
Constructor Details
-
TraceDiagnostic
public TraceDiagnostic(Instant timestamp, long threadId, @Nullable String threadName, List<StackTraceElement> stackTrace, Diagnostic<? extends S> original) Initialize this diagnostic.- Parameters:
timestamp
- the timestamp.threadId
- the thread ID.threadName
- the thread name, ornull
if not known.stackTrace
- the stacktrace.original
- the original diagnostic that was reported.
-
-
Method Details
-
getKind
- Specified by:
getKind
in interfaceDiagnostic<S extends JavaFileObject>
-
getSource
- Specified by:
getSource
in interfaceDiagnostic<S extends JavaFileObject>
-
getPosition
- Specified by:
getPosition
in interfaceDiagnostic<S extends JavaFileObject>
-
getStartPosition
- Specified by:
getStartPosition
in interfaceDiagnostic<S extends JavaFileObject>
-
getEndPosition
- Specified by:
getEndPosition
in interfaceDiagnostic<S extends JavaFileObject>
-
getLineNumber
- Specified by:
getLineNumber
in interfaceDiagnostic<S extends JavaFileObject>
-
getColumnNumber
- Specified by:
getColumnNumber
in interfaceDiagnostic<S extends JavaFileObject>
-
getCode
- Specified by:
getCode
in interfaceDiagnostic<S extends JavaFileObject>
-
getMessage
- Specified by:
getMessage
in interfaceDiagnostic<S extends JavaFileObject>
-
getTimestamp
Get the timestamp that the diagnostic was created at.- Returns:
- the diagnostic timestamp.
-
getThreadId
Get the thread ID for the thread that created this diagnostic.- Returns:
- the thread ID.
-
getThreadName
Get the thread name for the thread that created this diagnostic.- Returns:
- the thread name, if known, or else
null
.
-
getStackTrace
Get the stacktrace of where the diagnostic was written from.- Returns:
- the stacktrace, in an unmodifiable list.
-
toString
-