Java Doc for Java.java in  » Build » ANT » org » apache » tools » ant » taskdefs » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.Task
   org.apache.tools.ant.taskdefs.Java

All known Subclasses:   org.apache.tools.ant.taskdefs.optional.StyleBook,
Java
public class Java extends Task (Code)
Launcher for Java applications. Allows use of the same JVM for the called application thus resulting in much faster operation.
since:
   Ant 1.1


Field Summary
protected  Redirectorredirector
    
protected  RedirectorElementredirectorElement
    

Constructor Summary
public  Java()
    
public  Java(Task owner)
    

Method Summary
public  voidaddAssertions(Assertions asserts)
     Add assertions to enable in this program (if fork=true).
public  voidaddConfiguredRedirector(RedirectorElement redirectorElement)
     Add a RedirectorElement to this task.
public  voidaddEnv(Environment.Variable var)
     Add an environment variable.
public  voidaddSysproperty(Environment.Variable sysp)
     Add a system property.
public  voidaddSyspropertyset(PropertySet sysp)
     Add a set of properties as system properties.
public  voidclearArgs()
     Clear out the arguments to this java task.
public  Commandline.ArgumentcreateArg()
     Add a command-line argument.
public  PathcreateBootclasspath()
     Add a path to the bootclasspath.
public  PathcreateClasspath()
     Add a path to the classpath.
public  Commandline.ArgumentcreateJvmarg()
     Adds a JVM argument.
public  PermissionscreatePermissions()
     Set the permissions for the application run inside the same JVM.
protected  ExecuteWatchdogcreateWatchdog()
     Create the Watchdog to kill a runaway process.
public  voidexecute()
     Do the execution.
public  intexecuteJava()
     Do the execution and return a return code.
public  CommandlineJavagetCommandLine()
     Accessor to the command line.
public  CommandlineJava.SysPropertiesgetSysProperties()
     Get the system properties of the command line.
protected  voidhandleErrorFlush(String output)
     Handle output sent to System.err and flush the stream.
protected  voidhandleErrorOutput(String output)
     Handle output sent to System.err.
protected  voidhandleFlush(String output)
     Pass output sent to System.out to specified output file.
public  inthandleInput(byte[] buffer, int offset, int length)
     Handle an input request by this task.
Parameters:
  buffer - the buffer into which data is to be read.
Parameters:
  offset - the offset into the buffer at which data is stored.
Parameters:
  length - the amount of data to read.
protected  voidhandleOutput(String output)
     Pass output sent to System.out to specified output file.
protected  voidmaybeSetResultPropertyValue(int result)
     Helper method to set result property to the passed in value if appropriate.
protected  voidrun(String classname, Vector args)
     Executes the given classname with the given arguments as if it were a command line application.
public  voidsetAppend(boolean append)
     If true, append output to existing file.
public  voidsetArgs(String s)
     Deprecated: use nested arg instead.
public  voidsetClassname(String s)
     Set the Java class to execute.
public  voidsetClasspath(Path s)
     Set the classpath to be used when running the Java class.
public  voidsetClasspathRef(Reference r)
     Set the classpath to use by reference.
public  voidsetCloneVm(boolean cloneVm)
     If set, system properties will be copied to the cloned VM--as well as the bootclasspath unless you have explicitly specified a bootclaspath.
public  voidsetDir(File d)
     Set the working directory of the process.
public  voidsetError(File error)
     Set the File to which the error stream of the process is redirected.
public  voidsetErrorProperty(String errorProperty)
     Set the property name whose value should be set to the error of the process.
public  voidsetFailonerror(boolean fail)
     If true, then fail if the command exits with a returncode other than zero.
public  voidsetFork(boolean s)
     If true, execute in a new VM.
public  voidsetInput(File input)
     Set the input to use for the task.
public  voidsetInputString(String inputString)
     Set the string to use as input.
public  voidsetJVMVersion(String value)
     Set the JVM version.
