com.carbonfive.sstemplates
Class SsTemplateContextImpl
java.lang.Object
com.carbonfive.sstemplates.SsTemplateContextImpl
- All Implemented Interfaces:
- javax.servlet.jsp.el.FunctionMapper, SsTemplateContext, javax.servlet.jsp.el.VariableResolver
- Direct Known Subclasses:
- SsTemplateServletContext
- public class SsTemplateContextImpl
- extends java.lang.Object
- implements SsTemplateContext
This class acts as an EL VariableResolver, but does not support the pageContext implicit object.
- Version:
- $REVISION
- Author:
- sivoh
|
Method Summary |
java.lang.String |
addStyleData(java.lang.String name,
HssfStyleData data)
|
org.apache.poi.hssf.usermodel.HSSFFont |
createFont(java.lang.String name,
short fontHeight,
short color,
short boldWeight,
boolean italic,
boolean strikeout,
byte underline,
short typeOffset)
|
java.io.File |
findFileInTemplateDirectory(java.lang.String path)
|
short[] |
getBackgroundColor()
|
short |
getColorIndex(short[] triplet)
|
int |
getColumnIndex()
|
java.lang.String |
getCurrentStyle()
|
java.lang.Object |
getCustomValue(java.lang.Object key)
|
int |
getMaxColumnIndex()
|
int |
getMaxRowIndex()
|
HssfCellAccumulator |
getNamedAccumulator(java.lang.String name)
|
org.apache.poi.hssf.usermodel.HSSFCellStyle |
getNamedStyle(java.lang.String name)
|
HssfStyleData |
getNamedStyleData(java.lang.String name)
|
java.lang.Object |
getPageVariable(java.lang.String key)
|
org.apache.poi.hssf.util.Region |
getRegionForCurrentLocation()
|
org.apache.poi.hssf.usermodel.HSSFRow |
getRow()
|
int |
getRowIndex()
|
org.apache.poi.hssf.usermodel.HSSFSheet |
getSheet()
|
org.apache.poi.hssf.usermodel.HSSFWorkbook |
getWorkbook()
|
boolean |
hasCachedStyleData(java.lang.String name)
|
void |
incrementCellIndex()
|
void |
incrementRowIndex()
|
int |
nextPageBreak(int row)
|
java.util.Collection |
parseIncludeFile(java.lang.String path)
|
void |
registerMethod(java.lang.String name,
java.lang.reflect.Method m)
|
java.lang.reflect.Method |
resolveFunction(java.lang.String prefix,
java.lang.String name)
|
java.lang.Object |
resolveVariable(java.lang.String name)
|
void |
setBackgroundColor(short[] triplet)
|
void |
setColumnIndex(int columnIndex)
|
void |
setCurrentStyle(java.lang.String currentStyle)
|
void |
setCustomValue(java.lang.Object key,
java.lang.Object value)
|
void |
setPageBreaks(int firstPageBreak,
int nextPageBreak)
|
java.lang.Object |
setPageVariable(java.lang.String key,
java.lang.Object value)
|
void |
setRow(org.apache.poi.hssf.usermodel.HSSFRow row)
|
void |
setRowIndex(int rowIndex)
|
void |
setSheet(org.apache.poi.hssf.usermodel.HSSFSheet sheet)
|
void |
setWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
|
void |
unsetPageVariable(java.lang.String key,
java.lang.Object oldValue)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
firstColorIndex
public static final short firstColorIndex
- See Also:
- Constant Field Values
lastColorIndex
public static final short lastColorIndex
- See Also:
- Constant Field Values
SsTemplateContextImpl
public SsTemplateContextImpl(SsTemplateProcessor processor,
java.io.File templateDir)
SsTemplateContextImpl
public SsTemplateContextImpl(SsTemplateProcessor processor,
java.io.File templateDir,
java.util.Map context)
parseIncludeFile
public java.util.Collection parseIncludeFile(java.lang.String path)
throws SsTemplateException
- Specified by:
parseIncludeFile in interface SsTemplateContext
- Throws:
SsTemplateException
findFileInTemplateDirectory
public java.io.File findFileInTemplateDirectory(java.lang.String path)
- Specified by:
findFileInTemplateDirectory in interface SsTemplateContext
setPageVariable
public java.lang.Object setPageVariable(java.lang.String key,
java.lang.Object value)
- Specified by:
setPageVariable in interface SsTemplateContext
unsetPageVariable
public void unsetPageVariable(java.lang.String key,
java.lang.Object oldValue)
- Specified by:
unsetPageVariable in interface SsTemplateContext
getPageVariable
public java.lang.Object getPageVariable(java.lang.String key)
- Specified by:
getPageVariable in interface SsTemplateContext
resolveVariable
public java.lang.Object resolveVariable(java.lang.String name)
- Specified by:
resolveVariable in interface SsTemplateContext
createFont
public org.apache.poi.hssf.usermodel.HSSFFont createFont(java.lang.String name,
short fontHeight,
short color,
short boldWeight,
boolean italic,
boolean strikeout,
byte underline,
short typeOffset)
- Specified by:
createFont in interface SsTemplateContext
incrementCellIndex
public void incrementCellIndex()
- Specified by:
incrementCellIndex in interface SsTemplateContext
incrementRowIndex
public void incrementRowIndex()
- Specified by:
incrementRowIndex in interface SsTemplateContext
getRegionForCurrentLocation
public org.apache.poi.hssf.util.Region getRegionForCurrentLocation()
- Specified by:
getRegionForCurrentLocation in interface SsTemplateContext
addStyleData
public java.lang.String addStyleData(java.lang.String name,
HssfStyleData data)
- Specified by:
addStyleData in interface SsTemplateContext
getNamedStyle
public org.apache.poi.hssf.usermodel.HSSFCellStyle getNamedStyle(java.lang.String name)
throws SsTemplateException
- Specified by:
getNamedStyle in interface SsTemplateContext
- Throws:
SsTemplateException
getNamedStyleData
public HssfStyleData getNamedStyleData(java.lang.String name)
throws SsTemplateException
- Specified by:
getNamedStyleData in interface SsTemplateContext
- Throws:
SsTemplateException
hasCachedStyleData
public boolean hasCachedStyleData(java.lang.String name)
- Specified by:
hasCachedStyleData in interface SsTemplateContext
setPageBreaks
public void setPageBreaks(int firstPageBreak,
int nextPageBreak)
- Specified by:
setPageBreaks in interface SsTemplateContext
getWorkbook
public org.apache.poi.hssf.usermodel.HSSFWorkbook getWorkbook()
- Specified by:
getWorkbook in interface SsTemplateContext
setWorkbook
public void setWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
- Specified by:
setWorkbook in interface SsTemplateContext
getSheet
public org.apache.poi.hssf.usermodel.HSSFSheet getSheet()
- Specified by:
getSheet in interface SsTemplateContext
setSheet
public void setSheet(org.apache.poi.hssf.usermodel.HSSFSheet sheet)
- Specified by:
setSheet in interface SsTemplateContext
getRow
public org.apache.poi.hssf.usermodel.HSSFRow getRow()
- Specified by:
getRow in interface SsTemplateContext
setRow
public void setRow(org.apache.poi.hssf.usermodel.HSSFRow row)
- Specified by:
setRow in interface SsTemplateContext
getRowIndex
public int getRowIndex()
- Specified by:
getRowIndex in interface SsTemplateContext
setRowIndex
public void setRowIndex(int rowIndex)
- Specified by:
setRowIndex in interface SsTemplateContext
getColumnIndex
public int getColumnIndex()
- Specified by:
getColumnIndex in interface SsTemplateContext
setColumnIndex
public void setColumnIndex(int columnIndex)
- Specified by:
setColumnIndex in interface SsTemplateContext
getCurrentStyle
public java.lang.String getCurrentStyle()
- Specified by:
getCurrentStyle in interface SsTemplateContext
setCurrentStyle
public void setCurrentStyle(java.lang.String currentStyle)
- Specified by:
setCurrentStyle in interface SsTemplateContext
getNamedAccumulator
public HssfCellAccumulator getNamedAccumulator(java.lang.String name)
- Specified by:
getNamedAccumulator in interface SsTemplateContext
registerMethod
public void registerMethod(java.lang.String name,
java.lang.reflect.Method m)
- Specified by:
registerMethod in interface SsTemplateContext
resolveFunction
public java.lang.reflect.Method resolveFunction(java.lang.String prefix,
java.lang.String name)
- Specified by:
resolveFunction in interface SsTemplateContext
getCustomValue
public java.lang.Object getCustomValue(java.lang.Object key)
- Specified by:
getCustomValue in interface SsTemplateContext
setCustomValue
public void setCustomValue(java.lang.Object key,
java.lang.Object value)
- Specified by:
setCustomValue in interface SsTemplateContext
getColorIndex
public short getColorIndex(short[] triplet)
throws SsTemplateException
- Specified by:
getColorIndex in interface SsTemplateContext
- Throws:
SsTemplateException
getMaxRowIndex
public int getMaxRowIndex()
- Specified by:
getMaxRowIndex in interface SsTemplateContext
getMaxColumnIndex
public int getMaxColumnIndex()
- Specified by:
getMaxColumnIndex in interface SsTemplateContext
setBackgroundColor
public void setBackgroundColor(short[] triplet)
- Specified by:
setBackgroundColor in interface SsTemplateContext
getBackgroundColor
public short[] getBackgroundColor()
- Specified by:
getBackgroundColor in interface SsTemplateContext
nextPageBreak
public int nextPageBreak(int row)
- Specified by:
nextPageBreak in interface SsTemplateContext