net.sf.ant4eclipse.tools.resolver
Class AbstractClasspathResolver

java.lang.Object
  extended by net.sf.ant4eclipse.tools.resolver.AbstractClasspathResolver
Direct Known Subclasses:
ProjectClasspathResolver, RuntimeClasspathResolver

public abstract class AbstractClasspathResolver
extends java.lang.Object

Abstract base class for classpath resolver.


Constructor Summary
protected AbstractClasspathResolver(TargetPlatform targetPlatform, boolean relative, boolean runtime)
          Creates a new instance of type AbstractClasspathResolver.
protected AbstractClasspathResolver(Workspace workspace, boolean relative, boolean runtime)
          Creates a new instance of type AbstractClasspathResolver.
 
Method Summary
 void addResolvedPathEntries(ResolvedPathEntry[] entries)
           
 void addResolvedPathEntry(ResolvedPathEntry entry)
           
 EclipseProject getCurrentProject()
          Returns the currently used project.
 ResolvedPathEntry[] getResolvedPathEntries()
          Returns a list of resolved path entries.
 TargetPlatform getTargetPlatform()
          Returns the target platform.
 Workspace getWorkspace()
          Returns the workspace.
 boolean hasCurrentProject()
           
 boolean isCurrentProjectRoot()
          Returns true if the currently used project is also the root project.
 boolean isRelative()
          Returns whether the classpath should be resolved relative or absolute.
 boolean isRuntime()
          Returns whether the classpath is a runtime classpath or not.
protected  void resolveAbsoluteResource(java.io.File file)
          Resolves an absolute resource.
protected  void resolveContainer(EclipseClasspathEntry entry)
          Resolves a container references.
protected  void resolveLibrary(EclipseClasspathEntry entry)
          Resolves a library reference.
 void resolveProjectClasspath(EclipseProject project)
          Resolves the classpath for a (java-)project.
protected  void resolveSource(EclipseClasspathEntry entry)
           
protected  void resolveWorkspaceResource(java.lang.String path)
          Modifies the resolved classpath for the resource with the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractClasspathResolver

protected AbstractClasspathResolver(TargetPlatform targetPlatform,
                                    boolean relative,
                                    boolean runtime)
Creates a new instance of type AbstractClasspathResolver.

Parameters:
targetPlatform - the target platform
relative - whether the classpath should be resolved relative or absolute
runtime - whether the classpath is a runtime classpath or not

AbstractClasspathResolver

protected AbstractClasspathResolver(Workspace workspace,
                                    boolean relative,
                                    boolean runtime)
Creates a new instance of type AbstractClasspathResolver.

Parameters:
workspace - the workspace
relative - whether the classpath should be resolved relative or absolute
runtime - whether the classpath is a runtime classpath or not
Method Detail

isRelative

public final boolean isRelative()
Returns whether the classpath should be resolved relative or absolute.

Returns:
whether the classpath should be resolved relative or absolute.

isRuntime

public final boolean isRuntime()
Returns whether the classpath is a runtime classpath or not.

Returns:
whether the classpath is a runtime classpath or not

getTargetPlatform

public final TargetPlatform getTargetPlatform()
Returns the target platform.

Returns:
the target platform.

getWorkspace

public final Workspace getWorkspace()
Returns the workspace.

Returns:
the workspace.

addResolvedPathEntry

public final void addResolvedPathEntry(ResolvedPathEntry entry)
Parameters:
entry -

addResolvedPathEntries

public final void addResolvedPathEntries(ResolvedPathEntry[] entries)
Parameters:
entries -

getResolvedPathEntries

public final ResolvedPathEntry[] getResolvedPathEntries()
Returns a list of resolved path entries.

Returns:
A list of resolved path entries.

isCurrentProjectRoot

public final boolean isCurrentProjectRoot()
Returns true if the currently used project is also the root project.

Returns:
true <=> The currently used project is the root project.

getCurrentProject

public final EclipseProject getCurrentProject()
Returns the currently used project.

Returns:
The currently used project. Maybe null.

hasCurrentProject

public final boolean hasCurrentProject()

resolveProjectClasspath

public final void resolveProjectClasspath(EclipseProject project)
                                   throws FileParserException
Resolves the classpath for a (java-)project.

Parameters:
project - the (java-)project which classpath should be resolved.
Throws:
FileParserException - Parsing failed for some reason.

resolveSource

protected void resolveSource(EclipseClasspathEntry entry)
Parameters:
entry -

resolveContainer

protected final void resolveContainer(EclipseClasspathEntry entry)
                               throws FileParserException
Resolves a container references.

Parameters:
entry - The classpath entry that shall be resolved.
Throws:
FileParserException - Parsing failed for some reason.

resolveLibrary

protected final void resolveLibrary(EclipseClasspathEntry entry)
Resolves a library reference.

Parameters:
entry - the classpath entry that shall be resolved.

resolveWorkspaceResource

protected final void resolveWorkspaceResource(java.lang.String path)
Modifies the resolved classpath for the resource with the specified path. The resource has to reside in the workspace.

Parameters:
path - the path of the resource.

resolveAbsoluteResource

protected final void resolveAbsoluteResource(java.io.File file)
Resolves an absolute resource.

Parameters:
file - The absolute resource.