Package xal.model.xml

Class ProbeXmlParser

java.lang.Object
xal.model.xml.ProbeXmlParser

public class ProbeXmlParser extends Object
Parses the description of a Probe from an XML file. Returns an instance of the appropriate Probe species. This class simply provides methods for opening an xml document and creating a DataAdaptor for it. It delegates the task of reading the Probe definition and instantiating the Probe to that class.
Version:
$id:
Author:
Craig McChesney
  • Constructor Details

    • ProbeXmlParser

      public ProbeXmlParser()
  • Method Details

    • parse

      public static Probe<?> parse(String fileUri) throws ParsingException
      Parse the XML file specified by the supplied URI. Return a Probe of the appropriate species.
      Parameters:
      fileUri - the URI specifying the XML file to parse
      Returns:
      the Probe object described by the XML file
      Throws:
      ParsingException
    • parseDataAdaptor

      public static Probe<?> parseDataAdaptor(DataAdaptor adaptor) throws ParsingException
      Parse the given data source and build a probe object according to that described. Convenience method calling parseAdaptor(DataAdaptor).
      Parameters:
      adaptor - data source containing probe description
      Returns:
      new probe object with properties specified by the data source
      Throws:
      ParsingException - general formatting error in the data source
      Since:
      Apr 14, 2011
    • parseProbeFile

      public Probe<?> parseProbeFile(String fileUri) throws ParsingException
      Parse the XML file specified by the supplied URI. Return a Probe of the appropriate species.
      Parameters:
      fileUri - the URI specifying the XML file to parse
      Returns:
      the Probe object described by the XML file
      Throws:
      ParsingException
    • parseAdaptor

      public Probe<?> parseAdaptor(DataAdaptor adaptor) throws ParsingException
      Parse the given data source and build a probe object according to that described. Calls method Probe.readFrom(DataAdaptor) to do the actual parsing.
      Parameters:
      adaptor - data source containing probe description
      Returns:
      new probe object with properties specified by the data source
      Throws:
      ParsingException - general formatting error in the data source
      Since:
      Apr 14, 2011