This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch maven-3.10.x
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/maven-3.10.x by this push:
new 11daad487c Document MessageBuilder.style and resetStyle as Maven 4 does
11daad487c is described below
commit 11daad487c32831ff80be1852e6fb065bdb81711
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Nov 21 17:25:41 2026 +0100
Document MessageBuilder.style and resetStyle as Maven 4 does
---
.../apache/maven/api/services/MessageBuilder.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git
a/maven-core/src/main/java/org/apache/maven/api/services/MessageBuilder.java
b/maven-core/src/main/java/org/apache/maven/api/services/MessageBuilder.java
index 5a65260022..b11a04c760 100644
--- a/maven-core/src/main/java/org/apache/maven/api/services/MessageBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/api/services/MessageBuilder.java
@@ -149,27 +149,48 @@ default MessageBuilder project(Object message) {
return style("." + Constants.MAVEN_STYLE_PROJECT_NAME + ":-" +
Constants.MAVEN_STYLE_PROJECT_DEFAULT, message);
}
+ /**
+ * Append message content with the given style applied, then reset the
style.
+ *
+ * @param style the style definition to apply
+ * @param message the message to append
+ * @return the current builder
+ */
@Nonnull
default MessageBuilder style(String style, Object message) {
return style(style).a(message).resetStyle();
}
+ /**
+ * Apply the given style to subsequent appended content.
+ *
+ * @param style the style definition to apply
+ * @return the current builder
+ */
MessageBuilder style(String style);
+ /**
+ * Reset the current style back to the default.
+ *
+ * @return the current builder
+ */
MessageBuilder resetStyle();
//
// message building methods modelled after Ansi methods
//
+ /** {@inheritDoc} */
@Nonnull
@Override
MessageBuilder append(CharSequence cs);
+ /** {@inheritDoc} */
@Nonnull
@Override
MessageBuilder append(CharSequence cs, int start, int end);
+ /** {@inheritDoc} */
@Nonnull
@Override
MessageBuilder append(char c);