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:
AbstractChainableUberspector, SecureUberspector

public class UberspectImpl
extends Object
implements Uberspect, UberspectLoggable

Implementation of Uberspect to provide the default introspective functionality of Velocity

Version:
$Id: UberspectImpl.java 998264 2010-09-17 19:13:02Z apetrelli $
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.
 
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.
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.


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