Class XmlMovieDAO

java.lang.Object
edu.kirkwood.dao.impl.XmlMovieDAO
All Implemented Interfaces:
MovieDAO

public class XmlMovieDAO extends Object implements MovieDAO
  • Constructor Details

    • XmlMovieDAO

      public XmlMovieDAO(String apiURL)
  • Method Details

    • search

      public List<MovieSearchResult> search(String title)
      Retrieves all movies from the data source that matches the title
      Specified by:
      search in interface MovieDAO
      Parameters:
      title - The movie title a user is searching for
      Returns:
      A list of movies that matches the search title
    • parseXml

      public OmdbMovieResponse parseXml(String xml) throws jakarta.xml.bind.JAXBException
      Parse an XML file into a list of movies
      Parameters:
      xml - The raw String data
      Returns:
      a List of MovieSearchResult objects
      Throws:
      jakarta.xml.bind.JAXBException