-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace PrinterOption with ProblemPrinterBuilder.
- Loading branch information
Showing
6 changed files
with
234 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
justify/src/main/java/org/leadpony/justify/api/PrinterOption.java
This file was deleted.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
justify/src/main/java/org/leadpony/justify/api/ProblemPrinterBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright 2018-2019 the Justify authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.leadpony.justify.api; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* A builder interface for building a problem printer instance. | ||
* | ||
* @author leadpony | ||
*/ | ||
public interface ProblemPrinterBuilder { | ||
|
||
/** | ||
* Builds a new instance of problem printer which was configured through this | ||
* interface. | ||
* | ||
* @return newly created instance of problem printer, never be {@code null}. | ||
*/ | ||
ProblemHandler build(); | ||
|
||
/** | ||
* Specifies the target locale for which the messages to present will be | ||
* localized. | ||
* | ||
* <p> | ||
* The default locale obtained via {@link Locale#getDefault()} is used by | ||
* default. | ||
* </p> | ||
* | ||
* @param locale the target locale for which the messages will be localized. | ||
* @return this builder. | ||
* @throws NullPointerException if the specified {@code locale} is {@code null}. | ||
*/ | ||
ProblemPrinterBuilder withLocale(Locale locale); | ||
|
||
/** | ||
* Specifies whether problem locations should be presented in the form of line | ||
* and column numbers or not. | ||
* | ||
* <p> | ||
* The value of this option is set to {@code true} by default. | ||
* </p> | ||
* | ||
* @param present {@code true} if the locations should be presented, | ||
* {@code false} if the locations should be omitted. | ||
* @return this builder. | ||
*/ | ||
ProblemPrinterBuilder withLocation(boolean present); | ||
|
||
/** | ||
* Specifies whether problem locations should be presented in the form of a | ||
* JSON pointer or not. | ||
* | ||
* <p> | ||
* The value of this option is set to {@code true} by default. | ||
* </p> | ||
* | ||
* @param present {@code true} if the pointers should be presented, | ||
* {@code false} if the pointers should be omitted. | ||
* @return this builder. | ||
*/ | ||
ProblemPrinterBuilder withPointer(boolean present); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.