Class JSONInterface


public class JSONInterface extends FWSimInterface<JSONDataContainer>
Interface for JSON data, used for resources. The data is fetched with HTTP GET from a URL (e.g. a web service) or taken from a string, parsed and optionally narrowed down by a path. Settings: url (may contain ${...} tokens), path (names separated by /) and content (JSON string, or the name of a variable holding it).
Author:
Andreas Enders
  • Field Details

    • iURL

      protected String iURL
      URL of the JSON data, may contain tokens
    • iPath

      protected String iPath
      path to the data within the JSON document, names separated by /
    • iContent

      protected String iContent
      JSON string (may contain tokens), or the name of a variable holding it
  • Constructor Details

    • JSONInterface

      protected JSONInterface(String aName, FWSimInterface.INTERFACE_TYPE aInterfaceType, int aPoolSize)
      Creates the interface without element; to be called by subclasses.
      Parameters:
      aName - name of the interface
      aInterfaceType - type of the interface
      aPoolSize - pool size (not used)
    • JSONInterface

      protected JSONInterface(String aName, org.jdom2.Element aInterfaceElement)
      Creates the interface from its element (children url, path, content).
      Parameters:
      aName - name of the interface
      aInterfaceElement - the interface element
    • JSONInterface

      public JSONInterface(String aName, String aURL, String aPath, String aVarName)
      Creates the interface without element.
      Parameters:
      aName - name of the interface
      aURL - URL of the JSON data, may be null
      aPath - path to the data within the JSON document, may be null
      aVarName - JSON string or name of a variable holding it (used if no URL is given)
  • Method Details