org.kohsuke.stapler.framework.adjunct
Class AdjunctsInPage

java.lang.Object
  extended by org.kohsuke.stapler.framework.adjunct.AdjunctsInPage

public class AdjunctsInPage
extends java.lang.Object

This request-scope object keeps track of which Adjuncts are already included.

Author:
Kohsuke Kawaguchi

Method Summary
 void assumeIncluded(java.lang.String... includes)
          When you include your version of the adjunct externally, you can use this method to inform AdjunctsInPage that those adjuncts are already included in the page.
 void generate(org.apache.commons.jelly.XMLOutput out, java.lang.String... includes)
          Generates the script tag and CSS link tag to include necessary adjuncts, and records the fact that those adjuncts are already included in the page, so that it won't be loaded again.
static AdjunctsInPage get()
          Obtains the instance associated with the current request of the given StaplerRequest.
static AdjunctsInPage get(StaplerRequest request)
          Obtains the instance associated with the current request of the given StaplerRequest.
 void spool(java.lang.String... includes)
          Works like the generate(XMLOutput, String...) method but just put the adjuncts to pending without writing it.
 void writeSpooled(org.apache.commons.jelly.XMLOutput out)
          Writes out what's spooled by spool(String...) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static AdjunctsInPage get()
Obtains the instance associated with the current request of the given StaplerRequest.


get

public static AdjunctsInPage get(StaplerRequest request)
Obtains the instance associated with the current request of the given StaplerRequest.

This method is handy when the caller already have the request object around, so that we can save Stapler.getCurrentRequest() call.


generate

public void generate(org.apache.commons.jelly.XMLOutput out,
                     java.lang.String... includes)
              throws java.io.IOException,
                     org.xml.sax.SAXException
Generates the script tag and CSS link tag to include necessary adjuncts, and records the fact that those adjuncts are already included in the page, so that it won't be loaded again.

Throws:
java.io.IOException
org.xml.sax.SAXException

assumeIncluded

public void assumeIncluded(java.lang.String... includes)
                    throws java.io.IOException,
                           org.xml.sax.SAXException
When you include your version of the adjunct externally, you can use this method to inform AdjunctsInPage that those adjuncts are already included in the page.

Throws:
java.io.IOException
org.xml.sax.SAXException

spool

public void spool(java.lang.String... includes)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Works like the generate(XMLOutput, String...) method but just put the adjuncts to pending without writing it.

Throws:
java.io.IOException
org.xml.sax.SAXException

writeSpooled

public void writeSpooled(org.apache.commons.jelly.XMLOutput out)
                  throws org.xml.sax.SAXException,
                         java.io.IOException
Writes out what's spooled by spool(String...) method.

Throws:
org.xml.sax.SAXException
java.io.IOException


Copyright © 2011. All Rights Reserved.