Class UberspectPublicFields
- java.lang.Object
-
- org.apache.velocity.util.introspection.UberspectPublicFields
-
- All Implemented Interfaces:
Uberspect,RuntimeServicesAware
public class UberspectPublicFields extends java.lang.Object implements Uberspect, RuntimeServicesAware
Implementation of Uberspect to additionally provide access to public fields.
-
-
Field Summary
Fields Modifier and Type Field Description protected Introspectorintrospectorthe default Velocity introspectorprotected org.slf4j.LoggerlogOur runtime logger.
-
Constructor Summary
Constructors Constructor Description UberspectPublicFields()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.IteratorgetIterator(java.lang.Object obj, Info info)To support iteratives - #foreach()VelMethodgetMethod(java.lang.Object obj, java.lang.String method, java.lang.Object[] args, Info info)Returns a general method, corresponding to $foo.bar( $woogie )VelPropertyGetgetPropertyGet(java.lang.Object obj, java.lang.String identifier, Info i)Property getterVelPropertySetgetPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info i)Property settervoidinit()init - generates the Introspector.voidsetRuntimeServices(RuntimeServices rs)Called automatically when event cartridge is initialized.
-
-
-
Field Detail
-
log
protected org.slf4j.Logger 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.
-
getPropertyGet
public VelPropertyGet getPropertyGet(java.lang.Object obj, java.lang.String identifier, Info i)
Property getter- Specified by:
getPropertyGetin interfaceUberspect- Parameters:
obj-identifier-i-- Returns:
- A Velocity Getter Method.
-
getPropertySet
public VelPropertySet getPropertySet(java.lang.Object obj, java.lang.String identifier, java.lang.Object arg, Info i)
Property setter- Specified by:
getPropertySetin interfaceUberspect- Parameters:
obj-identifier-arg-i-- Returns:
- A Velocity Setter method.
-
getIterator
public java.util.Iterator getIterator(java.lang.Object obj, Info info)Description copied from interface:UberspectTo support iteratives - #foreach()- Specified by:
getIteratorin interfaceUberspect- Parameters:
obj-info-- Returns:
- iterator
-
getMethod
public VelMethod getMethod(java.lang.Object obj, java.lang.String method, java.lang.Object[] args, Info info)
Description copied from interface:UberspectReturns a general method, corresponding to $foo.bar( $woogie )
-
setRuntimeServices
public void setRuntimeServices(RuntimeServices rs)
Description copied from interface:RuntimeServicesAwareCalled automatically when event cartridge is initialized.- Specified by:
setRuntimeServicesin interfaceRuntimeServicesAware- Parameters:
rs- RuntimeServices object assigned during initialization
-
-