Class ResponseDataWrapper

java.lang.Object
com.isomorphic.velocity.ResponseDataWrapper
All Implemented Interfaces:
Iterable, Collection, List

public class ResponseDataWrapper extends Object implements List
This class is a wrapper over a DSResponse data object, that enables Velocity code to treat a multi-valued data object (a List or array), as either a list or a single object.
  • Method Details

    • get

      public Object get(String propertyName) throws Exception
      Parameters:
      propertyName - The name of the property to return
      Returns:
      The value of the requested property from the response's data member (if the response's data member is a single object), or from the first entry of the response's data member (if the data member is a List or array of objects). The "data member", must be a Map or Javabean, or a List or array of Maps or Javabeans. Properties are extracted from beans in line with the ordinary Javabeans convention that property "foo" is obtained by calling method getFoo()
      Throws:
      Exception
    • get

      public Object get(Integer index) throws Exception
      Parameters:
      index - The index of the object to return
      Returns:
      The entry of the response's data member indicated by the index. If the response's data member is not a List or an array, an Exception is thrown
      Throws:
      Exception
    • getLast

      public Object getLast() throws Exception
      Returns:
      The last entry of the response's data member, if the data member is a List or array. If the response's data member is not a List or an array, an Exception is thrown
      Throws:
      Exception
    • last

      public Object last() throws Exception
      Returns:
      The last entry of the response's data member, if the data member is a List or array. If the response's data member is not a List or an array, an Exception is thrown
      Throws:
      Exception