public  voidsetJar(File jarfile)
     Set the location of the JAR file to execute.
public  voidsetJvm(String s)
     Set the command used to start the VM (only if forking).
public  voidsetJvmargs(String s)
     Set the command line arguments for the JVM.
public  voidsetLogError(boolean logError)
     Set whether error output of exec is logged.
public  voidsetMaxmemory(String max)
     Corresponds to -mx or -Xmx depending on VM version.
public  voidsetNewenvironment(boolean newenv)
     If true, use a completely new environment.
public  voidsetOutput(File out)
     Set the File to which the output of the process is redirected.
public  voidsetOutputproperty(String outputProp)
     Set the property name whose value should be set to the output of the process.
public  voidsetResultProperty(String resultProperty)
     Set the name of the property in which the return code of the command should be stored.
public  voidsetSpawn(boolean spawn)
     Set whether or not you want the process to be spawned; default is not spawned.
public  voidsetTimeout(Long value)
     Set the timeout in milliseconds after which the process will be killed.
protected  voidsetupRedirector()
     Set up properties on the redirector that we needed to store locally.

Field Detail
redirector
protected Redirector redirector(Code)



redirectorElement
protected RedirectorElement redirectorElement(Code)




Constructor Detail
Java
public Java()(Code)
Normal constructor



Java
public Java(Task owner)(Code)
create a bound task
Parameters:
  owner - owner




Method Detail
addAssertions
public void addAssertions(Assertions asserts)(Code)
Add assertions to enable in this program (if fork=true).
Parameters:
  asserts - assertion set.
since:
   Ant 1.6



addConfiguredRedirector
public void addConfiguredRedirector(RedirectorElement redirectorElement)(Code)
Add a RedirectorElement to this task.
Parameters:
  redirectorElement - RedirectorElement.



addEnv
public void addEnv(Environment.Variable var)(Code)
Add an environment variable.

Will be ignored if we are not forking a new VM.
Parameters:
  var - new environment variable.
since:
   Ant 1.5




addSysproperty
public void addSysproperty(Environment.Variable sysp)(Code)
Add a system property.
Parameters:
  sysp - system property.



addSyspropertyset
public void addSyspropertyset(PropertySet sysp)(Code)
Add a set of properties as system properties.
Parameters:
  sysp - set of properties to add.
since:
   Ant 1.6



clearArgs
public void clearArgs()(Code)
Clear out the arguments to this java task.



createArg
public Commandline.Argument createArg()(Code)
Add a command-line argument. created argument.



createBootclasspath
public Path createBootclasspath()(Code)
Add a path to the bootclasspath.
since:
   Ant 1.6 created bootclasspath.



createClasspath
public Path createClasspath()(Code)
Add a path to the classpath. created classpath.



createJvmarg
public Commandline.Argument createJvmarg()(Code)
Adds a JVM argument. JVM argument created.



createPermissions
public Permissions createPermissions()(Code)
Set the permissions for the application run inside the same JVM.
since:
   Ant 1.6 Permissions.



createWatchdog
protected ExecuteWatchdog createWatchdog() throws BuildException(Code)
Create the Watchdog to kill a runaway process. new watchdog.
throws:
  BuildException - under unknown circumstances.
since:
   Ant 1.5



execute
public void execute() throws BuildException(Code)
Do the execution.
throws:
  BuildException - if failOnError is set to true and the applicationreturns a nonzero result code.



executeJava
public int executeJava() throws BuildException(Code)
Do the execution and return a return code. the return code from the execute java class if it wasexecuted in a separate VM (fork = "yes") or a security manager wasinstalled that prohibits ExitVM (default).
throws:
  BuildException - if required parameters are missing.



getCommandLine
public CommandlineJava getCommandLine()(Code)
Accessor to the command line. the current command line.
since:
   1.6.3



getSysProperties
public CommandlineJava.SysProperties getSysProperties()(Code)
Get the system properties of the command line. the current properties of this java invocation.
since:
   1.6.3



