Skip to content

Package io.github.qishr.cascara.common.diagnostic

Class AbstractReporter

java.lang.Object
        io.github.qishr.cascara.common.diagnostic.AbstractReporter

All Implemented Interfaces:
    Reporter

Direct Known Subtypes:
    GlobalReporter, StandardReporter


public abstract class AbstractReporter

Field Summary

Modifier and Type Field Description
protected Consumer diagnosticCollector Consumes diagnostics included in the current Level or more important, with ERROR being the most important.
protected boolean disableFlush
protected boolean disableSystemOutput
protected Level level
protected Consumer problemCollector
protected String source
protected Consumer stringWriter

Constructor Summary

Constructor Description
AbstractReporter(Consumer<String> writer)
AbstractReporter()

Method Summary

Modifier and Type Method Description
protected abstract T self()
public boolean collectsProblems()
public T setLevel(Level level)
public T setDiagnosticCollector(Consumer<Diagnostic> collector)
public T setProblemCollector(Consumer<Diagnostic> collector)
public T setDisableSystemOutput(boolean b)
public T setDisableFlush(boolean b)
public void trace(String format, Object[] args)
public void debug(String format, Object[] args)
public void info(String format, Object[] args)
public void warn(String code, String format, Object[] args)
public void error(String code, String format, Object[] args)
public void infoAt(int line, int column, String format, Object[] args)
public void warnAt(int line, int column, String code, String format, Object[] args)
public void errorAt(int line, int column, String code, String format, Object[] args)
public void infoAt(int line, int column, int start, int end, String format, Object[] args)
public void warnAt(int line, int column, int start, int end, String code, String format, Object[] args)
public void errorAt(int line, int column, int start, int end, String code, String format, Object[] args)
public void infoAt(Token token, String format, Object[] args)
public void warnAt(Token token, String code, String format, Object[] args)
public void errorAt(Token token, String code, String format, Object[] args)
protected abstract void writeString(Diagnostic diagnostic)
protected Consumer<Diagnostic> getDiagnosticCollector()
protected Consumer<Diagnostic> getProblemCollector()
protected Consumer<String> getStringWriter()
protected boolean disableSystemOutput()
protected boolean disableFlush()
protected void report(Diagnostic diagnostic)
protected void writeString(Level level, String message)
protected void outputToConsole(Level level, String message)

Field Details

diagnosticCollector

protected Consumer diagnosticCollector

Consumes diagnostics included in the current Level or more important, with ERROR being the most important.


disableFlush

protected boolean disableFlush


disableSystemOutput

protected boolean disableSystemOutput


level

protected Level level


problemCollector

protected Consumer problemCollector


source

protected String source


stringWriter

protected Consumer stringWriter


Method Details

self

protected abstract T self()


collectsProblems

public boolean collectsProblems()

Specified By:

Reporter


setLevel

public T setLevel(Level level)

Specified By:

Reporter


setDiagnosticCollector

public T setDiagnosticCollector(Consumer<Diagnostic> collector)

Specified By:

Reporter


setProblemCollector

public T setProblemCollector(Consumer<Diagnostic> collector)

Specified By:

Reporter


setDisableSystemOutput

public T setDisableSystemOutput(boolean b)


setDisableFlush

public T setDisableFlush(boolean b)


trace

public void trace(String format, Object[] args)

Specified By:

Reporter


debug

public void debug(String format, Object[] args)

Specified By:

Reporter


info

public void info(String format, Object[] args)

Specified By:

Reporter


warn

public void warn(String code, String format, Object[] args)

Specified By:

Reporter


error

public void error(String code, String format, Object[] args)

Specified By:

Reporter


infoAt

public void infoAt(int line, int column, String format, Object[] args)

Specified By:

Reporter


warnAt

public void warnAt(int line, int column, String code, String format, Object[] args)

Specified By:

Reporter


errorAt

public void errorAt(int line, int column, String code, String format, Object[] args)

Specified By:

Reporter


infoAt

public void infoAt(int line, int column, int start, int end, String format, Object[] args)

Specified By:

Reporter


warnAt

public void warnAt(int line, int column, int start, int end, String code, String format, Object[] args)

Specified By:

Reporter


errorAt

public void errorAt(int line, int column, int start, int end, String code, String format, Object[] args)

Specified By:

Reporter


infoAt

public void infoAt(Token token, String format, Object[] args)

Specified By:

Reporter


warnAt

public void warnAt(Token token, String code, String format, Object[] args)

Specified By:

Reporter


errorAt

public void errorAt(Token token, String code, String format, Object[] args)

Specified By:

Reporter


writeString

protected abstract void writeString(Diagnostic diagnostic)


getDiagnosticCollector

protected Consumer<Diagnostic> getDiagnosticCollector()


getProblemCollector

protected Consumer<Diagnostic> getProblemCollector()


getStringWriter

protected Consumer<String> getStringWriter()


disableSystemOutput

protected boolean disableSystemOutput()


disableFlush

protected boolean disableFlush()


report

protected void report(Diagnostic diagnostic)


writeString

protected void writeString(Level level, String message)


outputToConsole

protected void outputToConsole(Level level, String message)