Class VelocityCompoundAccess

java.lang.Object
net.ssehub.easy.instantiation.velocity.VelocityContextItem
net.ssehub.easy.instantiation.velocity.VelocityCompoundAccess

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

  • Constructor Details

    • VelocityCompoundAccess

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

    • addValue

      void addValue(String nestedName, 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 Object getByName(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 Object byName(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 Object value(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.