nl.siegmann.epublib.bookprocessor.FixIdentifierBookProcessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of epublib-tools Show documentation
Show all versions of epublib-tools Show documentation
A java library for reading/writing/manipulating epub files
The newest version!
package nl.siegmann.epublib.bookprocessor;
import nl.siegmann.epublib.domain.Book;
import nl.siegmann.epublib.domain.Identifier;
import nl.siegmann.epublib.epub.BookProcessor;
/**
* If the book has no identifier it adds a generated UUID as identifier.
*
* @author paul
*
*/
public class FixIdentifierBookProcessor implements BookProcessor {
@Override
public Book processBook(Book book) {
if(book.getMetadata().getIdentifiers().isEmpty()) {
book.getMetadata().addIdentifier(new Identifier());
}
return book;
}
}