public abstract class AbstractJspFactory extends java.lang.Object implements DynamicActionAttributes
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)
.
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,DynamicActionAttribute> |
dynamicAttributes |
private java.util.Set<java.lang.String> |
scripts |
private java.util.Set<java.lang.String> |
stylesheets |
Constructor and Description |
---|
AbstractJspFactory()
Create a new factory instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<DynamicActionAttribute> |
getDynamicActionAttributes()
Get an iterator that return all dynamic attributes.
|
java.lang.String |
getParameter(java.lang.String key)
Get a generic parameter value.
|
java.util.Set<java.lang.String> |
getScripts()
Get a set with all script references.
|
java.util.Set<java.lang.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 |
setParameter(java.lang.String key,
java.lang.String value)
Generic parameter setter metod.
|
void |
setScript(java.lang.String script)
Add a reference to a javascript file to the factory.
|
void |
setStylesheet(java.lang.String stylesheet)
Add a reference to a CSS stylesheet file to the factory.
|
private java.util.Set<java.lang.String> scripts
private java.util.Set<java.lang.String> stylesheets
private java.util.Map<java.lang.String,DynamicActionAttribute> dynamicAttributes
protected void prepareContext(JspContext jspContext)
jspContext
- The context to add the scripts to@VariableSetter @PathSetter public void setScript(java.lang.String script)
script
- The script to add@VariableSetter @PathSetter public void setStylesheet(java.lang.String stylesheet)
stylesheet
- The stylesheet to addpublic java.util.Set<java.lang.String> getScripts()
public java.util.Set<java.lang.String> getStylesheets()
@VariableSetter @PathSetter public void setParameter(java.lang.String key, java.lang.String value)
key
- The name of the parametervalue
- The value of the parameterpublic java.lang.String getParameter(java.lang.String key)
key
- The name of the parameterpublic java.util.Iterator<DynamicActionAttribute> getDynamicActionAttributes()
DynamicActionAttributes
getDynamicActionAttributes
in interface DynamicActionAttributes