Class AbstractJspFactory
- All Implemented Interfaces:
DynamicActionAttributes
- Direct Known Subclasses:
AbstractJspActionFactory
,AbstractJspRendererFactory
Use the setScript(String)
and setStylesheet(String)
methods to add references to script and stylesheet files to the factory.
This class also implements generic parameter method setParameter(String, String)
which will be used if no specific setter method for a parameter exists.
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: 2014-01-28 12:28:44 +0100 (ti, 28 jan 2014) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet an iterator that return all dynamic attributes.getParameter
(String key) Get a generic parameter value.Get a set with all script references.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
setParameter
(String key, String value) Generic parameter setter metod.void
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.
-
Field Details
-
scripts
-
stylesheets
-
dynamicAttributes
-
-
Constructor Details
-
AbstractJspFactory
public AbstractJspFactory()Create a new factory instance.
-
-
Method Details
-
prepareContext
Prepare the JSP context by adding all registered script and stylesheet references to it.- Parameters:
jspContext
- The context to add the scripts to
-
setScript
Add a reference to a javascript file to the factory.- Parameters:
script
- The script to add
-
setStylesheet
Add a reference to a CSS stylesheet file to the factory.- Parameters:
stylesheet
- The stylesheet to add
-
getScripts
Get a set with all script references.- Returns:
- A set or null if no scripts has been added
-
getStylesheets
Get a set with all stylesheet references.- Returns:
- A set or null if no stylesheets has been added
-
setParameter
Generic parameter setter metod.- Parameters:
key
- The name of the parametervalue
- The value of the parameter- Since:
- 3.3
-
getParameter
Get a generic parameter value.- Parameters:
key
- The name of the parameter- Returns:
- The value of the parameter, or null if no value has been defined
- Since:
- 3.3
-
getDynamicActionAttributes
Description copied from interface:DynamicActionAttributes
Get an iterator that return all dynamic attributes. If no dynamic attributes have been defined, the method may return null or an iterator that doesn't return any elements.- Specified by:
getDynamicActionAttributes
in interfaceDynamicActionAttributes
- Returns:
- An iterator or null
-