Class XMLResourceAdapter

All Implemented Interfaces:
FWSimFieldContainer

public class XMLResourceAdapter extends FWSimResourceAdapter<org.jdom2.Element>
Resource adapter for XML files (XMLInterface). The file is registered in the file pool of the interface and its root element is read into a FWSimResourceCache. A file is only read again if its unique id changed.
Author:
Andreas Enders
  • Constructor Details

    • XMLResourceAdapter

      public XMLResourceAdapter(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber)
      Creates the adapter from a resource element of the solution.
      Parameters:
      aResourceElement - the resource element
      aSession - the session
      aOrderNumber - order number of the adapter
    • XMLResourceAdapter

      public XMLResourceAdapter(String aFileName, String aContent, String aComponentName, int aOrderNumber, FWSimSession aFwSimSession, FWSimIOAdapter.FREQUENCE aFrequence, Map<String,String> aKeyMap, String aXPath) throws Exception
      Creates the adapter from the graph panel: creates the XML interface and derives the header variables from the file (see readHeaderList(XMLInterface, Map, FWSimSession)).
      Parameters:
      aFileName - XML file
      aContent - XML content instead of a file, may be null
      aComponentName - name of the adapter and the interface
      aOrderNumber - order number of the adapter
      aFwSimSession - the session
      aFrequence - frequency the data is read with
      aKeyMap - key variables; if empty, the user is asked to select them
      aXPath - XPath expression, not used
      Throws:
      Exception - if the file cannot be read
    • XMLResourceAdapter

      public XMLResourceAdapter(FWSimResourceAdapter<?> aAdapter, XMLInterface aInterface)
      Copy constructor used when the interface is replaced; the key variables are taken over.
      Parameters:
      aAdapter - the adapter to copy
      aInterface - the new interface
  • Method Details