Class ModelConsistencyChecker

java.lang.Object
spoon.reflect.visitor.CtScanner
spoon.reflect.visitor.ModelConsistencyChecker
All Implemented Interfaces:
CtVisitor

public class ModelConsistencyChecker extends CtScanner
This scanner checks that a program model is consistent with regards to the parent elements (children must have the right parent). This class can be used to validate that a program transformation does not harm the model integrity, and also to automatically fix it when possible.
  • Constructor Details

    • ModelConsistencyChecker

      public ModelConsistencyChecker(Environment environment, boolean fixInconsistencies, boolean fixNullParents)
      Creates a new model consistency checker.
      Parameters:
      environment - the environment where to report errors
      fixInconsistencies - automatically fix the inconsistencies rather than reporting warnings (to report warnings, set this to false)
      fixNullParents - automatically fix the null parents rather than reporting warnings (to report warnings, set this to false)
  • Method Details