org.apache.velocity.tools.view

## Class ImportTool

- java.lang.Object
- - org.apache.velocity.tools.generic.SafeConfig
  - - org.apache.velocity.tools.generic.ImportTool
    - - org.apache.velocity.tools.view.ImportTool

All Implemented Interfaces:
  Serializable

    @DefaultKey(value="import")
     @ValidScope(value="request")
    public class ImportTool
    extends ImportTool

General-purpose text-importing view tool for templates.

Usage:
Just call $import.read("http://www.foo.com/bleh.jsp?sneh=bar") to insert the contents of the named resource into the template.

     Toolbox configuration:
     <tools>
       <toolbox scope="request">
         <tool class="org.apache.velocity.tools.view.ImportTool"/>
       </toolbox>
     </tools>

Since:
  VelocityTools 2.0
Version:
  $Revision$ $Date$
Author:
  Marino A. Jonsson
See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.velocity.tools.generic.ImportTool

`importSupport`

### Fields inherited from class org.apache.velocity.tools.generic.SafeConfig

`LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY`

### Constructor Summary

Constructors
Constructor and Description
`ImportTool()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `configure(ValueParser values)`
`protected void` `initializeImportSupport(ValueParser config)`
`String` `read(Object obj)` Returns the supplied URL rendered as a String.

### Methods inherited from class org.apache.velocity.tools.generic.ImportTool

`fetch, read`

### Methods inherited from class org.apache.velocity.tools.generic.SafeConfig

`configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig, setSafeMode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ImportTool

    public ImportTool()

### Method Detail

#### initializeImportSupport

    protected void initializeImportSupport(ValueParser config)

Overrides:
  `initializeImportSupport` in class `ImportTool`

#### configure

    protected void configure(ValueParser values)

Overrides:
  `configure` in class `ImportTool`

#### read

    public String read(Object obj)

Returns the supplied URL rendered as a String.

Parameters:
  `obj` - the URL to import
Returns:
  the URL as a string