|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.codehaus.groovy.ant.Groovy
Executes a series of Groovy statements.
Statements can either be read in from a text file using the src attribute or from between the enclosing groovy tags.
Based heavily on SQLExec.java which is part of apache-ant http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?rev=MAIN Copyright 2000-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
Groovy()
|
Method Summary | |
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files (nested fileset attribute). |
void |
addText(String txt)
Set an inline command to execute. |
org.apache.tools.ant.types.Path |
createClasspath()
Add a path to the classpath for loading. |
protected void |
execGroovy(String txt,
PrintStream out)
Exec the statement. |
void |
execute()
Load the file and then execute it |
org.apache.tools.ant.types.Path |
getClasspath()
Gets the classpath. |
protected static Hashtable |
getLoaderMap()
|
String |
getUserId()
Gets the userId. |
String |
getVersion()
Gets the version. |
protected void |
printResults(PrintStream out)
print any results in the statement. |
protected void |
runStatements(Reader reader,
PrintStream out)
read in lines and execute them |
void |
setAppend(boolean append)
whether output should be appended to or overwrite an existing file. |
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Sets the classpath for loading. |
void |
setClasspathRef(org.apache.tools.ant.types.Reference r)
Set the classpath for loading using the classpath reference. |
void |
setOutput(File output)
Set the output file; optional, defaults to the Ant log. |
void |
setPrint(boolean print)
Print results from the statements; optional, default false |
void |
setSrc(File srcFile)
Set the name of the file to be run. |
void |
setStacktrace(boolean stacktrace)
Enable compiler to report stack trace information if a problem occurs during compilation. |
void |
setUserid(String userId)
Set the user name for the connection; required. |
void |
setVersion(String version)
Sets the version string, execute task only if groovy version match; optional. |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Groovy()
Method Detail |
public void setStacktrace(boolean stacktrace)
stacktrace
- public void setSrc(File srcFile)
public void addText(String txt)
public void addFileset(org.apache.tools.ant.types.FileSet set)
public void setPrint(boolean print)
public void setOutput(File output)
public void setAppend(boolean append)
public void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- The classpath to setpublic org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
public void setVersion(String version)
version
- The version to setprotected static Hashtable getLoaderMap()
public org.apache.tools.ant.types.Path getClasspath()
public String getUserId()
public void setUserid(String userId)
userId
- The userId to setpublic String getVersion()
public void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void runStatements(Reader reader, PrintStream out) throws IOException
IOException
protected void execGroovy(String txt, PrintStream out)
protected void printResults(PrintStream out)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |