Class ChildBlocksBuilder


  • public class ChildBlocksBuilder
    extends java.lang.Object
    Re-usable builder that can be used to generate paragraph and list item text from a string containing all the content and wiki formatting. This class is intentionally stateful, but cheap to create, so create one as needed and keep it on the stack to preserve stateless behaviour in the caller.
    Since:
    1.1
    Version:
    $Id$
    • Field Detail

      • insideBold

        private boolean insideBold
      • insideItalic

        private boolean insideItalic
      • insideLink

        private boolean insideLink
      • insideLinethrough

        private boolean insideLinethrough
      • insideUnderline

        private boolean insideUnderline
      • insideSub

        private boolean insideSub
      • insideSup

        private boolean insideSup
      • blocks

        private java.util.List<Block> blocks
      • text

        private java.lang.StringBuilder text
      • input

        private java.lang.String input
      • insideMonospaced

        private boolean insideMonospaced
    • Constructor Detail

      • ChildBlocksBuilder

        public ChildBlocksBuilder​(java.lang.String input)

        Constructor for ChildBlocksBuilder.

        Parameters:
        input - the input.
    • Method Detail

      • getBlocks

        public java.util.List<Block> getBlocks()
        Utility method to convert marked up content into blocks for rendering.
        Returns:
        a list of Blocks that can be used to render it
      • getList

        private java.util.List<Block> getList​(Block block,
                                              java.util.List<Block> currentBlocks)
      • getChildren

        private java.util.List<Block> getChildren​(java.lang.StringBuilder buffer,
                                                  java.util.List<Block> currentBlocks)
      • nextChar

        private static char nextChar​(java.lang.String input,
                                     int i)
      • addTextBlockIfNecessary

        private java.lang.StringBuilder addTextBlockIfNecessary​(java.util.List<Block> blcks,
                                                                java.util.List<Block> specialBlocks,
                                                                java.lang.StringBuilder txt)