summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/ioutils/BlockReaders.java
blob: ec8dcfb0bc1b817b852e44eef5ff5a75db9139da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package bjc.utils.ioutils;

import java.io.Reader;

/**
 * Utility methods for constructing instances of {@link BlockReader}
 * 
 * @author bjculkin
 *
 */
public class BlockReaders {
	/**
	 * Create a new simple block reader that works off a regex.
	 * 
	 * @param blockDelim
	 *                The regex that seperates blocks.
	 * 
	 * @param source
	 *                The reader to get blocks from.
	 * 
	 * @return A configured simple reader.
	 */
	public static BlockReader simple(String blockDelim, Reader source) {
		return new SimpleBlockReader(blockDelim, source);
	}
}