Skip to content

Commit d596057

Browse files
committed
Rework ClassMatcher-s (used for veto) to take on account indirect inheritance
1 parent 0135e76 commit d596057

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

net.tascalate.javaflow.spi/src/main/java/org/apache/commons/javaflow/spi/ClassMatchStrategyFileParser.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,41 +71,45 @@ ClassMatchStrategy parse(URL url) throws IOException {
7171
}
7272

7373
static interface StrategyFactory {
74-
ClassMatchStrategy create(String className);
74+
ClassMatchStrategy create(String option);
7575
}
7676

77-
static enum VariantFactory {
77+
static enum VariantFactory implements StrategyFactory {
7878
NAME_FULL() {
79-
ClassMatchStrategy create(String option) {
79+
@Override
80+
public ClassMatchStrategy create(String option) {
8081
return ClassMatchStrategies.byClassName(option, false);
8182
}
8283
},
8384
NAME_PART() {
84-
ClassMatchStrategy create(String option) {
85+
@Override
86+
public ClassMatchStrategy create(String option) {
8587
return ClassMatchStrategies.byClassName(option, true);
8688
}
8789
},
8890
NAME_PATTERN() {
89-
ClassMatchStrategy create(String option) {
91+
@Override
92+
public ClassMatchStrategy create(String option) {
9093
return ClassMatchStrategies.byClassNamePattern(option);
9194
}
9295
};
93-
94-
abstract ClassMatchStrategy create(String option);
9596
}
9697

9798
static enum KindFactory {
9899
CLASS() {
100+
@Override
99101
ClassMatchStrategy create(ClassMatchStrategy nested) {
100102
return nested;
101103
}
102104
},
103105
EXTENDS_CLASS() {
106+
@Override
104107
ClassMatchStrategy create(ClassMatchStrategy nested) {
105108
return ClassMatchStrategies.bySuperClass(nested);
106109
}
107110
},
108111
IMPLEMENTS_INTERFACE() {
112+
@Override
109113
ClassMatchStrategy create(ClassMatchStrategy nested) {
110114
return ClassMatchStrategies.byInterface(nested);
111115
}

0 commit comments

Comments
 (0)