de.fuberlin.wiwiss.marbles
Class ParamReader

java.lang.Object
  extended by java.io.Reader
      extended by 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

Field Summary
 int linePos
           
 
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
 

Field Detail

linePos

public int linePos
Constructor Detail

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 values
baseReader - The underyling reader
Method Detail

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