Class TreeUtilsAfterJava11.SwitchExpressionUtils

  • Enclosing class:
    TreeUtilsAfterJava11

    public static class TreeUtilsAfterJava11.SwitchExpressionUtils
    extends java.lang.Object
    Utility methods for accessing SwitchExpressionTree methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<? extends com.sun.source.tree.CaseTree> getCases​(com.sun.source.tree.Tree switchExpressionTree)
      Returns the cases of switchExpressionTree.
      static com.sun.source.tree.ExpressionTree getExpression​(com.sun.source.tree.Tree switchExpressionTree)
      Returns the selector expression of switchExpressionTree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getCases

        public static java.util.List<? extends com.sun.source.tree.CaseTree> getCases​(com.sun.source.tree.Tree switchExpressionTree)
        Returns the cases of switchExpressionTree. For example
           switch ( expression ) {
             cases
           }
         
        Parameters:
        switchExpressionTree - the switch expression whose cases are returned
        Returns:
        the cases of switchExpressionTree
      • getExpression

        public static com.sun.source.tree.ExpressionTree getExpression​(com.sun.source.tree.Tree switchExpressionTree)
        Returns the selector expression of switchExpressionTree. For example
           switch ( expression ) { ... }
         
        Parameters:
        switchExpressionTree - the switch expression whose selector expression is returned
        Returns:
        the selector expression of switchExpressionTree