org.jasig.portal.io
Class AbstractTokenReplacementFilter
java.lang.Object
java.io.Writer
org.jasig.portal.io.AbstractTokenReplacementFilter
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
- Direct Known Subclasses:
- ChannelTitleIncorporationWiterFilter
public abstract class AbstractTokenReplacementFilter
- extends Writer
Abstract token replacement filter. Wraps a Writer and can replace tokens as described
by the configured prefix and suffix with the value provided by the sub-class for the
parsed token.
- Version:
- $Revision$
- Author:
- Eric Dalquist
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractTokenReplacementFilter
public AbstractTokenReplacementFilter(Writer wrappedWriter,
String prefix,
int maxTokenLength,
String suffix)
- Parameters:
wrappedWriter - Writer to delegate writing to.
replaceToken
protected abstract String replaceToken(String token)
- Called when a token is found and needs to be replaced.
- Parameters:
token - The found token (text between prefix and suffix)
- Returns:
- The string to replace the prefix + token + suffix with.
close
public final void close()
throws IOException
- Specified by:
close in interface Closeable- Specified by:
close in class Writer
- Throws:
IOException
flush
public final void flush()
throws IOException
- Specified by:
flush in interface Flushable- Specified by:
flush in class Writer
- Throws:
IOException
write
public final void write(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
write in class Writer
- Throws:
IOException
write
public final void write(int c)
throws IOException
- Overrides:
write in class Writer
- Throws:
IOException
Copyright © 2010 Jasig. All Rights Reserved.