handleErrorFlush
protected void handleErrorFlush(String output)(Code)
Handle output sent to System.err and flush the stream.
Parameters:
  output - string of stderr.
since:
   Ant 1.5.2



handleErrorOutput
protected void handleErrorOutput(String output)(Code)
Handle output sent to System.err.
Parameters:
  output - string of stderr.
since:
   Ant 1.5



handleFlush
protected void handleFlush(String output)(Code)
Pass output sent to System.out to specified output file.
Parameters:
  output - string of output on its way to its handlers.
since:
   Ant 1.5.2



handleInput
public int handleInput(byte[] buffer, int offset, int length) throws IOException(Code)
Handle an input request by this task.
Parameters:
  buffer - the buffer into which data is to be read.
Parameters:
  offset - the offset into the buffer at which data is stored.
Parameters:
  length - the amount of data to read. the number of bytes read.
exception:
  IOException - if the data cannot be read.
since:
   Ant 1.6



handleOutput
protected void handleOutput(String output)(Code)
Pass output sent to System.out to specified output file.
Parameters:
  output - a string of output on its way to the handlers.
since:
   Ant 1.5



maybeSetResultPropertyValue
protected void maybeSetResultPropertyValue(int result)(Code)
Helper method to set result property to the passed in value if appropriate.
Parameters:
  result - the exit code



run
protected void run(String classname, Vector args) throws BuildException(Code)
Executes the given classname with the given arguments as if it were a command line application.
Parameters:
  classname - the name of the class to run.
Parameters:
  args - arguments for the class.
throws:
  BuildException - in case of IOException in the execution.



setAppend
public void setAppend(boolean append)(Code)
If true, append output to existing file.
Parameters:
  append - if true, append output to existing file.
since:
   Ant 1.5



setArgs
public void setArgs(String s)(Code)
Deprecated: use nested arg instead. Set the command line arguments for the class.
Parameters:
  s - arguments.



setClassname
public void setClassname(String s) throws BuildException(Code)
Set the Java class to execute.
Parameters:
  s - the name of the main class.
throws:
  BuildException - if the jar attribute has been set.



setClasspath
public void setClasspath(Path s)(Code)
Set the classpath to be used when running the Java class.
Parameters:
  s - an Ant Path object containing the classpath.



setClasspathRef
public void setClasspathRef(Reference r)(Code)
Set the classpath to use by reference.
Parameters:
  r - a reference to an existing classpath.



setCloneVm
public void setCloneVm(boolean cloneVm)(Code)
If set, system properties will be copied to the cloned VM--as well as the bootclasspath unless you have explicitly specified a bootclaspath.

Doesn't have any effect unless fork is true.


Parameters:
  cloneVm - if true copy system properties.
since:
   Ant 1.7



setDir
public void setDir(File d)(Code)
Set the working directory of the process.
Parameters:
  d - working directory.



setError
public void setError(File error)(Code)
Set the File to which the error stream of the process is redirected.
Parameters:
  error - file getting the error stream.
since:
   Ant 1.6



setErrorProperty
public void setErrorProperty(String errorProperty)(Code)
Set the property name whose value should be set to the error of the process.
Parameters:
  errorProperty - property name.
since:
   Ant 1.6



setFailonerror
public void setFailonerror(boolean fail)(Code)
If true, then fail if the command exits with a returncode other than zero.
Parameters:
  fail - if true fail the build when the command exits with anonzero returncode.



setFork
public void setFork(boolean s)(Code)
If true, execute in a new VM.
Parameters:
  s - do you want to run Java in a new VM.



setInput
public void setInput(File input)(Code)
Set the input to use for the task.
Parameters:
  input - name of the input file.



setInputString
public void setInputString(String inputString)(Code)
Set the string to use as input.
Parameters:
  inputString - the string which is used as the input source.



setJVMVersion
public void setJVMVersion(String value)(Code)
Set the JVM version.
Parameters:
  value - JVM version.



