Package br.com.caelum.tubaina

Examples of br.com.caelum.tubaina.Section


        if (sectionTitle != null) {
          sectionTitle = sectionTitle.trim();
        }
        String sectionContent = matcher.group(2);
        if (sectionTitle != null || sectionContent.trim().length() > 0) {
          Section section = new SectionBuilder(sectionTitle, sectionContent, resources).build();
          sections.add(section);
        }
        offset = matcher.end(2);
      }
    }
View Full Code Here


    this.sectionContent = sectionContent;
    this.resources = resources;
  }

  public Section build() {
    return new Section(sectionTitle, new ChunkSplitter(resources, "all").splitChunks(sectionContent));
  }
View Full Code Here

    this.resources = resources;
    this.sectionsManager = sectionsManager;
  }

  public Section build() {
    return new Section(sectionTitle, new ChunkSplitter(resources, "all", sectionsManager).splitChunks(sectionContent));
  }
View Full Code Here

                if (sectionTitle != null) {
                    sectionTitle = sectionTitle.trim();
                }
                String sectionContent = matcher.group(2);
                if (sectionTitle != null || sectionContent.trim().length() > 0) {
                    Section section = new SectionBuilder(sectionTitle, sectionContent, resources, sectionsManager)
                            .build();
                    sections.add(section);
                    increaseSectionCount();
                }
                offset = matcher.end(2);
View Full Code Here

    return tokens.length - 1;
  }

  @Test
  public void testSection() {
    Section section = createSection("este é o texto da seção");
    Book book = new BookBuilder("livro", new SectionsManager()).build();
    new HtmlModule().inject(book);
    new HtmlModule().inject(section);
    String string = sectionToString.generateSection(book, "capitulo", 7, section, 4, 2).toString();
    Assert.assertEquals(1, countOccurrences(string, "class=\"sectionChapter\">(\\s)*capitulo(\\s)*<"));
 
View Full Code Here

    Assert.assertEquals(1, countOccurrences(string, "este &eacute; o texto da se&ccedil;&atilde;o"));
  }

  @Test
  public void testFlatSection() {
    Section section = createSection("este é o texto da seção");
    Book book = new BookBuilder("livro", new SectionsManager()).build();
    new HtmlModule().inject(book);
    new HtmlModule().inject(section);
   
    String string = sectionToString.generateSection(book, "capitulo", 7, section, 4, 2).toString();
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.Section

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.