public abstract class AbstractGetProjectPathTask extends AbstractProjectBasedTask
Abstract base class for all tasks that resolve pathes from an eclipse project.
Constructor and Description |
---|
AbstractGetProjectPathTask() |
Modifier and Type | Method and Description |
---|---|
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.
|
ensureJavaProject, getEclipseProject, getWorkspace, hasText, isProjectNameSet, isProjectSet, isWorkspaceSet, requireWorkspaceAndProjectNameOrProjectSet, requireWorkspaceSet, setInitialiseWorkspace, setProject, setProjectName, setWorkspace
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.
id
- the path IDpublic final java.lang.String getPathId()
Returns the path ID for this task.
protected final boolean isPathIdSet()
Returns true if the path ID has been set.
public final boolean isRelative()
Returns whether or not the path should be resolved relative to the workspace.
true
if the path should be resolved relative to the workspace.public final void setRelative(boolean relative)
Sets whether the path should be resolved relative to the workspace.
relative
- whether the path should be resolved relative to the workspace.public final void setProperty(java.lang.String property)
Sets the name of the property that should hold the resolved path.
property
- the name of the property that should hold the resolved path.public final java.lang.String getProperty()
Returns the name of the property that should hold the resolved path.
protected final boolean isPropertySet()
Returns true if the name of the property has been set.
true
if the name of the property has been set.public final java.lang.String getPathSeparator()
Returns the path separator.
public final void setPathSeparator(java.lang.String pathSeparator)
Sets the path separator.
pathSeparator
- the path separator.protected final boolean isPathSeparatorSet()
Returns true
if the path separator has been set.
true
if the path separator has been set.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.
protected final ResolvedPathEntry[] getResolvedPath()
Returns the a list of resolved pathes.
protected final void setResolvedPath(ResolvedPathEntry[] resolvedPath)
Sets the resolved path entries.
resolvedPath
- the resolved path entries.public void execute() throws BuildException
BuildException
protected void populateProperty()
Populates the property if specified.
protected void populatePathId()
Populates the path id if specified.
protected abstract ResolvedPathEntry[] resolvePath() throws java.lang.Exception
Resolves the current path.
java.lang.Exception
- The resolving process failed for some reason.