Examples of ChunkSplitter


Examples of br.com.caelum.tubaina.builder.ChunkSplitter

  }

  @Override
  public Chunk createChunk(String options, String content) {
    String title = options.trim();
    List<Chunk> body = new ChunkSplitter(resources, "box").splitChunks(content);
    return new BoxChunk(title, body);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

    this.resources = resources;
  }

  @Override
  protected Chunk createChunk(String options, String content) {
    List<Chunk> cell = new ChunkSplitter(resources, "col").splitChunks(content);
    return new TableColumnChunk(cell);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

  }

  @Override
  public Chunk createChunk(String options, String content) {
    ArrayList<Resource> subResources = new ArrayList<Resource>();
    ChunkSplitter splitter = new ChunkSplitter(subResources, "exercise");
    List<Chunk> chunks = splitter.splitChunks(content);
    if (hasAnswer(subResources))
      resources.add(new ExerciseResource(ExerciseChunk.getExerciseCount()));
    resources.addAll(subResources);
    return new ExerciseChunk(chunks);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

  @Override
  protected Chunk createChunk(String options, String content) {
    int subsectionNumber = sectionsManager.nextSubsection();
    int currentChapter = sectionsManager.getCurrentChapter();
    int currentSection = sectionsManager.getCurrentSection();
    List<Chunk> body = new ChunkSplitter(resources, "subsection", sectionsManager).splitChunks(content);
    return new SubsectionChunk(options, body, subsectionNumber, currentChapter, currentSection);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

    this.resources = resources;
  }
 
  @Override
  protected Chunk createChunk(String options, String content) {
    List<Chunk> rows = new ChunkSplitter(resources, "table").splitChunks(content);
    return new TableChunk(options, rows);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

    this.resources = resources;
  }

  @Override
  public Chunk createChunk(String options, String content) {
    AnswerChunk chunk = new AnswerChunk(new ChunkSplitter(resources, "answer").splitChunks(content));
    resources.add(new AnswerResource(chunk));
    return chunk;
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

    pattern = Pattern.compile("(?m)^\\s*\\*([^\\*])");
    this.resources = resources;
  }

  public Chunk createChunk(final String content) {
    return new ItemChunk(new ChunkSplitter(resources, "item").splitChunks(content));
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

    this.resources = resources;
  }

  @Override
  public Chunk createChunk(String options, String content) {
    ChunkSplitter splitter = new ChunkSplitter(resources, "question");
    List<Chunk> chunks = splitter.splitChunks(content);
    return new QuestionChunk(chunks);
  }
View Full Code Here

Examples of br.com.caelum.tubaina.builder.ChunkSplitter

  @Test
  public void testItemSplittBug() {
    String input = "* Refactoring, Martin Fowler\n\n"
        + "* Effective Java, Joshua Bloch\n\n* Design Patterns, Erich Gamma et al";
    List<Chunk> chunks = new ChunkSplitter(null, "list").splitChunks(input);
    HtmlModule module = new HtmlModule();
    for (Chunk chunk : chunks) {
      module.inject(chunk);
    }
    Assert.assertEquals(3, chunks.size());
View Full Code Here
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.