com.github.dandelion.datatables.jsp.tag
Class AbstractTableTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.github.dandelion.datatables.jsp.tag.AbstractTableTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
TableTag

public abstract class AbstractTableTag
extends javax.servlet.jsp.tagext.BodyTagSupport
implements javax.servlet.jsp.tagext.DynamicAttributes

Abstract class which contains :

Since:
0.1.0
Author:
Thibault Duchateau, Enrique Ruiz
See Also:
Serialized Form

Field Summary
protected  String confGroup
           
protected  Object currentObject
           
protected  Object data
          First way to populate the table: using a Collection previously set in request.
protected  Map<String,String> dynamicAttributes
           
protected  String footer
           
protected  String id
           
protected  Integer iterationNumber
           
protected  Iterator<Object> iterator
           
protected  String loadingType
           
protected  String row
          Name that has been assigned with the row attribute for the iterated object set in the page context.
protected  String rowIdBase
           
protected  String rowIdPrefix
           
protected  String rowIdSufix
           
protected  Map<Configuration,Object> stagingConf
          Map holding the staging configuration to apply to the table.
protected  HtmlTable table
           
protected  String url
          Second way to populate the table: using the URL that returns data.
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
AbstractTableTag()
           
 
Method Summary
protected  void generateLinkTag(String href)
          Generate and write a new HTML link tag.
protected  void generateScriptTag(String src)
          Generate and write a new HTML script tag.
protected  ExportType getCurrentExportType()
          Return the current export type asked by the user on export link click.
 Object getCurrentObject()
           
protected  Map<String,String> getDynamicAttributes()
          Get the map of dynamic attributes.
 Integer getIterationNumber()
           
protected  String getRowId()
          Return the row id using prefix, base and suffix.
 HtmlTable getTable()
          Getters and setters for all attributes
 Boolean isFirstIteration()
           
protected  int processIteration()
          Process the iteration over the data (only for DOM source).
 void setCurrentObject(Object currentObject)
           
 void setDynamicAttribute(String uri, String localName, Object value)
          
 void setId(String id)
           
 void setRow(String row)
           
protected  void validDynamicAttribute(String localName, Object value)
          Whether the given name-value pair is a valid dynamic attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

stagingConf

protected Map<Configuration,Object> stagingConf
Map holding the staging configuration to apply to the table.


data

protected Object data
First way to populate the table: using a Collection previously set in request.


url

protected String url
Second way to populate the table: using the URL that returns data.


row

protected String row
Name that has been assigned with the row attribute for the iterated object set in the page context.


id

protected String id

rowIdBase

protected String rowIdBase

rowIdPrefix

protected String rowIdPrefix

rowIdSufix

protected String rowIdSufix

dynamicAttributes

protected Map<String,String> dynamicAttributes

footer

protected String footer

iterationNumber

protected Integer iterationNumber

table

protected HtmlTable table

iterator

protected Iterator<Object> iterator

currentObject

protected Object currentObject

loadingType

protected String loadingType

confGroup

protected String confGroup
Constructor Detail

AbstractTableTag

public AbstractTableTag()
Method Detail

processIteration

protected int processIteration()
                        throws javax.servlet.jsp.JspException
Process the iteration over the data (only for DOM source).

Returns:
EVAL_BODY_BUFFERED if some data remain in the Java Collection, SKIP_BODY otherwise.
Throws:
javax.servlet.jsp.JspException - if something went wrong during the row id generation.

getCurrentExportType

protected ExportType getCurrentExportType()
Return the current export type asked by the user on export link click.

Returns:
An enum corresponding to the type of export.

getRowId

protected String getRowId()
                   throws javax.servlet.jsp.JspException
Return the row id using prefix, base and suffix. Prefix and sufix are just prepended and appended strings. Base is extracted from the current iterated object.

Returns:
return the row id using prefix, base and suffix.
Throws:
javax.servlet.jsp.JspException - is the rowIdBase doesn't have a corresponding property accessor method.

generateLinkTag

protected void generateLinkTag(String href)
                        throws IOException
Generate and write a new HTML link tag.

Parameters:
href -
Throws:
IOException

generateScriptTag

protected void generateScriptTag(String src)
                          throws IOException
Generate and write a new HTML script tag.

Parameters:
href -
Throws:
IOException

getTable

public HtmlTable getTable()
Getters and setters for all attributes


setRow

public void setRow(String row)

isFirstIteration

public Boolean isFirstIteration()

getIterationNumber

public Integer getIterationNumber()

getCurrentObject

public Object getCurrentObject()

setCurrentObject

public void setCurrentObject(Object currentObject)

setId

public void setId(String id)
Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport

getDynamicAttributes

protected Map<String,String> getDynamicAttributes()
Get the map of dynamic attributes.


setDynamicAttribute

public void setDynamicAttribute(String uri,
                                String localName,
                                Object value)
                         throws javax.servlet.jsp.JspException

Specified by:
setDynamicAttribute in interface javax.servlet.jsp.tagext.DynamicAttributes
Throws:
javax.servlet.jsp.JspException

validDynamicAttribute

protected void validDynamicAttribute(String localName,
                                     Object value)
Whether the given name-value pair is a valid dynamic attribute.



Copyright © 2013. All Rights Reserved.