Package analyzer.exercises
Class GlobalAnalyzer
java.lang.Object
com.github.javaparser.ast.visitor.VoidVisitorAdapter<OutputCollector>
analyzer.exercises.GlobalAnalyzer
- All Implemented Interfaces:
Analyzer
,com.github.javaparser.ast.visitor.VoidVisitor<OutputCollector>
public class GlobalAnalyzer
extends com.github.javaparser.ast.visitor.VoidVisitorAdapter<OutputCollector>
implements Analyzer
The
GlobalAnalyzer
contains checks that are exercise-agnostic,
such as whether a solution is using print statements or a static main
method.
It extends from the VoidVisitorAdapter
and uses the visitor pattern to traverse each compilation unit.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
analyze
(Solution solution, OutputCollector output) Analyze the given solution and append analysis results to the given output..void
visit
(com.github.javaparser.ast.body.MethodDeclaration node, OutputCollector outputCollector) void
visit
(com.github.javaparser.ast.expr.MethodCallExpr node, OutputCollector outputCollector) Methods inherited from class com.github.javaparser.ast.visitor.VoidVisitorAdapter
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Constructor Details
-
GlobalAnalyzer
public GlobalAnalyzer()
-
-
Method Details
-
analyze
Description copied from interface:Analyzer
Analyze the given solution and append analysis results to the given output.. Theanalyze
method of each analyzer is invoked once for the whole submitted solution. -
visit
public void visit(com.github.javaparser.ast.body.MethodDeclaration node, OutputCollector outputCollector) - Specified by:
visit
in interfacecom.github.javaparser.ast.visitor.VoidVisitor<OutputCollector>
- Overrides:
visit
in classcom.github.javaparser.ast.visitor.VoidVisitorAdapter<OutputCollector>
-
visit
public void visit(com.github.javaparser.ast.expr.MethodCallExpr node, OutputCollector outputCollector) - Specified by:
visit
in interfacecom.github.javaparser.ast.visitor.VoidVisitor<OutputCollector>
- Overrides:
visit
in classcom.github.javaparser.ast.visitor.VoidVisitorAdapter<OutputCollector>
-