Skip to content

Commit 489669d

Browse files
committed
refactoring
1 parent 6310f10 commit 489669d

18 files changed

Lines changed: 40 additions & 72 deletions

compiler/src/main/java/net/jbock/context/BuildMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import net.jbock.util.ExConvert;
1414
import net.jbock.util.ExMissingItem;
1515
import net.jbock.util.ExNotSuccess;
16-
import net.jbock.util.ItemType;
16+
import net.jbock.model.ItemType;
1717

1818
import javax.inject.Inject;
1919
import java.util.ArrayList;

core/src/main/java/net/jbock/model/CommandModel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.jbock.model;
22

33
import net.jbock.Command;
4-
import net.jbock.util.ItemType;
54

65
import java.util.ArrayList;
76
import java.util.List;

core/src/main/java/net/jbock/model/Item.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package net.jbock.model;
22

3-
import net.jbock.util.ItemType;
4-
53
import java.util.List;
64

75
/**

core/src/main/java/net/jbock/util/ItemType.java renamed to core/src/main/java/net/jbock/model/ItemType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.jbock.util;
1+
package net.jbock.model;
22

33
import net.jbock.Option;
44
import net.jbock.Parameter;

core/src/main/java/net/jbock/model/Option.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package net.jbock.model;
22

3-
import net.jbock.util.ItemType;
4-
53
import java.util.ArrayList;
64
import java.util.List;
75
import java.util.Locale;

core/src/main/java/net/jbock/model/Parameter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.jbock.model;
22

33
import net.jbock.Parameters;
4-
import net.jbock.util.ItemType;
54

65
import java.util.ArrayList;
76
import java.util.List;

core/src/main/java/net/jbock/util/AtFileSyntaxError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.nio.file.Path;
66

77
/**
8-
* Represents a syntax error in the {@code @file}.
8+
* Represents a syntax error in the {@code @-file}.
99
* This is an intermediate step in the construction of an
1010
* {@link ErrAtFile} instance.
1111
*/

core/src/main/java/net/jbock/util/ConverterFailure.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
/**
44
* Non-exceptional failure object that represents any converter failure.
5-
* There are a fixed number of implementations:
65
*
7-
* <ul>
8-
* <li>{@link ConverterThrewException}
9-
* <li>{@link ConverterReturnedNull}
10-
* </ul>
6+
* <p>This class is internal API and should not be used
7+
* in client code.
118
*/
129
public abstract class ConverterFailure {
1310

@@ -19,5 +16,5 @@ public abstract class ConverterFailure {
1916
*
2017
* @return error message
2118
*/
22-
public abstract String converterMessage();
19+
abstract String converterMessage();
2320
}

core/src/main/java/net/jbock/util/ConverterReturnedNull.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
/**
44
* Indicates that a converter returned {@code null}.
55
*/
6-
public final class ConverterReturnedNull extends ConverterFailure {
6+
final class ConverterReturnedNull extends ConverterFailure {
77

88
ConverterReturnedNull() {
99
}
1010

1111
@Override
12-
public String converterMessage() {
12+
String converterMessage() {
1313
return "converter returned null";
1414
}
1515
}

core/src/main/java/net/jbock/util/ConverterThrewException.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Indicates that an exception was thrown from a converter.
55
*/
6-
public final class ConverterThrewException extends ConverterFailure {
6+
final class ConverterThrewException extends ConverterFailure {
77

88
private final Exception exception;
99

@@ -12,16 +12,7 @@ public final class ConverterThrewException extends ConverterFailure {
1212
}
1313

1414
@Override
15-
public String converterMessage() {
15+
String converterMessage() {
1616
return exception.getMessage();
1717
}
18-
19-
/**
20-
* Returns the exception that was caught in {@link StringConverter#apply(String)}
21-
*
22-
* @return the exception
23-
*/
24-
public Exception exception() {
25-
return exception;
26-
}
2718
}

0 commit comments

Comments
 (0)