Class UberspectPublicFields

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

public class UberspectPublicFields extends Object implements Uberspect, RuntimeServicesAware
Implementation of Uberspect to additionally provide access to public fields.
Author:
Geir Magnusson Jr., Henning P. Schmiedehausen, Candid Dauth
  • Field Details

    • log

      protected org.slf4j.Logger log
      Our runtime logger.
    • introspector

      protected Introspector introspector
      the default Velocity introspector
  • Constructor Details

    • UberspectPublicFields

      public UberspectPublicFields()
  • Method Details

    • 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
    • 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.
    • getIterator

      public Iterator getIterator(Object obj, Info info)
      Description copied from interface: Uberspect
      To support iteratives - #foreach()
      Specified by:
      getIterator in interface Uberspect
      Parameters:
      obj -
      info -
      Returns:
      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
      Parameters:
      obj -
      method -
      args -
      info -
      Returns:
      method wrapper
    • setRuntimeServices

      public void setRuntimeServices(RuntimeServices rs)
      Description copied from interface: RuntimeServicesAware
      Called automatically when event cartridge is initialized.
      Specified by:
      setRuntimeServices in interface RuntimeServicesAware
      Parameters:
      rs - RuntimeServices object assigned during initialization