类 AbstractXlsView
java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.view.AbstractView
cn.taketoday.web.view.document.AbstractXlsView
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.BeanNameAware,cn.taketoday.context.ApplicationContextAware,View
- 直接已知子类:
AbstractXlsxView
Convenient superclass for Excel document views in traditional XLS format.
Compatible with Apache POI 3.5 and higher.
For working with the workbook in the subclass, see Apache's POI site
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
-
字段概要
从类继承的字段 cn.taketoday.web.view.AbstractView
DEFAULT_CONTENT_TYPE从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.web.view.View
RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected abstract voidbuildExcelDocument(Map<String, Object> model, org.apache.poi.ss.usermodel.Workbook workbook, RequestContext context) Application-provided subclasses must implement this method to populate the Excel workbook document, given the model.protected org.apache.poi.ss.usermodel.WorkbookcreateWorkbook(Map<String, Object> model, RequestContext request) Template method for creating the POIWorkbookinstance.protected booleanReturn whether this view generates download content (typically binary content like PDF or Excel files).protected final voidrenderMergedOutputModel(Map<String, Object> model, RequestContext request) Renders the Excel view, given the specified model.protected voidrenderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, RequestContext response) The actual render step: taking the POIWorkbookand rendering it to the given response.从类继承的方法 cn.taketoday.web.view.AbstractView
addStaticAttribute, createMergedOutputModel, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestContextToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeOutputRedirectModel, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
构造器详细资料
-
AbstractXlsView
public AbstractXlsView()Default Constructor. Sets the content type of the view to "application/vnd.ms-excel".
-
-
方法详细资料
-
generatesDownloadContent
protected boolean generatesDownloadContent()从类复制的说明:AbstractViewReturn whether this view generates download content (typically binary content like PDF or Excel files).The default implementation returns
false. Subclasses are encouraged to returntruehere if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream. -
renderMergedOutputModel
protected final void renderMergedOutputModel(Map<String, Object> model, RequestContext request) throws ExceptionRenders the Excel view, given the specified model.- 指定者:
renderMergedOutputModel在类中AbstractView- 参数:
model- combined output Map (nevernull), with dynamic values taking precedence over static attributesrequest- current HTTP request context- 抛出:
Exception- if rendering failed
-
createWorkbook
protected org.apache.poi.ss.usermodel.Workbook createWorkbook(Map<String, Object> model, RequestContext request) Template method for creating the POIWorkbookinstance.The default implementation creates a traditional
HSSFWorkbook. Framework-provided subclasses are overriding this for the OOXML-based variants; custom subclasses may override this for reading a workbook from a file.- 参数:
model- the model Maprequest- current HTTP request (for taking the URL or headers into account)- 返回:
- the new
Workbookinstance
-
renderWorkbook
protected void renderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, RequestContext response) throws IOException The actual render step: taking the POIWorkbookand rendering it to the given response.- 参数:
workbook- the POI Workbook to renderresponse- current HTTP response- 抛出:
IOException- when thrown by I/O methods that we're delegating to
-
buildExcelDocument
protected abstract void buildExcelDocument(Map<String, Object> model, org.apache.poi.ss.usermodel.Workbook workbook, RequestContext context) throws ExceptionApplication-provided subclasses must implement this method to populate the Excel workbook document, given the model.- 参数:
model- the model Mapworkbook- the Excel workbook to populatecontext- in case we need locale etc. Shouldn't look at attributes.- 抛出:
Exception
-