org.apache.velocity.util.introspection
Class UberspectImpl

java.lang.Object
  extended by org.apache.velocity.util.introspection.UberspectImpl
All Implemented Interfaces:
Uberspect, UberspectLoggable
Direct Known Subclasses:
SecureUberspector

public class UberspectImpl
extends Object
implements Uberspect, UberspectLoggable

Implementation of Uberspect to provide the default introspective functionality of Velocity

Version:
$Id: UberspectImpl.java 463298 2006-10-12 16:10:32Z henning $
Author:
Geir Magnusson Jr., Henning P. Schmiedehausen

Nested Class Summary
static class UberspectImpl.VelGetterImpl
           
static class UberspectImpl.VelMethodImpl
          Implementation of VelMethod
static class UberspectImpl.VelSetterImpl
           
 
Field Summary
protected  Introspector introspector
          the default Velocity introspector
protected  Log log
          Our runtime logger.
 
Constructor Summary
UberspectImpl()
           
 
Method Summary
 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(Log log)
          Sets the runtime logger - this must be called before anything else.
 void setRuntimeLogger(RuntimeLogger runtimeLogger)
          Deprecated. Use setLog(Log log) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Log log
Our runtime logger.


introspector

protected Introspector introspector
the default Velocity introspector

Constructor Detail

UberspectImpl

public UberspectImpl()
Method Detail

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

setLog

public void setLog(Log log)
Sets the runtime logger - this must be called before anything else.

Specified by:
setLog in interface UberspectLoggable
Parameters:
log - The logger instance to use.

setRuntimeLogger

public void setRuntimeLogger(RuntimeLogger runtimeLogger)
Deprecated. Use setLog(Log log) instead.

Specified by:
setRuntimeLogger in interface UberspectLoggable
Parameters:
runtimeLogger -

getIterator

public Iterator getIterator(Object obj,
                            Info i)
                     throws Exception
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.
Throws:
Exception

getMethod

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

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

getPropertyGet

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

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

getPropertySet

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

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


Copyright © 2000-2007 The Apache Software Foundation. All Rights Reserved.