Class MessageBuilder
java.lang.Object
org.codehaus.plexus.build.messages.MessageBuilder
Builder class for constructing messages.
This class implements the builder pattern for creating messages with various parameters. It is typically not called directly by client code, but is used internally by the Messages API implementations.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageBuilder(MessageType type, Path path, Consumer<Message> consumer) Creates a new MessageBuilder. -
Method Summary
-
Constructor Details
-
MessageBuilder
Creates a new MessageBuilder.Note: This constructor is usually not called by client code. Use the builder methods provided by the
Messagesinterface instead (e.g., buildError, buildWarning, buildInfo).- Parameters:
type- the type of message to buildpath- the file path for which the message should be createdconsumer- the consumer that will receive the constructed message
-
-
Method Details
-
line
Sets the line number for the message.- Parameters:
line- the line number (1-based, use 0 for unknown)- Returns:
- this builder for method chaining
-
column
Sets the column number for the message.- Parameters:
column- the column number (1-based, use 0 for unknown)- Returns:
- this builder for method chaining
-
cause
Sets the exception cause for the message.- Parameters:
cause- the exception that caused this message- Returns:
- this builder for method chaining
-
create
Creates the message object with all collected parameters and informs the consumer. This method finalizes the builder and creates the message.- Parameters:
message- the message text (must not be null or blank)
-