de.fuberlin.wiwiss.marbles
Class ParamReader
java.lang.Object
java.io.Reader
de.fuberlin.wiwiss.marbles.ParamReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
public class ParamReader
- extends java.io.Reader
A Reader
wrapper that supports transparent parameter replacement.
Text contains parameters identified by double hash signs, for example:
<tag xml:lang="##lang##"/>
A corresponding parameter "lang" may then be used to provide a replacement that is
transparently substituted.
- Author:
- Christian Becker
Fields inherited from class java.io.Reader |
lock |
Constructor Summary |
ParamReader(java.util.HashMap<java.lang.String,java.lang.String> parameters,
java.io.BufferedReader baseReader)
Constructs a new ParamReader |
Method Summary |
void |
close()
|
int |
read(char[] cbuf,
int off,
int len)
|
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
linePos
public int linePos
ParamReader
public ParamReader(java.util.HashMap<java.lang.String,java.lang.String> parameters,
java.io.BufferedReader baseReader)
- Constructs a new
ParamReader
- Parameters:
parameters
- A map with parameter names as keys and their replacements as valuesbaseReader
- The underyling reader
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in class java.io.Reader
- Throws:
java.io.IOException
read
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Specified by:
read
in class java.io.Reader
- Throws:
java.io.IOException