org.apache.velocity.tools.generic
Class ToolLoader

java.lang.Object
  |
  +--org.apache.velocity.tools.generic.ToolLoader

public class ToolLoader
extends java.lang.Object

A view tool that allows template designers to load an arbitrary object into the context. Any object with a public constructor without parameters can be used as a view tool.

THIS CLASS IS HERE AS A PROOF OF CONCEPT ONLY. IT IS NOT INTENDED FOR USE IN PRODUCTION ENVIRONMENTS. USE AT YOUR OWN RISK.

Version:
$Id: ToolLoader.java,v 1.2 2003/05/28 00:17:15 nbubna Exp $
Author:
Gabe Sidler, Geir Magnusson Jr.

Constructor Summary
ToolLoader()
           
 
Method Summary
 java.lang.Object load(java.lang.String clazz)
          Creates and returns an object of the specified classname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolLoader

public ToolLoader()
Method Detail

load

public java.lang.Object load(java.lang.String clazz)
Creates and returns an object of the specified classname. The object must have a valid default constructor.

Parameters:
clazz - the fully qualified class name of the object
Returns:
an instance of the specified class or null if the class could not be instantiated.


Copyright (c) 2003 Apache Software Foundation