Top Description Fields Constructors Methods
org.eclipse.persistence.tools.weaving.jpa

public Class StaticWeaveAntTask

extends Task
Class Inheritance
Imports
org.apache.tools.ant.BuildException, .Task, org.apache.tools.ant.types.Path, org.eclipse.persistence.exceptions.StaticWeaveException, org.eclipse.persistence.logging.AbstractSessionLog, .SessionLog, java.io.File, .FileWriter, .IOException, .Writer, java.net.MalformedURLException, .URL, .URLClassLoader, java.util.ArrayList, .Arrays, .List

Description: This is the static weave ant task definition class that verifies the value of specified attributes and invokes StaticWeaveProcessor to weave classes.

Usage:

Example:
<target name="define.task" description="New task definition for EclipseLink static weaving"/>
  <taskdef name="weave" classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask"/>
</target>
<target name="weaving" description="perform weaving." depends="define.task">
  <weave source= "c:\foo.jar" target = "c:\wovenfoo.jar" persistenceinfo="c:\foo-containing-persistenceinfo.jar">
    <classpath>
      <pathelement path="c:\foo-dependent.jar"/>
    </classpath>
  </weave>
</target>

Field Summary

Modifier and TypeField and Description
private List<Path>
private int
private Writer
private String
private String
private String
private String
Inherited from org.apache.tools.ant.Task:
taskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public
StaticWeaveAntTask()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addClasspath(Path path)

Add the dependent classpath in order to load classes from the specified input jar.

public void
execute()

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

Execute ant task.
private List<String>
getPathElement()

Parse the class path element and store them into vector.

private URL[]
getURLs()

Convert the path element into the URL which further pass into the classloader.

public void
setLog(String logFile)

Set the log file.

public void
setLogLevel(String logLevel)

public void
setPersistenceinfo(String persistenceinfo)

public void
setpersistencexml(String persistenceXMLLocation)

public void
setSource(String source)

Set the input archive to be used to weave.

public void
setTarget(String target)

Set output archive to be used to weave to.

private void
start()

Invoke weaving process.

private void
verifyOptions()

Verify the value of attributes.

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

Field Detail

classPathsback to summary
private List<Path> classPaths
logLevelback to summary
private int logLevel
logWriterback to summary
private Writer logWriter
persistenceinfoback to summary
private String persistenceinfo
persistencexmlback to summary
private String persistencexml
sourceback to summary
private String source
targetback to summary
private String target

Hides org.apache.tools.ant.Task.target.

Constructor Detail

StaticWeaveAntTaskback to summary
public StaticWeaveAntTask()

Default constructor.

Method Detail

addClasspathback to summary
public void addClasspath(Path path)

Add the dependent classpath in order to load classes from the specified input jar.

executeback to summary
public void execute()

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

Execute ant task.

Annotations
@Override
getPathElementback to summary
private List<String> getPathElement()

Parse the class path element and store them into vector.

getURLsback to summary
private URL[] getURLs()

Convert the path element into the URL which further pass into the classloader.

setLogback to summary
public void setLog(String logFile) throws IOException

Set the log file.

setLogLevelback to summary
public void setLogLevel(String logLevel)
setPersistenceinfoback to summary
public void setPersistenceinfo(String persistenceinfo)
setpersistencexmlback to summary
public void setpersistencexml(String persistenceXMLLocation)
setSourceback to summary
public void setSource(String source)

Set the input archive to be used to weave.

setTargetback to summary
public void setTarget(String target)

Set output archive to be used to weave to.

startback to summary
private void start()

Invoke weaving process.

verifyOptionsback to summary
private void verifyOptions() throws BuildException

Verify the value of attributes.