foundry-0.9.1

foundry.io
Class InterpolatingBufferedReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.BufferedReader
              |
              +--foundry.io.InterpolatingBufferedReader

public class InterpolatingBufferedReader
extends BufferedReader


Field Summary
private  StringBuffer cache
           
protected static int DEFAULT_BUFFER_SIZE
           
private  String endOfTokenDelimiter
           
private  boolean isStrict
           
private  String startOfTokenDelimiter
           
 
Fields inherited from class java.io.BufferedReader
cb, defaultCharBufferSize, defaultExpectedLineLength, in, INVALIDATED, markedChar, markedSkipLF, nChars, nextChar, readAheadLimit, skipLF, UNMARKED
 
Fields inherited from class java.io.Reader
lock, maxSkipBufferSize, skipBuffer
 
Constructor Summary
InterpolatingBufferedReader(Reader in)
           
InterpolatingBufferedReader(Reader in, int bufferSize)
           
InterpolatingBufferedReader(Reader in, int bufferSize, String startOfTokenDelimiter, String endOfTokenDelimiter, boolean isStrict)
          Creates a new InterpolatingBufferedReader that wraps, buffers and strips comments from the supplied Reader.
 
Method Summary
protected  StringBuffer constructCache()
           
 String getEndOfTokenDelimiter()
           
 String getStartOfTokenDelimiter()
           
 String getValueForToken(String token)
           
 String interpolate(char[] source)
           
 String interpolate(String source)
           
private  LinkedList interpolate0(char[] source)
           
private  LinkedList interpolate0(char[] source, int offset, int length)
           
 boolean isStrict()
           
 int read()
           
 int read(char[] bucket)
           
 int read(char[] bucket, int offset, int readThisMany)
           
 String readLine()
           
private  char[] reallocateBuffer(char[] original, int size)
           
 void setEndOfTokenDelimiter(String end)
           
 void setStartOfTokenDelimiter(String start)
           
 void setStrict(boolean isStrict)
           
 
Methods inherited from class java.io.BufferedReader
, close, ensureOpen, fill, mark, markSupported, read1, readLine, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

startOfTokenDelimiter

private String startOfTokenDelimiter

endOfTokenDelimiter

private String endOfTokenDelimiter

isStrict

private boolean isStrict

cache

private final StringBuffer cache

DEFAULT_BUFFER_SIZE

protected static final int DEFAULT_BUFFER_SIZE
Constructor Detail

InterpolatingBufferedReader

public InterpolatingBufferedReader(Reader in,
                                   int bufferSize,
                                   String startOfTokenDelimiter,
                                   String endOfTokenDelimiter,
                                   boolean isStrict)
Creates a new InterpolatingBufferedReader that wraps, buffers and strips comments from the supplied Reader.
Parameters:
in - the underlying Reader

InterpolatingBufferedReader

public InterpolatingBufferedReader(Reader in)

InterpolatingBufferedReader

public InterpolatingBufferedReader(Reader in,
                                   int bufferSize)
Method Detail

constructCache

protected StringBuffer constructCache()

isStrict

public boolean isStrict()

setStrict

public void setStrict(boolean isStrict)

setStartOfTokenDelimiter

public void setStartOfTokenDelimiter(String start)

getStartOfTokenDelimiter

public String getStartOfTokenDelimiter()

setEndOfTokenDelimiter

public void setEndOfTokenDelimiter(String end)

getEndOfTokenDelimiter

public String getEndOfTokenDelimiter()

read

public int read()
         throws IOException
Overrides:
read in class BufferedReader

read

public int read(char[] bucket)
         throws IOException
Overrides:
read in class Reader

reallocateBuffer

private char[] reallocateBuffer(char[] original,
                                int size)

read

public int read(char[] bucket,
                int offset,
                int readThisMany)
         throws IllegalArgumentException,
                IOException
Overrides:
read in class BufferedReader

readLine

public String readLine()
                throws IOException
Overrides:
readLine in class BufferedReader

interpolate0

private final LinkedList interpolate0(char[] source)
                               throws IOException

interpolate0

private final LinkedList interpolate0(char[] source,
                                      int offset,
                                      int length)
                               throws IOException

interpolate

public String interpolate(char[] source)
                   throws IOException

interpolate

public String interpolate(String source)
                   throws IOException

getValueForToken

public String getValueForToken(String token)
                        throws IOException

foundry-0.9.1

Copyright © 2000 - Laird Jarrett Nelson