Package nl.siegmann.epublib.bookprocessor

Source Code of nl.siegmann.epublib.bookprocessor.FixIdentifierBookProcessor

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;
  }
}
TOP

Related Classes of nl.siegmann.epublib.bookprocessor.FixIdentifierBookProcessor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.