Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class Echo

extends Task
Class Inheritance
Imports
java.io.File, .IOException, org.apache.tools.ant.BuildException, .Project, .Task, org.apache.tools.ant.types.LogLevel, .Resource, org.apache.tools.ant.types.resources.FileProvider, .FileResource, .LogOutputResource, .StringResource, org.apache.tools.ant.util.ResourceUtils

Writes a message to the Ant logging facilities.
Since
Ant 1.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Echo.EchoLevel

The enumerated values for the level attribute.

Field Summary

Modifier and TypeField and Description
protected boolean
private String
encoding

encoding; set to null or empty means 'default'

protected File
private boolean
protected int
protected String
private Resource
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
Echo()

Method Summary

Modifier and TypeMethod and Description
public void
addText(String
the CDATA text to append to the output text
msg
)

Set a multiline message.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Does the work.
public void
setAppend(boolean
if true, append to existing file, default is false.
append
)

If true, append to existing file.

public void
setEncoding(String
the character encoding to use.
encoding
)

Declare the encoding to use when outputting to a file; Use "" for the platform's default encoding.

public void
setFile(File
the file to write to, if not set, echo to standard output
file
)

File to write to.

public void
setForce(boolean
boolean
f
)

Whether read-only destinations will be overwritten.

public void
setLevel(Echo.EchoLevel
the logging level
echoLevel
)

Set the logging level.

public void
setMessage(String
Sets the value for the message variable.
msg
)

Message to write.

public void
setOutput(Resource
the Resource to write to.
output
)

Resource to write to.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

appendback to summary
protected boolean append
encodingback to summary
private String encoding

encoding; set to null or empty means 'default'

fileback to summary
protected File file
forceback to summary
private boolean force
logLevelback to summary
protected int logLevel
messageback to summary
protected String message
outputback to summary
private Resource output

Constructor Detail

Echoback to summary
public Echo()

Method Detail

addTextback to summary
public void addText(String msg)

Set a multiline message.

Parameters
msg:String

the CDATA text to append to the output text

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Does the work.

Exceptions
BuildException:
if something goes wrong with the build
setAppendback to summary
public void setAppend(boolean append)

If true, append to existing file.

Parameters
append:boolean

if true, append to existing file, default is false.

setEncodingback to summary
public void setEncoding(String encoding)

Declare the encoding to use when outputting to a file; Use "" for the platform's default encoding.

Parameters
encoding:String

the character encoding to use.

Since
1.7
setFileback to summary
public void setFile(File file)

File to write to.

Parameters
file:File

the file to write to, if not set, echo to standard output

setForceback to summary
public void setForce(boolean f)

Whether read-only destinations will be overwritten.

Defaults to false

Parameters
f:boolean

boolean

Since
Ant 1.8.2
setLevelback to summary
public void setLevel(Echo.EchoLevel echoLevel)

Set the logging level. Level should be one of

  • error
  • warning
  • info
  • verbose
  • debug

The default is "warning" to ensure that messages are displayed by default when using the -quiet command line option.

Parameters
echoLevel:Echo.EchoLevel

the logging level

setMessageback to summary
public void setMessage(String msg)

Message to write.

Parameters
msg:String

Sets the value for the message variable.

setOutputback to summary
public void setOutput(Resource output)

Resource to write to.

Parameters
output:Resource

the Resource to write to.

Since
Ant 1.8
org.apache.tools.ant.taskdefs back to summary

public Class Echo.EchoLevel

extends LogLevel
Class Inheritance

The enumerated values for the level attribute.

Field Summary

Inherited from org.apache.tools.ant.types.LogLevel:
DEBUGERRINFOVERBOSEWARN

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.apache.tools.ant.types.LogLevel:
getLevelgetValues

Constructor Detail

EchoLevelback to summary
public EchoLevel()