Package com.nomagic.magicreport.engine
Interface ITool
- All Superinterfaces:
IVariable,Serializable
- All Known Implementing Classes:
ArrayTool,BookmarkTool,ChartTool,ConcurrentTool,DefaultImporterTool,DependencyMatrixTool,DialogTool,DocBookTool,DOCXImporterTool,ExportTool2,ExportTool3,FileTool,GenericTableTool,GroovyTool,GroupTool,ImageTool,ImportTool,JavaDocTool,JavaScriptTool,MapTool,MathTool,ModelValidationTool,ProfilingTool,ProjectTool,QueryTool,ReportFileTool,ReportHelper,SorterTool,SortTable,SortTool,TemplateTool,TemplateTool,TextTool,Tool
Interface for template tool. All template tool must implements this interface. The concept of the 'tool' is
similar to Velocity template context. The idea is that the tool is a 'carrier' of data between the Java layer
and the template layer.
Tool gather objects of various types, and place them in the template. Tool is Java Bean object. The Java Bean consists of field, getter and setter of field, and empty Constructor.
- Since:
- Jan 23, 2008
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDirect commandIFormatterto render in HTML format.static classDirect commandIFormatterto keep the referenced String format.static classA void class uses to return in Velocity Tools when you want exactly not return anything to context. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ITool.VoidInstead of void (null) in Velocity, return this object, if empty string is require for output. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidReturn template context.Return template engine properties.voidsetContext(IContext context) This method is invoked by the template engine runtime, after class has been initializing, to set the template context.voidsetProperties(Properties properties) This method is invoked by the template engine runtime, after class has been initializing, to set the template properties.
-
Field Details
-
VOID
Instead of void (null) in Velocity, return this object, if empty string is require for output. TheITool.Voiduses to make sure that returning data from setter method is absolutely nothing. In general case, Velocity consider returnvoidfrom setter method asnullvalue, this cause the word 'null' printed out in report. To avoid this problem setter method may useVOIDas returning object.
-
-
Method Details
-
setProperties
This method is invoked by the template engine runtime, after class has been initializing, to set the template properties. Override current properties will not affect with the engine.- Parameters:
properties- template engine properties
-
getProperties
Properties getProperties()Return template engine properties.- Returns:
- template engine properties
-
setContext
This method is invoked by the template engine runtime, after class has been initializing, to set the template context. This method automatically called by template engine.- Parameters:
context- template context
-
getContext
IContext getContext()Return template context.- Returns:
- template context
-
clearTool
default void clearTool()
-