Class JaxbDatabase

java.lang.Object
edu.pdx.cs410J.di.JaxbDatabase
Direct Known Subclasses:
BookDatabase, CreditCardDatabase

public abstract class JaxbDatabase extends Object
The superclass of classes that store objects serialized to a file using JAXB
  • Constructor Details

  • Method Details

    • writeXml

      protected void writeXml(Object xml)
      Writes an object as XML to the data file
      Parameters:
      xml - The object to marshal
    • getDatabaseFile

    • readFile

      protected Object readFile() throws jakarta.xml.bind.JAXBException
      Read the XML data file and returns the unmarshalled object
      Returns:
      The object in the XML file or null if the file doesn't exist
      Throws:
      jakarta.xml.bind.JAXBException - if we can't read the file