Interface Messages
- All Known Implementing Classes:
DefaultMessages
public interface Messages
Messages interface.
This API provides a modern, flexible way to create and manage build messages/markers that inform users in an IDE about issues in their files. It uses a builder pattern for constructing messages in a more convenient and extensible way compared to the legacy BuildContext message methods.
Example usage:
messages.error(Paths.get("/path/to/file.java"))
.line(42)
.column(10)
.create("Syntax error");
-
Method Summary
Modifier and TypeMethodDescriptionbuild(MessageType type, Path path) Creates a builder for a message of a specific type.voidClears messages associated with a specific path.voidclearAll()Clears all messages.Creates a builder for an error message.Creates a builder for an informational message.Creates a builder for a warning message.
-
Method Details
-
clearAll
void clearAll()Clears all messages. This removes all messages that were previously created through this API. -
clear
Clears messages associated with a specific path.- Parameters:
path- the file path for which to clear messages
-
error
Creates a builder for an error message.- Parameters:
path- the file path for which the error message should be created- Returns:
- a MessageBuilder for constructing the error message
-
warning
Creates a builder for a warning message.- Parameters:
path- the file path for which the warning message should be created- Returns:
- a MessageBuilder for constructing the warning message
-
info
Creates a builder for an informational message.- Parameters:
path- the file path for which the info message should be created- Returns:
- a MessageBuilder for constructing the info message
-
build
Creates a builder for a message of a specific type. This is the generic method that the other build methods delegate to.- Parameters:
type- the type of message to buildpath- the file path for which the message should be created- Returns:
- a MessageBuilder for constructing the message
-