hudson.model
Class Api

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Api
All Implemented Interfaces:
ModelObject, SearchableModelObject, SearchItem
Direct Known Subclasses:
CrumbIssuer.RestrictedApi

public class Api
extends AbstractModelObject

Used to expose remote access API for ".../api/"

If the parent object has a _api.jelly view, it will be included in the api index page.

Author:
Kohsuke Kawaguchi
See Also:
Exported

Field Summary
 Object bean
          Model object to be exposed as XML/JSON/etc.
 
Constructor Summary
Api(Object bean)
           
 
Method Summary
 void doJson(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Exposes the bean as JSON.
 void doPython(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Exposes the bean as Python literal.
 void doSchema(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Generate schema.
 void doXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String xpath, String wrapper, String tree, int depth)
          Exposes the bean as XML.
 String getDisplayName()
           
 String getSearchUrl()
          Returns the URL of this item relative to the parent SearchItem.
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bean

public final Object bean
Model object to be exposed as XML/JSON/etc.

Constructor Detail

Api

public Api(Object bean)
Method Detail

getDisplayName

public String getDisplayName()

getSearchUrl

public String getSearchUrl()
Description copied from interface: SearchItem
Returns the URL of this item relative to the parent SearchItem.

Returns:
URL like "foo" or "foo/bar". The path can end with '/'. The path that starts with '/' will be interpreted as the absolute path (within the context path of Hudson.)

doXml

public void doXml(org.kohsuke.stapler.StaplerRequest req,
                  org.kohsuke.stapler.StaplerResponse rsp,
                  @QueryParameter
                  String xpath,
                  @QueryParameter
                  String wrapper,
                  @QueryParameter
                  String tree,
                  @QueryParameter
                  int depth)
           throws IOException,
                  javax.servlet.ServletException
Exposes the bean as XML.

Throws:
IOException
javax.servlet.ServletException

doSchema

public void doSchema(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp)
              throws IOException,
                     javax.servlet.ServletException
Generate schema.

Throws:
IOException
javax.servlet.ServletException

doJson

public void doJson(org.kohsuke.stapler.StaplerRequest req,
                   org.kohsuke.stapler.StaplerResponse rsp)
            throws IOException,
                   javax.servlet.ServletException
Exposes the bean as JSON.

Throws:
IOException
javax.servlet.ServletException

doPython

public void doPython(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp)
              throws IOException,
                     javax.servlet.ServletException
Exposes the bean as Python literal.

Throws:
IOException
javax.servlet.ServletException


Copyright © 2004-2013. All Rights Reserved.