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 url)
  • Method Details

    • search

      public List<MovieSearchResult> search(String title)
      Retrieves all movies that match a given title
      Specified by:
      search in interface MovieDAO
      Parameters:
      title - The title of a movie
      Returns:
      A List of Movie objects that match the title
    • parseXml

      public OmdbMovieResponse parseXml(String xml) throws jakarta.xml.bind.JAXBException
      To parse an XML file converting it into a list of Movie objects
      Parameters:
      xml - The raw XML data
      Returns:
      the OmdbMovieResponse object (contains list of movies, total number of movies, and a response string (True or False))
      Throws:
      jakarta.xml.bind.JAXBException