Package br.com.caelum.tubaina.parser

Examples of br.com.caelum.tubaina.parser.TubainaModule


  public TubainaBuilder(ParseType type) {
    this.parseType = type;
  }

  public void build() throws IOException {
    TubainaModule module = parseType.getModule(data);
    SectionsManager sectionsManager = module.getSectionsManager();
    List<AfcFile> introductionAfcFiles = new ArrayList<AfcFile>();
    ResourceLocator.initialize(inputDir);
    List<AfcFile> afcFiles = getAfcsFrom(inputDir);
    File introductionChapterDirs = new File(inputDir, "introduction");
    if (introductionChapterDirs.exists()) {
      introductionAfcFiles = getAfcsFrom(introductionChapterDirs);
    }
    BookBuilder builder = new BookBuilder(bookName, sectionsManager);
    builder.addAllReaders(afcFiles, introductionAfcFiles);

    Book b = null;
    try {
      b = builder.build();
    } catch (TubainaException e) {
      if (dontCare) {
        LOG.warn(e);
      } else {
        throw e;
      }
    }
    module.inject(b);

    File file = new File(outputDir, parseType.getType());
    FileUtils.forceMkdir(file);
    File bibliographyFile = new File(inputDir, "bib.xml");
    if (bibliographyFile.exists()) {
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.parser.TubainaModule

Copyright © 2018 www.massapicom. 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.