Record Class DiagnosticSnapshot
- Record Components:
source- path of the compiled source file.diagnostics- all diagnostics reported during compilation, in report order.stats- named compilation statistics in insertion order; empty when the interpretation step did not run.models- one entry per model in the unit, in declaration order.actions- the ordered list of executed actions; empty when not recorded.
Produced once by
ca.mcscert.jpipe.compiler.steps.transformations.CollectDiagnostics
from a compiled Unit and its
CompilationContext, then consumed by every report renderer. Holding
the collection step in common is what keeps the human-readable and JSON
reports from drifting apart: a section added here surfaces in both, and
neither renderer walks the model itself.
This record carries data only — no formatting. Presentation choices (bracketing codes, padding columns, eliding unknown locations) belong to the renderers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne executed model-construction action.static final recordAn element id rewritten during composition.static final recordHow many elements of each type a model holds.static final recordA model that implements the template being described.static final recordA single model: its identity, its element census, and its symbols.static final recordOne entry of a model's symbol table. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDiagnosticSnapshot(String source, List<Diagnostic> diagnostics, Map<String, Long> stats, List<DiagnosticSnapshot.ModelInfo> models, List<DiagnosticSnapshot.ActionInfo> actions) Copies every collection on the way in. -
Method Summary
Modifier and TypeMethodDescriptionactions()Returns the value of theactionsrecord component.Returns the value of thediagnosticsrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanTrue if any ERROR or FATAL diagnostic was reported.final inthashCode()Returns a hash code value for this object.models()Returns the value of themodelsrecord component.source()Returns the value of thesourcerecord component.stats()Returns the value of thestatsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
KIND_JUSTIFICATION
Model kind discriminator: a concrete justification.- See Also:
-
KIND_TEMPLATE
-
-
Constructor Details
-
DiagnosticSnapshot
public DiagnosticSnapshot(String source, List<Diagnostic> diagnostics, Map<String, Long> stats, List<DiagnosticSnapshot.ModelInfo> models, List<DiagnosticSnapshot.ActionInfo> actions) Copies every collection on the way in.CompilationContext.diagnostics()andCompilationContext.stats()hand out unmodifiable views of live state, so a snapshot that merely held those references would keep changing as the context did — and two renderings of "the same" snapshot could then disagree. Copying here makes the immutability this record advertises structural rather than a convention its callers must respect.statsis copied into aLinkedHashMaprather than viaMap.copyOf, which does not preserve iteration order.
-
-
Method Details
-
hasErrors
public boolean hasErrors()True if any ERROR or FATAL diagnostic was reported. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
source
-
diagnostics
Returns the value of thediagnosticsrecord component.- Returns:
- the value of the
diagnosticsrecord component
-
stats
-
models
-
actions
-