@OpenApiAll public class Tool extends java.util.Observable implements ITool, java.lang.Cloneable
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.
ITool.HTMLString, ITool.RetainedString, ITool.Void
Modifier and Type | Field and Description |
---|---|
protected IContext |
context
Template context.
|
protected java.util.Properties |
properties
Template engine properties.
|
Constructor and Description |
---|
Tool() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object.
|
IContext |
getContext()
Return template context.
|
java.util.Properties |
getProperties()
Return template engine properties.
|
java.lang.String |
getProperty(java.lang.String key)
Return template engine property value.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Return template engine property value.
|
void |
notifyObservers(java.lang.Object event)
Override
notifyObservers by provide sequence of calling these methods. |
void |
setContext(IContext context)
This method is invoked by the template engine runtime, after class has been initializing, to set the
template context.
|
void |
setProperties(java.util.Properties properties)
This method is invoked by the template engine runtime, after class has been initializing, to set the
template properties.
|
protected java.util.Properties properties
protected IContext context
public void setProperties(java.util.Properties properties)
setProperties
in interface ITool
properties
- template engine propertiesjava.lang.IllegalArgumentException
- if properties is nullpublic java.util.Properties getProperties()
getProperties
in interface ITool
public java.lang.String getProperty(java.lang.String key)
key
- property keypublic java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- property keydefaultValue
- default valuepublic void setContext(IContext context)
setContext
in interface ITool
context
- template contextpublic IContext getContext()
getContext
in interface ITool
public void notifyObservers(java.lang.Object event)
notifyObservers
by provide sequence of calling these methods.
setChanged();
super.notifyObservers(event);
notifyObservers
in class java.util.Observable
event
- any object.Observable.clearChanged()
,
Observable.hasChanged()
,
Observer.update(java.util.Observable, java.lang.Object)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the object's class does not support the Cloneable
interface.Copyright © 2010 - No Magic Asia