org.codehaus.plexus.util

Class LineOrientedInterpolatingReader


public class LineOrientedInterpolatingReader
extends FilterReader

Author:
jdcasey Created on Feb 3, 2005

Field Summary

private static char
CARRIAGE_RETURN_CHAR
static String
DEFAULT_END_DELIM
static String
DEFAULT_ESCAPE_SEQ
static String
DEFAULT_START_DELIM
private static char
NEWLINE_CHAR
private Map
context
private String
endDelim
private String
escapeSeq
private String
line
private int
lineIdx
private int
minExpressionSize
private PushbackReader
pushbackReader
private Reflector
reflector
private String
startDelim

Constructor Summary

LineOrientedInterpolatingReader(Reader reader, Map context)
LineOrientedInterpolatingReader(Reader reader, Map context, String startDelim, String endDelim)
LineOrientedInterpolatingReader(Reader reader, Map context, String startDelim, String endDelim, String escapeSeq)

Method Summary

private Map
evaluateExpressions(Set expressions)
private String
findAndReplaceUnlessEscaped(String rawLine, String search, String replace)
private int
findDelimiter(String rawLine, String delimiter, int lastPos)
private Set
parseForExpressions(String rawLine)
int
read()
int
read(char[] cbuf, int off, int len)
private void
readAndInterpolateLine()
private String
readLine()
private String
replaceWithInterpolatedValues(String rawLine, Map evaluatedExpressions)
long
skip(long n)

Field Details

CARRIAGE_RETURN_CHAR

private static final char CARRIAGE_RETURN_CHAR
Field Value:
'\r'

DEFAULT_END_DELIM

public static final String DEFAULT_END_DELIM

DEFAULT_ESCAPE_SEQ

public static final String DEFAULT_ESCAPE_SEQ

DEFAULT_START_DELIM

public static final String DEFAULT_START_DELIM

NEWLINE_CHAR

private static final char NEWLINE_CHAR
Field Value:
'\n'

context

private final Map context

endDelim

private final String endDelim

escapeSeq

private final String escapeSeq

line

private String line

lineIdx

private int lineIdx

minExpressionSize

private final int minExpressionSize

pushbackReader

private final PushbackReader pushbackReader

reflector

private final Reflector reflector

startDelim

private final String startDelim

Constructor Details

LineOrientedInterpolatingReader

public LineOrientedInterpolatingReader(Reader reader,
                                       Map context)

LineOrientedInterpolatingReader

public LineOrientedInterpolatingReader(Reader reader,
                                       Map context,
                                       String startDelim,
                                       String endDelim)

LineOrientedInterpolatingReader

public LineOrientedInterpolatingReader(Reader reader,
                                       Map context,
                                       String startDelim,
                                       String endDelim,
                                       String escapeSeq)

Method Details

evaluateExpressions

private Map evaluateExpressions(Set expressions)

findAndReplaceUnlessEscaped

private String findAndReplaceUnlessEscaped(String rawLine,
                                           String search,
                                           String replace)

findDelimiter

private int findDelimiter(String rawLine,
                          String delimiter,
                          int lastPos)

parseForExpressions

private Set parseForExpressions(String rawLine)

read

public int read()
            throws IOException

read

public int read(char[] cbuf,
                int off,
                int len)
            throws IOException

readAndInterpolateLine

private void readAndInterpolateLine()
            throws IOException

readLine

private String readLine()
            throws IOException

replaceWithInterpolatedValues

private String replaceWithInterpolatedValues(String rawLine,
                                             Map evaluatedExpressions)

skip

public long skip(long n)
            throws IOException