Skip to content

Commit b7e67a9

Browse files
committed
javadoc improvements
1 parent 49f636d commit b7e67a9

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

core/src/main/java/org/everit/json/schema/FormatValidator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public interface FormatValidator {
4949
* <li>ipv4</li>
5050
* <li>ipv6</li>
5151
* </ul>
52+
*
53+
* @param formatName
54+
* one of the 6 built-in formats.
55+
* @return a {@code FormatValidator} implementation handling the {@code formatName} format.
5256
*/
5357
static FormatValidator forFormat(final String formatName) {
5458
Objects.requireNonNull(formatName, "formatName cannot be null");

core/src/main/java/org/everit/json/schema/StringSchema.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public StringSchema build() {
5151
* Setter for the format validator. It should be used in conjunction with
5252
* {@link FormatValidator#forFormat(String)} if a {@code "format"} value is found in a schema
5353
* json.
54+
*
55+
* @param formatValidator
56+
* the format validator
57+
* @return {@code this}
5458
*/
5559
public Builder formatValidator(final FormatValidator formatValidator) {
5660
this.formatValidator = Objects.requireNonNull(formatValidator,

core/src/main/java/org/everit/json/schema/internal/IPAddressValidator.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@
2626
public class IPAddressValidator {
2727

2828
/**
29-
* Creates an InetAddress instance if possible and returns it, or on failure it returns
30-
* Optional.empty().
29+
* Creates an {@link InetAddress} instance if possible and returns it, or on failure it returns
30+
* {@code Optional.empty()}.
31+
*
32+
* @param subject
33+
* the string to be validated.
34+
* @return the optional validation failure message
3135
*/
3236
protected Optional<InetAddress> asInetAddress(final String subject) {
3337
try {
@@ -43,6 +47,17 @@ protected Optional<InetAddress> asInetAddress(final String subject) {
4347

4448
/**
4549
* Checks an IP address.
50+
*
51+
* @param subject
52+
* the string to be validated.
53+
* @param expectedLength
54+
* the expected length of {@code subject} - it is validated if
55+
* {@link #asInetAddress(String)} validation succeeds.
56+
* @param failureFormat
57+
* the {@link String#format(String, Object...) string format} of the validation failue
58+
* message. The format string will receive only the {@code subject} parameter (so it has
59+
* to be referred as {@code %s} in the format string
60+
* @return the optional validation failure message
4661
*/
4762
protected Optional<String> checkIpAddress(final String subject, final int expectedLength,
4863
final String failureFormat) {

core/src/main/java/org/everit/json/schema/loader/SchemaLoader.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ public static Schema load(final JSONObject schemaJson, final SchemaClient httpCl
214214

215215
/**
216216
* Constructor.
217+
*
218+
* @param builder
219+
* the builder containing the properties. Only {@link SchemaLoaderBuilder#id} is
220+
* nullable.
221+
* @throws NullPointerException
222+
* if any of the builder properties except {@link SchemaLoaderBuilder#id id} is
223+
* {@code null}.
217224
*/
218225
public SchemaLoader(final SchemaLoaderBuilder builder) {
219226
this.schemaJson = Objects.requireNonNull(builder.schemaJson, "schemaJson cannot be null");

0 commit comments

Comments
 (0)