org.apache.velocity.util.introspection
Class UberspectPublicFields

java.lang.Object
  extended by org.apache.velocity.util.introspection.UberspectPublicFields
All Implemented Interfaces:
Uberspect, UberspectLoggable

public class UberspectPublicFields
extends Object
implements Uberspect, UberspectLoggable

Implementation of Uberspect to additionally provide access to public fields.

Author:
Geir Magnusson Jr., Henning P. Schmiedehausen, Candid Dauth

Field Summary
protected  Introspector introspector
          the default Velocity introspector
protected  Log log
          Our runtime logger.
 
Constructor Summary
UberspectPublicFields()
           
 
Method Summary
 Iterator getIterator(Object obj, Info info)
          To support iteratives - #foreach()
 VelMethod getMethod(Object obj, String method, Object[] args, Info info)
          Returns a general method, corresponding to $foo.bar( $woogie )
 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

UberspectPublicFields

public UberspectPublicFields()
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

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.
Throws:
Exception

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.
Throws:
Exception

getIterator

public Iterator getIterator(Object obj,
                            Info info)
Description copied from interface: Uberspect
To support iteratives - #foreach()

Specified by:
getIterator in interface Uberspect
Returns:
An Iterator.

getMethod

public VelMethod getMethod(Object obj,
                           String method,
                           Object[] args,
                           Info info)
Description copied from interface: Uberspect
Returns a general method, corresponding to $foo.bar( $woogie )

Specified by:
getMethod in interface Uberspect
Returns:
A Velocity Method.


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