Skip to content

Commit

Permalink
Subtypes of AggregateChecker should override getSupportedChecker (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoo980 authored Dec 2, 2024
1 parent f167fde commit b5479ee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/manual/creating-a-checker.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1073,14 +1073,17 @@

\noindent
if you define an aggregate checker class. Extend \refclass{framework/source}{AggregateChecker} and override
the \<getImmediateSubcheckerClasses> method, like the following:
the \<getSupportedCheckers> method, like the following:

\begin{Verbatim}
public class MyUnitCheckers extends AggregateChecker {
protected Set<Class<? extends SourceChecker>> getImmediateSubcheckerClasses() {
return new LinkedHashSet<>(Arrays.asList(DistanceUnitChecker.class,
VelocityUnitChecker.class,
MassUnitChecker.class));
@Override
protected Collection<Class<? extends SourceChecker>> getSupportedCheckers() {
Collection<Class<? extends SourceChecker>> checkers = new ArrayList<>(3);
Collections.addAll(
checkers,
DistanceUnitChecker.class, VelocityUnitChecker.class, MassUnitChecker.class);
return checkers;
}
}
\end{Verbatim}
Expand Down

0 comments on commit b5479ee

Please sign in to comment.