Class TryBlockEnv

java.lang.Object
com.cloudbees.groovy.cps.impl.ProxyEnv
com.cloudbees.groovy.cps.impl.TryBlockEnv
All Implemented Interfaces:
DepthTrackingEnv, Env, Serializable

public class TryBlockEnv extends ProxyEnv
Environment for evaluating the body of a try/catch block.
Author:
Kohsuke Kawaguchi
See Also:
  • Constructor Details

    • TryBlockEnv

      public TryBlockEnv(Env parent, Block finally_)
  • Method Details

    • addHandler

      public void addHandler(Class<? extends Throwable> type, Continuation k)
      Handlers can be only added immediately after instantiation.
    • getExceptionHandler

      public Continuation getExceptionHandler(Class<? extends Throwable> type)
      Description copied from interface: Env
      Finds the exception handler that catches a Throwable instance of this type.
      Specified by:
      getExceptionHandler in interface Env
      Overrides:
      getExceptionHandler in class ProxyEnv
      Returns:
      never null. Even if there's no user-specified exception handler, the default 'unhandled exception handler' must be returned.
    • getReturnAddress

      public Continuation getReturnAddress()
      Description copied from interface: Env
      Where should the return statement return to?
      Specified by:
      getReturnAddress in interface Env
      Overrides:
      getReturnAddress in class ProxyEnv
    • getBreakAddress

      public Continuation getBreakAddress(String label)
      Description copied from interface: Env
      If we see a break statement, where should we go?
      Specified by:
      getBreakAddress in interface Env
      Overrides:
      getBreakAddress in class ProxyEnv
      Parameters:
      label - Specifies the loop to break from. null for nearest loop.
      Returns:
      For semantically correct Groovy code, the return value is never null, because not having the matching label is a compile-time error.
    • getContinueAddress

      public Continuation getContinueAddress(String label)
      Description copied from interface: Env
      If we see a continue statement, where should we go?
      Specified by:
      getContinueAddress in interface Env
      Overrides:
      getContinueAddress in class ProxyEnv
      Parameters:
      label - Specifies the loop to repeat. null for nearest loop.
      Returns:
      For semantically correct Groovy code, the return value is never null, because not having the matching label is a compile-time error.