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

@OpenApiAll public interface ITool extends IVariable
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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    Direct command IFormatter to render in HTML format.
    static class 
    Direct command IFormatter to keep the referenced String format.
    static class 
    A void class uses to return in Velocity Tools when you want exactly not return anything to context.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ITool.Void
    Instead of void (null) in Velocity, return this object, if empty string is require for output.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    Return template context.
    Return template engine properties.
    void
    This method is invoked by the template engine runtime, after class has been initializing, to set the template context.
    void
    This method is invoked by the template engine runtime, after class has been initializing, to set the template properties.
  • Field Details

    • VOID

      static final ITool.Void VOID
      Instead of void (null) in Velocity, return this object, if empty string is require for output. The ITool.Void uses to make sure that returning data from setter method is absolutely nothing. In general case, Velocity consider return void from setter method as null value, this cause the word 'null' printed out in report. To avoid this problem setter method may use VOID as returning object.
  • Method Details

    • setProperties

      void setProperties(Properties properties)
      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

      void setContext(IContext context)
      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()