setJar
public void setJar(File jarfile) throws BuildException(Code)
Set the location of the JAR file to execute.
Parameters:
  jarfile - the jarfile to execute.
throws:
  BuildException - if there is also a main class specified.



setJvm
public void setJvm(String s)(Code)
Set the command used to start the VM (only if forking).
Parameters:
  s - command to start the VM.



setJvmargs
public void setJvmargs(String s)(Code)
Set the command line arguments for the JVM.
Parameters:
  s - jvmargs.



setLogError
public void setLogError(boolean logError)(Code)
Set whether error output of exec is logged. This is only useful when output is being redirected and error output is desired in the Ant log.
Parameters:
  logError - get in the ant log the messages coming from stderrin the case that fork = true.



setMaxmemory
public void setMaxmemory(String max)(Code)
Corresponds to -mx or -Xmx depending on VM version.
Parameters:
  max - max memory parameter.



setNewenvironment
public void setNewenvironment(boolean newenv)(Code)
If true, use a completely new environment.

Will be ignored if we are not forking a new VM.
Parameters:
  newenv - if true, use a completely new environment.
since:
   Ant 1.5




setOutput
public void setOutput(File out)(Code)
Set the File to which the output of the process is redirected.
Parameters:
  out - the output File.



setOutputproperty
public void setOutputproperty(String outputProp)(Code)
Set the property name whose value should be set to the output of the process.
Parameters:
  outputProp - property name.



setResultProperty
public void setResultProperty(String resultProperty)(Code)
Set the name of the property in which the return code of the command should be stored. Only of interest if failonerror=false.
Parameters:
  resultProperty - name of property.
since:
   Ant 1.6



setSpawn
public void setSpawn(boolean spawn)(Code)
Set whether or not you want the process to be spawned; default is not spawned.
Parameters:
  spawn - if true you do not want Ant to wait for the end of the process.
since:
   Ant 1.6



setTimeout
public void setTimeout(Long value)(Code)
Set the timeout in milliseconds after which the process will be killed.
Parameters:
  value - timeout in milliseconds.
since:
   Ant 1.5



setupRedirector
protected void setupRedirector()(Code)
Set up properties on the redirector that we needed to store locally.



Fields inherited from org.apache.tools.ant.Task
protected Target target(Code)(Java Doc)
protected String taskName(Code)(Java Doc)
protected String taskType(Code)(Java Doc)
protected RuntimeConfigurable wrapper(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.Task
final public void bindToOwner(Task owner)(Code)(Java Doc)
public void execute() throws BuildException(Code)(Java Doc)
public Target getOwningTarget()(Code)(Java Doc)
public RuntimeConfigurable getRuntimeConfigurableWrapper()(Code)(Java Doc)
public String getTaskName()(Code)(Java Doc)
public String getTaskType()(Code)(Java Doc)
protected RuntimeConfigurable getWrapper()(Code)(Java Doc)
protected void handleErrorFlush(String output)(Code)(Java Doc)
protected void handleErrorOutput(String output)(Code)(Java Doc)
protected void handleFlush(String output)(Code)(Java Doc)
protected int handleInput(byte[] buffer, int offset, int length) throws IOException(Code)(Java Doc)
protected void handleOutput(String output)(Code)(Java Doc)
public void init() throws BuildException(Code)(Java Doc)
final protected boolean isInvalid()(Code)(Java Doc)
public void log(String msg)(Code)(Java Doc)
public void log(String msg, int msgLevel)(Code)(Java Doc)
public void log(Throwable t, int msgLevel)(Code)(Java Doc)
public void log(String msg, Throwable t, int msgLevel)(Code)(Java Doc)
public void maybeConfigure() throws BuildException(Code)(Java Doc)
final public void perform()(Code)(Java Doc)
public void reconfigure()(Code)(Java Doc)
public void setOwningTarget(Target target)(Code)(Java Doc)
public void setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)(Code)(Java Doc)
public void setTaskName(String name)(Code)(Java Doc)
public void setTaskType(String type)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.