Interface ProblemPrinterBuilder


  • public interface ProblemPrinterBuilder
    A builder interface for building a problem printer instance.
    Author:
    leadpony
    • Method Detail

      • build

        ProblemHandler build()
        Builds a new instance of problem printer which was configured through this interface.
        Returns:
        newly created instance of problem printer as a ProblemHandler, never be null.
      • withLocale

        ProblemPrinterBuilder withLocale​(Locale locale)
        Specifies the target locale for which the messages to present will be localized.

        The default locale obtained via Locale.getDefault() is used by default.

        Parameters:
        locale - the target locale for which the messages will be localized.
        Returns:
        this builder.
        Throws:
        NullPointerException - if the specified locale is null.
      • withLocation

        ProblemPrinterBuilder withLocation​(boolean present)
        Specifies whether problem locations should be presented in the form of line and column numbers or not.

        The value of this option is set to true by default.

        Parameters:
        present - true if the locations should be presented, false if the locations should be omitted.
        Returns:
        this builder.
      • withPointer

        ProblemPrinterBuilder withPointer​(boolean present)
        Specifies whether problem locations should be presented in the form of a JSON pointer or not.

        The value of this option is set to true by default.

        Parameters:
        present - true if the pointers should be presented, false if the pointers should be omitted.
        Returns:
        this builder.