|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.dataxslt.FastStreamReplacer
public class FastStreamReplacer
Search and Replace a set of substrings with another substrings.
This class is a single-pass fast no wildcards replacer for a given set of substrings.
It is primarily designed for mail merge document personalization routines, where a small number of substrings have to be replaced at a master document with data retrieved from a list or database.
| Constructor Summary | |
|---|---|
FastStreamReplacer()
|
|
FastStreamReplacer(int iBufferSize)
|
|
| Method Summary | |
|---|---|
static java.util.HashMap |
createMap(java.lang.String[] aKeys,
java.lang.String[] aValues)
Create a HashMap for a couple of String Arrays This method is just a convenient shortcut for creating input HashMap for replace methods from this class |
int |
lastReplacements()
Number of replacements done in last call to replace() method. |
java.lang.String |
replace(java.io.InputStream oFileInStream,
java.util.HashMap oMap)
Replace subtrings from a Stream. |
java.lang.String |
replace(java.lang.StringBuffer oStrBuff,
java.util.HashMap oMap)
Replace subtrings from a Stream. |
java.lang.String |
replace(java.lang.String sFilePath,
java.util.HashMap oMap)
Replace substrings from a Text File. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastStreamReplacer()
public FastStreamReplacer(int iBufferSize)
| Method Detail |
|---|
public java.lang.String replace(java.io.InputStream oFileInStream,
java.util.HashMap oMap)
throws java.io.IOException
oInStream - Input Stream containing substrings to be replaced.oMap - Map with values to be replaced.java.io.IOException
public java.lang.String replace(java.lang.StringBuffer oStrBuff,
java.util.HashMap oMap)
throws java.io.IOException,
java.lang.IndexOutOfBoundsException
oInStream - Input Stream containing substrings to be replaced.oMap - Map with values to be replaced.java.io.IOException
java.lang.IndexOutOfBoundsException
public java.lang.String replace(java.lang.String sFilePath,
java.util.HashMap oMap)
throws java.io.IOException
sFilePath - File containing text to be replaced.oMap - Map with values to be replaced.java.io.IOExceptionpublic int lastReplacements()
public static java.util.HashMap createMap(java.lang.String[] aKeys,
java.lang.String[] aValues)
throws java.lang.ArrayIndexOutOfBoundsException
Create a HashMap for a couple of String Arrays
This method is just a convenient shortcut for creating input HashMap for replace methods from this class
aKeys - An array of Strings to be used as keysaValues - An array of Strings that will be the actual values for the keys
java.lang.ArrayIndexOutOfBoundsException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||