Class CheckRequiresSorted

  • All Implemented Interfaces:
    NodeTraversal.Callback

    public final class CheckRequiresSorted
    extends java.lang.Object
    implements NodeTraversal.Callback
    Checks that Closure import statements (goog.require, goog.requireType, and goog.forwardDeclare) are sorted and deduplicated, exposing the necessary information to produce a suggested fix.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CheckRequiresSorted.Mode
      Operation modes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Node getFirstNode()
      Returns the node for the first recognized import statement.
      Node getLastNode()
      Returns the node for the last recognized import statement.
      java.lang.String getReplacement()
      Returns a textual replacement yielding a canonical version of the imports.
      boolean needsFix()
      Returns whether the imports need to be fixed, i.e., whether they are *not* already canonical.
      boolean shouldTraverse​(NodeTraversal t, Node n, Node parent)
      Visits a node in preorder (before its children) and decides whether the node and its children should be traversed.
      void visit​(NodeTraversal t, Node n, Node parent)
      Visits a node in postorder (after its children).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait