You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Messages interface should have a method "clearAll" that clears all messages and a clear method that takes a path
Beside that we want to have a builder pattern to construct a message in a more convenient, flexible and extensible ways: buildError, buildWarning, buildInfo that all delegate to a generic build that takes an enum for the type of message to build. Beside that each method must accept a Path for wich a message should be build
There should be a DefaultMessages component that gets the BuildContext it injected in the contructor to proof the API is implementable
The builder should be implemented in a class MessageBuilder that takes the type enum, the path and a Consumer of a constructed "Message" class that holds all collected parameter in one object, that way implementers of the API do not need to reimplement the builder, but the javadoc should state that this is usually nothing client code will call
For all other current parameters the builder needs to have a appropriate method (e.g. line(int), column(int), message(String), cause(Exception)) that return the builder for chaining
the MessageBuilder#create() method will the create a message object and inform the consumer, where the DefaultMessages implementation should log the message and call the old message API in the BuildContext, clearAll will be a noop here
Currently we have the
BuildContextthat it mixing two concerns:For the Messages/Markers we even have some outstanding issues:
due to backward-compatibility we can hardly change them or make any useful evolution.
Because of this we want a new API that is implemented in the following way:
org.codehaus.plexus.build.messageswhere we have aMessagesinterfaceMessagesinterface should have a method "clearAll" that clears all messages and a clear method that takes a pathDefaultMessagescomponent that gets theBuildContextit injected in the contructor to proof the API is implementableMessageBuilderthat takes the type enum, the path and a Consumer of a constructed "Message" class that holds all collected parameter in one object, that way implementers of the API do not need to reimplement the builder, but the javadoc should state that this is usually nothing client code will call