Interface JCatch

All Superinterfaces:
JBlock, JCommentable, JStatement, JTry
All Known Implementing Classes:
ImplJCatch

public interface JCatch extends JTry
A catch branch for a try block.
  • Method Details

    • or

      JCatch or(JType orType)
      Add another type option to this catch branch.
      Parameters:
      orType - the alternative type
      Returns:
      this catch block
    • or

      JCatch or(String orType)
      Add another type option to this catch branch.
      Parameters:
      orType - the alternative type
      Returns:
      this catch block
    • or

      JCatch or(Class<? extends Throwable> orType)
      Add another type option to this catch branch.
      Parameters:
      orType - the alternative type
      Returns:
      this catch block
    • with

      JCatch with(JExpr var)
      Add a Java 9-style final variable resource for try-with-resources constructs.
      Specified by:
      with in interface JTry
      Parameters:
      var - the resource variable expression
      Returns:
      this try block
    • ignore

      JCatch ignore(String type)
      Add a catch for an ignored exception.
      Specified by:
      ignore in interface JTry
      Parameters:
      type - the exception type
      Returns:
      this try block
    • ignore

      JCatch ignore(Class<? extends Throwable> type)
      Add a catch for an ignored exception.
      Specified by:
      ignore in interface JTry
      Parameters:
      type - the exception type
      Returns:
      this try block
    • ignore

      JCatch ignore(JType type)
      Add a catch for an ignored exception.
      Specified by:
      ignore in interface JTry
      Parameters:
      type - the exception type
      Returns:
      this try block