Class DefaultMessages

  • All Implemented Interfaces:
    Messages

    @Named("default")
    @Singleton
    public class DefaultMessages
    extends java.lang.Object
    implements Messages
    Default implementation of the Messages interface.

    This implementation delegates to the BuildContext for compatibility with existing message handling infrastructure. It logs messages and calls the legacy BuildContext message API.

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultMessages​(BuildContext buildContext)
      Creates a new DefaultMessages instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MessageBuilder build​(MessageType type, java.nio.file.Path path)
      Creates a builder for a message of a specific type.
      void clear​(java.nio.file.Path path)
      Clears messages associated with a specific path.
      void clearAll()
      Clears all messages.
      MessageBuilder error​(java.nio.file.Path path)
      Creates a builder for an error message.
      MessageBuilder info​(java.nio.file.Path path)
      Creates a builder for an informational message.
      MessageBuilder warning​(java.nio.file.Path path)
      Creates a builder for a warning message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultMessages

        @Inject
        public DefaultMessages​(BuildContext buildContext)
        Creates a new DefaultMessages instance.
        Parameters:
        buildContext - the BuildContext to which messages will be delegated
    • Method Detail

      • clearAll

        public void clearAll()
        Description copied from interface: Messages
        Clears all messages. This removes all messages that were previously created through this API.
        Specified by:
        clearAll in interface Messages
      • clear

        public void clear​(java.nio.file.Path path)
        Description copied from interface: Messages
        Clears messages associated with a specific path.
        Specified by:
        clear in interface Messages
        Parameters:
        path - the file path for which to clear messages
      • error

        public MessageBuilder error​(java.nio.file.Path path)
        Description copied from interface: Messages
        Creates a builder for an error message.
        Specified by:
        error in interface Messages
        Parameters:
        path - the file path for which the error message should be created
        Returns:
        a MessageBuilder for constructing the error message
      • warning

        public MessageBuilder warning​(java.nio.file.Path path)
        Description copied from interface: Messages
        Creates a builder for a warning message.
        Specified by:
        warning in interface Messages
        Parameters:
        path - the file path for which the warning message should be created
        Returns:
        a MessageBuilder for constructing the warning message
      • info

        public MessageBuilder info​(java.nio.file.Path path)
        Description copied from interface: Messages
        Creates a builder for an informational message.
        Specified by:
        info in interface Messages
        Parameters:
        path - the file path for which the info message should be created
        Returns:
        a MessageBuilder for constructing the info message
      • build

        public MessageBuilder build​(MessageType type,
                                    java.nio.file.Path path)
        Description copied from interface: Messages
        Creates a builder for a message of a specific type. This is the generic method that the other build methods delegate to.
        Specified by:
        build in interface Messages
        Parameters:
        type - the type of message to build
        path - the file path for which the message should be created
        Returns:
        a MessageBuilder for constructing the message