Class UberspectImpl
- java.lang.Object
-
- org.apache.velocity.util.introspection.UberspectImpl
-
- All Implemented Interfaces:
Uberspect
,UberspectLoggable
- Direct Known Subclasses:
AbstractChainableUberspector
,SecureUberspector
public class UberspectImpl extends java.lang.Object implements Uberspect, UberspectLoggable
Implementation of Uberspect to provide the default introspective functionality of Velocity- Version:
- $Id: UberspectImpl.java 898032 2010-01-11 19:51:03Z nbubna $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UberspectImpl.VelGetterImpl
static class
UberspectImpl.VelMethodImpl
Implementation of VelMethodstatic class
UberspectImpl.VelSetterImpl
-
Field Summary
Fields Modifier and Type Field Description protected Introspector
introspector
the default Velocity introspectorprotected Log
log
Our runtime logger.
-
Constructor Summary
Constructors Constructor Description UberspectImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Iterator
getIterator(java.lang.Object obj, Info i)
To support iterative objects used in a#foreach()
loop.VelMethod
getMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object[] args, Info i)
MethodVelPropertyGet
getPropertyGet(java.lang.Object obj, java.lang.String identifier, Info i)
Property getterVelPropertySet
getPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info i)
Property settervoid
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.
-
-
-
Field Detail
-
log
protected Log log
Our runtime logger.
-
introspector
protected Introspector introspector
the default Velocity introspector
-
-
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.
-
setLog
public void setLog(Log log)
Sets the runtime logger - this must be called before anything else.- Specified by:
setLog
in interfaceUberspectLoggable
- Parameters:
log
- The logger instance to use.- Since:
- 1.5
-
setRuntimeLogger
public void setRuntimeLogger(RuntimeLogger runtimeLogger)
Deprecated.Use setLog(Log log) instead.- Specified by:
setRuntimeLogger
in interfaceUberspectLoggable
- Parameters:
runtimeLogger
-
-
getIterator
public java.util.Iterator getIterator(java.lang.Object obj, Info i) throws java.lang.Exception
To support iterative objects used in a#foreach()
loop.- Specified by:
getIterator
in interfaceUberspect
- Parameters:
obj
- The iterative object.i
- Info about the object's location.- Returns:
- An
Iterator
object. - Throws:
java.lang.Exception
-
getMethod
public VelMethod getMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object[] args, Info i) throws java.lang.Exception
Method
-
getPropertyGet
public VelPropertyGet getPropertyGet(java.lang.Object obj, java.lang.String identifier, Info i) throws java.lang.Exception
Property getter- Specified by:
getPropertyGet
in interfaceUberspect
- Parameters:
obj
-identifier
-i
-- Returns:
- A Velocity Getter Method.
- Throws:
java.lang.Exception
-
getPropertySet
public VelPropertySet getPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info i) throws java.lang.Exception
Property setter- Specified by:
getPropertySet
in interfaceUberspect
- Parameters:
obj
-identifier
-arg
-i
-- Returns:
- A Velocity Setter method.
- Throws:
java.lang.Exception
-
-