org.glassfish.pfl.basic.tools.file
Class BlockParser

java.lang.Object
  extended by org.glassfish.pfl.basic.tools.file.BlockParser

public class BlockParser
extends java.lang.Object

Utility class used to convert FileWrappers into (lists of) Blocks.


Field Summary
static java.lang.String COMMENT_BLOCK_TAG
           
 
Method Summary
static Block getBlock(FileWrapper fw)
          Return the contents of the text file as a Block.
static java.util.List<Block> parseBlocks(FileWrapper fw, java.lang.String prefix)
          Transform fw into a list of blocks.
static java.util.List<Block> parseBlocks(FileWrapper fw, java.lang.String start, java.lang.String end)
          Transform fw into a list of blocks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENT_BLOCK_TAG

public static final java.lang.String COMMENT_BLOCK_TAG
See Also:
Constant Field Values
Method Detail

getBlock

public static Block getBlock(FileWrapper fw)
                      throws java.io.IOException
Return the contents of the text file as a Block.

Throws:
java.io.IOException

parseBlocks

public static java.util.List<Block> parseBlocks(FileWrapper fw,
                                                java.lang.String prefix)
                                         throws java.io.IOException
Transform fw into a list of blocks. There are two types of blocks in this list, and they always alternate:

parseBlocks

public static java.util.List<Block> parseBlocks(FileWrapper fw,
                                                java.lang.String start,
                                                java.lang.String end)
                                         throws java.io.IOException
Transform fw into a list of blocks. There are two types of blocks in this list, and they always alternate: