terp - the ANT Tasks
v1.3.304

com.codemesh.terp.ant
Class PrefixTemplateFilter

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.codemesh.terp.ant.PrefixTemplateFilter
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable, org.apache.tools.ant.filters.ChainableReader, org.apache.tools.ant.types.Parameterizable
Direct Known Subclasses:
CopyrightFilter

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

A filter that prefixes a customizable template to a file.


Field Summary
static java.lang.String FILE_KEY
           
static java.lang.String TEMPLATE_KEY
           
protected  int theCurrentPos
           
protected  java.lang.String theExpandedText
           
protected  int theLength
           
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
PrefixTemplateFilter()
           
PrefixTemplateFilter(java.io.Reader in)
          Creates a new filtered reader.
 
Method Summary
 java.io.Reader chain(java.io.Reader rdr)
           
protected  void expand()
           
 java.lang.String getFile()
           
 java.lang.String getTemplate()
           
protected  void initialize()
          Scans the parameters list for the "template" parameter and uses it to set the template that will be prefixed in expanded form.
 int read()
           
 void setFile(java.lang.String file)
          Sets the file that is to be expanded and prefixed.
 void setTemplate(java.lang.String template)
          Sets the template that is to be expanded and prefixed.
 
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
 

Field Detail

TEMPLATE_KEY

public static final java.lang.String TEMPLATE_KEY
See Also:
Constant Field Values

FILE_KEY

public static final java.lang.String FILE_KEY
See Also:
Constant Field Values

theExpandedText

protected java.lang.String theExpandedText

theCurrentPos

protected int theCurrentPos

theLength

protected int theLength
Constructor Detail

PrefixTemplateFilter

public PrefixTemplateFilter()

PrefixTemplateFilter

public PrefixTemplateFilter(java.io.Reader in)
Creates a new filtered reader.

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

setTemplate

public void setTemplate(java.lang.String template)
Sets the template that is to be expanded and prefixed.

Parameters:
template - the template string to be used.

getTemplate

public java.lang.String getTemplate()

setFile

public void setFile(java.lang.String file)
Sets the file that is to be expanded and prefixed.

Parameters:
file - the template string to be used.

getFile

public java.lang.String getFile()

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.FilterReader
Throws:
java.io.IOException

chain

public java.io.Reader chain(java.io.Reader rdr)
Specified by:
chain in interface org.apache.tools.ant.filters.ChainableReader

expand

protected void expand()

initialize

protected void initialize()
Scans the parameters list for the "template" parameter and uses it to set the template that will be prefixed in expanded form.


terp - the ANT Tasks
v1.3.304

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.