Package org.apache.velocity.util.introspection

# Class UberspectImpl

java.lang.Object
org.apache.velocity.util.introspection.UberspectImpl

All Implemented Interfaces:
  `Uberspect`, `RuntimeServicesAware`

Direct Known Subclasses:
  `AbstractChainableUberspector`, `SecureUberspector`

public class UberspectImpl extends Object implements Uberspect, RuntimeServicesAware
Implementation of Uberspect to provide the default introspective functionality of Velocity

Version:
  $Id$
Author:
  Geir Magnusson Jr., Henning P. Schmiedehausen

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`UberspectImpl.VelGetterImpl`
`static class`
`UberspectImpl.VelMethodImpl`
Implementation of VelMethod
`static class`
`UberspectImpl.VelSetterImpl`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected TypeConversionHandler`
`conversionHandler`
the conversion handler
`protected Introspector`
`introspector`
the default Velocity introspector
`protected org.slf4j.Logger`
`log`
Our runtime logger.
`protected RuntimeServices`
`rsvc`
runtime services

## Constructor Summary

Constructors
Constructor
Description
`UberspectImpl()`

## Method Summary

Modifier and Type
Method
Description
`TypeConversionHandler`
`getConversionHandler()`
`Iterator`
`getIterator(Object obj, Info i)`
To support iterative objects used in a `#foreach()` loop.
`VelMethod`
`getMethod(Object obj, String methodName, Object[] args, Info i)`
Method
`VelPropertyGet`
`getPropertyGet(Object obj, String identifier, Info i)`
Property getter
`VelPropertySet`
`getPropertySet(Object obj, String identifier, Object arg, Info i)`
Property setter
`void`
`init()`
init - generates the Introspector.
`void`
`setLog(org.slf4j.Logger log)`
Deprecated.
logger is now set by default to the namespace logger "velocity.rendering".
`void`
`setRuntimeServices(RuntimeServices rs)`
sets the runtime services

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

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

## Field Details

### log

protected org.slf4j.Logger log
Our runtime logger.

### introspector

protected Introspector introspector
the default Velocity introspector

### conversionHandler

protected TypeConversionHandler conversionHandler
the conversion handler

### rsvc

protected RuntimeServices rsvc
runtime services

## Constructor Details

### UberspectImpl

public UberspectImpl()

## Method Details

### init

public void init()
init - generates the Introspector. As the setup code makes sure that the log gets set before this is called, we can initialize the Introspector using the log object.

Specified by:
  `init` in interface `Uberspect`

### getConversionHandler

public TypeConversionHandler getConversionHandler()

### setRuntimeServices

public void setRuntimeServices(RuntimeServices rs)
sets the runtime services

Specified by:
  `setRuntimeServices` in interface `RuntimeServicesAware`
Parameters:
  `rs` - runtime services

### setLog

public void setLog(org.slf4j.Logger log)
Deprecated.
logger is now set by default to the namespace logger "velocity.rendering".
Sets the runtime logger - this must be called before anything else.

Parameters:
  `log` - The logger instance to use.
Since:
  1.5

### getIterator

public Iterator getIterator(Object obj, Info i)
To support iterative objects used in a `#foreach()` loop.

Specified by:
  `getIterator` in interface `Uberspect`
Parameters:
  `obj` - The iterative object.
  `i` - Info about the object's location.
Returns:
  An `Iterator` object.

### getMethod

public VelMethod getMethod(Object obj, String methodName, Object[] args, Info i)
Method

Specified by:
  `getMethod` in interface `Uberspect`
Parameters:
  `obj` -
  `methodName` -
  `args` -
  `i` -
Returns:
  A Velocity Method.

### getPropertyGet

public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i)
Property getter

Specified by:
  `getPropertyGet` in interface `Uberspect`
Parameters:
  `obj` -
  `identifier` -
  `i` -
Returns:
  A Velocity Getter Method.

### getPropertySet

public VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info i)
Property setter

Specified by:
  `getPropertySet` in interface `Uberspect`
Parameters:
  `obj` -
  `identifier` -
  `arg` -
  `i` -
Returns:
  A Velocity Setter method.