org.apache.velocity.tools.view
Class ViewToolInfo

java.lang.Object
  extended by org.apache.velocity.tools.view.ViewToolInfo
All Implemented Interfaces:
ToolInfo
Direct Known Subclasses:
ServletToolInfo

Deprecated. Use ToolInfo

@Deprecated
public class ViewToolInfo
extends Object
implements ToolInfo

ToolInfo implementation for view tools. New instances are returned for every call to getInstance(obj), and tools that have an init(Object) method are initialized with the given object before being returned. And tools that have a configure(Map) method will be configured before being returned if there are parameters specified for the tool.

Version:
$Id: ViewToolInfo.java 961796 2010-07-08 15:18:15Z apetrelli $
Author:
Nathan Bubna, Henning P. Schmiedehausen

Field Summary
protected static org.apache.commons.logging.Log LOG
          Deprecated.  
 
Constructor Summary
ViewToolInfo()
          Deprecated.  
 
Method Summary
protected  Class getApplicationClass(String name)
          Deprecated. Return the Class object for the specified fully qualified class name, from this web application's class loader.
 String getClassname()
          Deprecated.  
 Object getInstance(Object initData)
          Deprecated. Returns a new instance of the tool.
 String getKey()
          Deprecated. Accessors
 Map getParameters()
          Deprecated. Get parameters for this tool.
 void setClassname(String classname)
          Deprecated. If an instance of the tool cannot be created from the classname passed to this method, it will throw an exception.
 void setKey(String key)
          Deprecated. Mutators
 void setParameter(String name, String value)
          Deprecated. Set/add new parameter for this tool.
 void setParameters(Map parameters)
          Deprecated. Set parameter map for this tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Deprecated. 
Constructor Detail

ViewToolInfo

public ViewToolInfo()
Deprecated. 
Method Detail

getApplicationClass

protected Class getApplicationClass(String name)
                             throws ClassNotFoundException
Deprecated. 
Return the Class object for the specified fully qualified class name, from this web application's class loader. If no class loader is set for the current thread, then the class loader that loaded this class will be used.

Parameters:
name - Fully qualified class name to be loaded
Returns:
Class object
Throws:
ClassNotFoundException - if the class cannot be found
Since:
VelocityTools 1.1

setKey

public void setKey(String key)
Deprecated. 
Mutators


setClassname

public void setClassname(String classname)
                  throws Exception
Deprecated. 
If an instance of the tool cannot be created from the classname passed to this method, it will throw an exception.

Parameters:
classname - the fully qualified java.lang.Class name of the tool
Throws:
Exception

setParameters

public void setParameters(Map parameters)
Deprecated. 
Set parameter map for this tool.

Since:
VelocityTools 1.1

setParameter

public void setParameter(String name,
                         String value)
Deprecated. 
Set/add new parameter for this tool.

Since:
VelocityTools 1.1

getKey

public String getKey()
Deprecated. 
Accessors

Specified by:
getKey in interface ToolInfo
Returns:
the context key for the tool

getClassname

public String getClassname()
Deprecated. 
Specified by:
getClassname in interface ToolInfo
Returns:
the fully qualified classname for the tool

getParameters

public Map getParameters()
Deprecated. 
Get parameters for this tool.

Since:
VelocityTools 1.1

getInstance

public Object getInstance(Object initData)
Deprecated. 
Returns a new instance of the tool. If the tool has an init(Object) method, the new instance will be initialized using the given data. If parameters have been specified and the tool has a configure(Map) method, the tool will be passed the parameters also.

Specified by:
getInstance in interface ToolInfo
Parameters:
initData - an object that may be used to initialize the instance
Returns:
an instance of the tool


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.