com.petebevin.markdown
Class MarkdownFilter

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by org.apache.tools.ant.filters.BaseFilterReader
              extended by org.apache.tools.ant.filters.BaseParamFilterReader
                  extended by com.petebevin.markdown.MarkdownFilter
All Implemented Interfaces:
Closeable, Readable, org.apache.tools.ant.filters.ChainableReader, org.apache.tools.ant.types.Parameterizable

public class MarkdownFilter
extends org.apache.tools.ant.filters.BaseParamFilterReader
implements org.apache.tools.ant.filters.ChainableReader

Provides a Markdown-based FilterReader suitable for use by Ant.

 <copy file="${src.file}" tofile="${dest.file}">
   <filterchain>
     <filterreader classname="com.petebevin.markdown.MarkdownFilter"/>
   </filterchain>
 </copy>
 

Author:
Marty Lamb

Field Summary
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
MarkdownFilter()
          Constructor for "dummy" instances.
MarkdownFilter(Reader reader)
          Creates a new filtered reader.
 
Method Summary
 Reader chain(Reader reader)
          Creates a new MarkdownFilter using the passed in Reader for instantiation.
 int read()
          Returns the next character in the filtered stream, after performing the Markdown processing
 
Methods inherited from class org.apache.tools.ant.filters.BaseParamFilterReader
getParameters, setParameters
 
Methods inherited from class org.apache.tools.ant.filters.BaseFilterReader
getInitialized, getProject, read, readFully, readLine, setInitialized, setProject, skip
 
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkdownFilter

public MarkdownFilter()
Constructor for "dummy" instances.

See Also:
BaseFilterReader.BaseFilterReader()

MarkdownFilter

public MarkdownFilter(Reader reader)
Creates a new filtered reader.

Parameters:
in - A Reader object providing the underlying stream. Must not be null.
Method Detail

chain

public Reader chain(Reader reader)
Creates a new MarkdownFilter using the passed in Reader for instantiation.

Specified by:
chain in interface org.apache.tools.ant.filters.ChainableReader
Parameters:
rdr - A Reader object providing the underlying stream. Must not be null.
Returns:
a new filter based on this configuration, but filtering the specified reader

read

public final int read()
               throws IOException
Returns the next character in the filtered stream, after performing the Markdown processing

Overrides:
read in class FilterReader
Returns:
the next character in the resulting stream, or -1 if the end of the resulting stream has been reached
Throws:
IOException - if the underlying stream throws an IOException during reading


Copyright © 2011. All Rights Reserved.