org.rproject.ant
Class RSet

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.rproject.ant.RTask
              extended by org.rproject.ant.RSet
All Implemented Interfaces:
java.lang.Cloneable, MessageListener

public class RSet
extends RTask

Ant task that sets a property to contain the result of an R expression. <r-set code="R.home()" property="r.home" />

Author:
Romain Francois

Field Summary
private  java.lang.String code
          Code to be run
private  java.lang.String property
          Name of the property to set
 
Fields inherited from class org.rproject.ant.RTask
buffer, failonerror, failure, loop, project, R
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location
 
Constructor Summary
RSet()
           
 
Method Summary
 void addText(java.lang.String code)
           
 void execute()
          Run the R code, grab the result of the last expression and use the value to set the property
 void setCode(java.lang.String code)
          The R code to execute.
 void setProperty(java.lang.String property)
          The name of the property to set
 
Methods inherited from class org.rproject.ant.RTask
fails, flush, run_, run, send, setFailonerror
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code

private java.lang.String code
Code to be run


property

private java.lang.String property
Name of the property to set

Constructor Detail

RSet

public RSet()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Run the R code, grab the result of the last expression and use the value to set the property

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

setCode

public void setCode(java.lang.String code)
The R code to execute. At the moment, no checking is done to ensure that the result is a character string, it just has to be

Parameters:
code - R expression that must produce a character vector

setProperty

public void setProperty(java.lang.String property)
The name of the property to set

Parameters:
property - the name of the property to set

addText

public void addText(java.lang.String code)
Parameters:
code - set the code to run by reading the content of the tag


Copyright © 2009, Romain Francois francoisromain@free.fr