net.sf.fikin.ant.types
Class Output

java.lang.Object
  extended by net.sf.fikin.ant.types.Output
All Implemented Interfaces:
Type

public class Output
extends java.lang.Object
implements Type

Implement a genuine output type

Support file or property an output

Provides with ability to specify delimiter strings if enclosing tasks do wish to store records-like data created on Jan 3, 2007

Since:
Version:
$Revision: 1.6 $
Author:
fiykov

Constructor Summary
Output()
           
 
Method Summary
 void check(org.apache.tools.ant.Task task)
          test that any of the members has been set
 java.io.OutputStream getOutputStream(org.apache.tools.ant.Task task)
          get output stream associated with this output tag
 DelimitedPrintWriter getPrintWriter(org.apache.tools.ant.Task task)
          get output writer
 DelimitedBufferedWriter getWriter(org.apache.tools.ant.Task task)
          get writer associated with this output tag
 void setAppend(boolean flg)
          append to the output file
 void setDelimiter(java.lang.String delimiter)
          set records delimiter
 void setFile(java.io.File in)
          set output file
 void setProperty(java.lang.String propertyName)
          set output property name
 void setTrim(boolean flg)
          trim the resulting value before setting it to the property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Output

public Output()
Method Detail

setFile

public void setFile(java.io.File in)
set output file

Parameters:
in - is output file
Ant Task Param Required:
this or property must be given

setProperty

public void setProperty(java.lang.String propertyName)
set output property name

Parameters:
propertyName -
Ant Task Param Required:
this or file must be given

setDelimiter

public void setDelimiter(java.lang.String delimiter)
set records delimiter

typically tasks can use that string to separate lines of data instead of new line

Parameters:
delimiter - to use

by default:

  • single space for property
  • new line for file
Ant Task Param Required:
false

setAppend

public void setAppend(boolean flg)
append to the output file

Parameters:
flg - append to the file or property value if true,

by default it is false

Ant Task Param Required:
false

setTrim

public void setTrim(boolean flg)
trim the resulting value before setting it to the property

by default true

has no meaning for file

Parameters:
flg - trim if set to true
Ant Task Param Required:
false

check

public void check(org.apache.tools.ant.Task task)
           throws org.apache.tools.ant.BuildException
test that any of the members has been set

Specified by:
check in interface Type
Parameters:
task - is enclosing ant task
Throws:
org.apache.tools.ant.BuildException

getWriter

public DelimitedBufferedWriter getWriter(org.apache.tools.ant.Task task)
                                  throws org.apache.tools.ant.BuildException
get writer associated with this output tag

Parameters:
task - is enclosing task
Returns:
writer associated with this output tag
Throws:
org.apache.tools.ant.BuildException

getOutputStream

public java.io.OutputStream getOutputStream(org.apache.tools.ant.Task task)
get output stream associated with this output tag

Parameters:
task - is enclosing task
Returns:
output stream associated with this output tag

getPrintWriter

public DelimitedPrintWriter getPrintWriter(org.apache.tools.ant.Task task)
get output writer

Parameters:
task -
Returns:
print writer


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.