Class VelocityCompoundAccess


  • public class VelocityCompoundAccess
    extends VelocityContextItem
    Context which allows retrieval of nested values of a compound via getByName(<slot name>).
    Author:
    El-Sharkawy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.Object> nestedValues  
    • Constructor Summary

      Constructors 
      Constructor Description
      VelocityCompoundAccess​(java.lang.String variableName, java.lang.Object cmpValue)
      Sole constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addValue​(java.lang.String nestedName, java.lang.Object value)
      Adds a nested value of the compound.
      java.lang.Object byName​(java.lang.String slotName)
      Returns the desired member value of the compound.
      java.lang.Object getByName​(java.lang.String slotName)
      Returns the desired member value of the compound.
      java.lang.Object value​(java.lang.String slotName)
      Returns the desired member value of the compound.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nestedValues

        private java.util.Map<java.lang.String,​java.lang.Object> nestedValues
    • Constructor Detail

      • VelocityCompoundAccess

        public VelocityCompoundAccess​(java.lang.String variableName,
                                      java.lang.Object cmpValue)
        Sole constructor for this class.
        Parameters:
        variableName - The name of the compound.
        cmpValue - The compound value of the compound.
    • Method Detail

      • addValue

        void addValue​(java.lang.String nestedName,
                      java.lang.Object value)
        Adds a nested value of the compound.
        Parameters:
        nestedName - The slot name of the compound.
        value - The value, as it shall be accessible via velocity
      • getByName

        public java.lang.Object getByName​(java.lang.String slotName)
        Returns the desired member value of the compound.
        Parameters:
        slotName - The name of the desired slot.
        Returns:
        The value or null if the specified slot does not exist.
      • byName

        public java.lang.Object byName​(java.lang.String slotName)
        Returns the desired member value of the compound.
        Parameters:
        slotName - The name of the desired slot.
        Returns:
        The value or null if the specified slot does not exist.
      • value

        public java.lang.Object value​(java.lang.String slotName)
        Returns the desired member value of the compound.
        Parameters:
        slotName - The name of the desired slot.
        Returns:
        The value or null if the specified slot does not exist.