Package com.nomagic.magicreport.engine
Class Tool
java.lang.Object
java.util.Observable
com.nomagic.magicreport.engine.Tool
- All Implemented Interfaces:
ITool,IVariable,Serializable,Cloneable
- Direct Known Subclasses:
ArrayTool,BookmarkTool,ChartTool,ConcurrentTool,DependencyMatrixTool,DialogTool,DocBookTool,GenericTableTool,GroovyTool,GroupTool,ImageTool,ImportTool,JavaDocTool,JavaScriptTool,MapTool,MathTool,ModelValidationTool,ProfilingTool,ProjectTool,QueryTool,ReportHelper,SortTool,TemplateTool,TextTool
A base class realizing from interface
ITool. This class provide default implementation for
ITool. The extended class from this class may send message or object to observer class by invoke
notifyObservers(Object) of class Observable. The observer class such as
AbstractTemplateEngine or graphical user interface can catch notified object and interact with user.
This class also implement Cloneable interface with allow an object to create and return copy of this object.
- Since:
- Aug 3, 2007
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.nomagic.magicreport.engine.ITool
ITool.HTMLString, ITool.RetainedString, ITool.Void -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IContextTemplate context.protected PropertiesTemplate engine properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this object.Return template context.Return template engine properties.getProperty(String key) Return template engine property value.getProperty(String key, String defaultValue) Return template engine property value.voidnotifyObservers(Object event) OverridenotifyObserversby provide sequence of calling these methods.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.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
-
Field Details
-
properties
Template engine properties. -
context
Template context.
-
-
Constructor Details
-
Tool
public Tool()
-
-
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.- Specified by:
setPropertiesin interfaceITool- Parameters:
properties- template engine properties- Throws:
IllegalArgumentException- if properties is null
-
getProperties
Return template engine properties.- Specified by:
getPropertiesin interfaceITool- Returns:
- template engine properties
-
getProperty
Return template engine property value.- Parameters:
key- property key- Returns:
- template engine value
-
getProperty
Return template engine property value. If the key is not found in this property, the default value is return.- Parameters:
key- property keydefaultValue- default value- Returns:
- template engine value
-
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.- Specified by:
setContextin interfaceITool- Parameters:
context- template context
-
getContext
Return template context.- Specified by:
getContextin interfaceITool- Returns:
- template context
-
notifyObservers
OverridenotifyObserversby provide sequence of calling these methods.setChanged(); super.notifyObservers(event);- Overrides:
notifyObserversin classObservable- Parameters:
event- any object.- See Also:
-
clone
Creates and returns a copy of this object.- Overrides:
clonein classObject- Returns:
- a clone of this instance.
- Throws:
CloneNotSupportedException- if the object's class does not support theCloneableinterface.
-