Exemplo n.º 1
0
 @Override
 public List<Book> getAllBooks() {
   List<Book> rval = new ArrayList<Book>();
   try {
     Document doc = __wrapper.getDocument();
     List<Map<String, String>> allBooks = __wrapper.getAllEntries(doc);
     for (Map<String, String> map : allBooks) {
       Book book =
           new Book(
               map.get("isbn"),
               map.get("publisher"),
               map.get("title"),
               Integer.parseInt(map.get("year")),
               map.get("authorIds"));
       rval.add(book);
     }
   } catch (Exception e) {
     e.printStackTrace();
     return new ArrayList<Book>();
   }
   return rval;
 }