2.17.2: 2011-06-17

net.sf.basedb.clients.web.extensions
Class AbstractJspFactory

java.lang.Object
  extended by net.sf.basedb.clients.web.extensions.AbstractJspFactory
Direct Known Subclasses:
AbstractJspActionFactory, AbstractJspRendererFactory

public abstract class AbstractJspFactory
extends Object

An abstract BASE class for action and renderer factories. This class provides support for adding scripts and stylesheets to the rendered JSP page.

Use the setScript(String) and setStylesheet(String) methods to add references to script and stylesheet files to the factory.

Note! The naming of these methods may be a bit misleading, since each call ADD the argument to a set. To remove items from the sets use the getScripts() and getStylesheets() methods.

Scripts and stylesheets that has been added to the factory will be propagated to the JspContext.addScript(String) and JspContext.addStylesheet(String) methods in the prepareContext(JspContext).

Version:
2.7
Author:
nicklas
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  Set<String> scripts
           
private  Set<String> stylesheets
           
 
Constructor Summary
AbstractJspFactory()
          Create a new factory instance.
 
Method Summary
 Set<String> getScripts()
          Get a set with all script references.
 Set<String> getStylesheets()
          Get a set with all stylesheet references.
protected  void prepareContext(JspContext jspContext)
          Prepare the JSP context by adding all registered script and stylesheet references to it.
 void setScript(String script)
          Add a reference to a javascript file to the factory.
 void setStylesheet(String stylesheet)
          Add a reference to a CSS stylesheet file to the factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scripts

private Set<String> scripts

stylesheets

private Set<String> stylesheets
Constructor Detail

AbstractJspFactory

public AbstractJspFactory()
Create a new factory instance.

Method Detail

prepareContext

protected void prepareContext(JspContext jspContext)
Prepare the JSP context by adding all registered script and stylesheet references to it.

Parameters:
jspContext - The context to add the scripts to

setScript

@VariableSetter
@PathSetter
public void setScript(String script)
Add a reference to a javascript file to the factory.

Parameters:
script - The script to add

setStylesheet

@VariableSetter
@PathSetter
public void setStylesheet(String stylesheet)
Add a reference to a CSS stylesheet file to the factory.

Parameters:
stylesheet - The stylesheet to add

getScripts

public Set<String> getScripts()
Get a set with all script references.

Returns:
A set or null if no scripts has been added

getStylesheets

public Set<String> getStylesheets()
Get a set with all stylesheet references.

Returns:
A set or null if no stylesheets has been added

2.17.2: 2011-06-17