net.sf.ant4eclipse.ant.task.project
Class AbstractGetProjectPathTask

java.lang.Object
  extended by Task
      extended by net.sf.ant4eclipse.ant.task.project.AbstractProjectBasedTask
          extended by net.sf.ant4eclipse.ant.task.project.AbstractGetProjectPathTask
Direct Known Subclasses:
GetEclipseClassPathTask, GetIncludePathTask, GetOutputPathTask, GetSourcePathTask

public abstract class AbstractGetProjectPathTask
extends AbstractProjectBasedTask

Abstract base class for all tasks that resolve pathes from an eclipse project.


Constructor Summary
AbstractGetProjectPathTask()
           
 
Method Summary
 void execute()
          
 java.lang.String getPathId()
           Returns the path ID for this task.
 java.lang.String getPathSeparator()
           Returns the path separator.
 java.lang.String getProperty()
           Returns the name of the property that should hold the resolved path.
protected  ResolvedPathEntry[] getResolvedPath()
           Returns the a list of resolved pathes.
protected  boolean isPathIdSet()
           Returns true if the path ID has been set.
protected  boolean isPathSeparatorSet()
           Returns true if the path separator has been set.
protected  boolean isPropertySet()
           Returns true if the name of the property has been set.
 boolean isRelative()
           Returns whether or not the path should be resolved relative to the workspace.
protected  void populatePathId()
           Populates the path id if specified.
protected  void populateProperty()
           Populates the property if specified.
protected  void requirePathIdOrPropertySet()
           Ensures that either a path id or a property (or both) is set.
protected abstract  ResolvedPathEntry[] resolvePath()
           Resolves the current path.
 void setPathId(java.lang.String id)
           Sets the path ID.
 void setPathSeparator(java.lang.String pathSeparator)
           Sets the path separator.
 void setProperty(java.lang.String property)
           Sets the name of the property that should hold the resolved path.
 void setRelative(boolean relative)
           Sets whether the path should be resolved relative to the workspace.
protected  void setResolvedPath(ResolvedPathEntry[] resolvedPath)
           Sets the resolved path entries.
 
Methods inherited from class net.sf.ant4eclipse.ant.task.project.AbstractProjectBasedTask
ensureJavaProject, getEclipseProject, getWorkspace, hasText, isProjectNameSet, isProjectSet, isWorkspaceSet, requireWorkspaceAndProjectNameOrProjectSet, requireWorkspaceSet, setInitialiseWorkspace, setProject, setProjectName, setWorkspace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGetProjectPathTask

public AbstractGetProjectPathTask()
Method Detail

setPathId

public final void setPathId(java.lang.String id)

Sets the path ID. The resolved path can be references via this ID in the ant build file.

Parameters:
id - the path ID

getPathId

public final java.lang.String getPathId()

Returns the path ID for this task.

Returns:
The path ID for this task.

isPathIdSet

protected final boolean isPathIdSet()

Returns true if the path ID has been set.

Returns:
true <=> The path ID has been set.

isRelative

public final boolean isRelative()

Returns whether or not the path should be resolved relative to the workspace.

Returns:
true if the path should be resolved relative to the workspace.

setRelative

public final void setRelative(boolean relative)

Sets whether the path should be resolved relative to the workspace.

Parameters:
relative - whether the path should be resolved relative to the workspace.

setProperty

public final void setProperty(java.lang.String property)

Sets the name of the property that should hold the resolved path.

Parameters:
property - the name of the property that should hold the resolved path.

getProperty

public final java.lang.String getProperty()

Returns the name of the property that should hold the resolved path.

Returns:
the name of the property that should hold the resolved path.

isPropertySet

protected final boolean isPropertySet()

Returns true if the name of the property has been set.

Returns:
true if the name of the property has been set.

getPathSeparator

public final java.lang.String getPathSeparator()

Returns the path separator.

Returns:
the path separator.

setPathSeparator

public final void setPathSeparator(java.lang.String pathSeparator)

Sets the path separator.

Parameters:
pathSeparator - the path separator.

isPathSeparatorSet

protected final boolean isPathSeparatorSet()

Returns true if the path separator has been set.

Returns:
true if the path separator has been set.

requirePathIdOrPropertySet

protected final void requirePathIdOrPropertySet()

Ensures that either a path id or a property (or both) is set. If none of both is set, a BuildException will be thrown.


getResolvedPath

protected final ResolvedPathEntry[] getResolvedPath()

Returns the a list of resolved pathes.

Returns:
A list of resolved pathes.

setResolvedPath

protected final void setResolvedPath(ResolvedPathEntry[] resolvedPath)

Sets the resolved path entries.

Parameters:
resolvedPath - the resolved path entries.

execute

public void execute()
             throws BuildException

Throws:
BuildException

populateProperty

protected void populateProperty()

Populates the property if specified.


populatePathId

protected void populatePathId()

Populates the path id if specified.


resolvePath

protected abstract ResolvedPathEntry[] resolvePath()
                                            throws java.lang.Exception

Resolves the current path.

Returns:
A list of resolved pathes.
Throws:
java.lang.Exception - The resolving process failed for some reason.