Top Description Methods
io.github.kusoroadeolu.veneer

public Interface SyntaxHighlighter

Known Direct Implementers
io.github.kusoroadeolu.veneer.AbstractSyntaxHighlighter
Imports
java.io.IOException, .PrintStream, java.nio.file.Files, .Path, java.util.Objects

A syntax highlighter that styles Java source code with ANSI color codes.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the styled string with ANSI color codes
highlight
(String
the source code to highlight
s
)

Highlights the given Java source string.

public default String

Returns:

the styled string with ANSI color codes
highlight
(Path
the path to the source file
path
)

Highlights the Java source file at the given path.

Method Detail

highlightback to summary
public String highlight(String s)

Highlights the given Java source string.

Parameters
s:String

the source code to highlight

Returns:String

the styled string with ANSI color codes

highlightback to summary
public default String highlight(Path path) throws IOException

Highlights the Java source file at the given path.

Parameters
path:Path

the path to the source file

Returns:String

the styled string with ANSI color codes

Exceptions
IOException:
if the file cannot be read