Class Bound

java.lang.Object
org.kohsuke.stapler.bind.Bound
All Implemented Interfaces:
HttpResponse

public abstract class Bound extends Object implements HttpResponse
Handles to the object bound via BoundObjectTable. As HttpResponse, this object generates a redirect to the URL that it points to.
Author:
Kohsuke Kawaguchi
See Also:
  • MetaClass.buildDispatchers()
  • Constructor Details

    • Bound

      public Bound()
  • Method Details

    • release

      public abstract void release()
      Explicitly unbind this object. The referenced object won't be bound to URL anymore.
    • getURL

      public abstract String getURL()
      The URL where the object is bound to. This method starts with '/' and thus always absolute within the current web server.
    • getTarget

      public abstract Object getTarget()
      Gets the bound object.
    • getProxyScript

      public final String getProxyScript()
      Returns a JavaScript expression which evaluates to a JavaScript proxy that talks back to the bound object that this handle represents.
    • getProxyScriptURL

      public static String getProxyScriptURL(String variableName, Bound bound)
      Returns the URL to the proxy script for the specified Bound.
      Parameters:
      variableName - the variable to assign to the bound object
      bound - the bound object, or null if none.
      Returns:
      the URL to the proxy script for the specified Bound, starting with the context path
    • getProxyScriptURL

      public final String getProxyScriptURL(String variableName)
      Returns the URL for the standalone proxy script of this Bound.
      Parameters:
      variableName - the name of the JS variable to assign
      Returns:
      the URL for the standalone proxy script of this Bound, starting with the context path
    • getBoundJavaScriptUrlNames

      public final Set<String> getBoundJavaScriptUrlNames()
      Returns a collection of all JS bound methods of the target's type.
      Returns:
      a collection of all JS bound methods of the target's type
    • getProxyScript

      public static String getProxyScript(String url, Class<?> clazz)
    • getProxyScript

      public static String getProxyScript(String url, String[] methods)
      Returns the Stapler proxy script for the specified URL and method names
      Parameters:
      url - URL to proxied object
      methods - list of method names
      Returns:
      the Stapler proxy script for the specified URL and method names