jodd.lagarto.adapter.htmlstapler
Class BundleAction

java.lang.Object
  extended by jodd.lagarto.adapter.htmlstapler.BundleAction

public class BundleAction
extends java.lang.Object

Bundle action used during page parsing and resources collection.


Field Summary
protected  java.lang.String actionPath
           
protected  java.lang.String bundleContentType
           
protected  java.lang.String bundleId
           
protected  char[] bundleIdMark
           
protected  HtmlStaplerBundlesManager bundlesManager
           
protected  java.lang.String contextPath
           
protected  boolean firstScriptTag
           
protected  boolean newAction
           
protected  java.util.List<java.lang.String> sources
           
protected  HtmlStaplerBundlesManager.Strategy strategy
           
 
Constructor Summary
BundleAction(HtmlStaplerBundlesManager bundlesManager, javax.servlet.http.HttpServletRequest request, java.lang.String bundleContentType)
          Creates new bundle action.
 
Method Summary
 boolean acceptLink(java.lang.String src)
          Returns true if resource link should be collected into the bundle.
protected  java.lang.String buildStaplerUrl()
          Builds stapler URL based on bundle action data.
 void end()
          Called on end of parsing.
 java.lang.String processLink(java.lang.String src)
          Process links.
 char[] replaceBundleId(char[] content)
          Replaces bundle marker with calculated bundle id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundlesManager

protected final HtmlStaplerBundlesManager bundlesManager

bundleContentType

protected final java.lang.String bundleContentType

newAction

protected final boolean newAction

actionPath

protected final java.lang.String actionPath

contextPath

protected final java.lang.String contextPath

strategy

protected final HtmlStaplerBundlesManager.Strategy strategy

bundleId

protected java.lang.String bundleId

bundleIdMark

protected char[] bundleIdMark

sources

protected java.util.List<java.lang.String> sources

firstScriptTag

protected boolean firstScriptTag
Constructor Detail

BundleAction

public BundleAction(HtmlStaplerBundlesManager bundlesManager,
                    javax.servlet.http.HttpServletRequest request,
                    java.lang.String bundleContentType)
Creates new bundle action.

Method Detail

acceptLink

public boolean acceptLink(java.lang.String src)
Returns true if resource link should be collected into the bundle. Returns false for resources that has to ignored or when no link existed (null).

By default, ignores resource links that contains "jodd.unstaple" (usually set as dummy parameter name).


processLink

public java.lang.String processLink(java.lang.String src)
Process links. Returns bundle link if this is the first resource of the same type. Otherwise, returns null indicating that collection is going on and the original link should be removed.


buildStaplerUrl

protected java.lang.String buildStaplerUrl()
Builds stapler URL based on bundle action data.


end

public void end()
Called on end of parsing.


replaceBundleId

public char[] replaceBundleId(char[] content)
Replaces bundle marker with calculated bundle id. Used for RESOURCE_ONLY strategy.



Copyright © 2003-2012 Jodd Team