org.schmant.plugin.eclipse.java
Class EclipseJavaProjectCreatorPlugin

java.lang.Object
  extended by org.schmant.plugin.eclipse.java.EclipseJavaProjectCreatorPlugin
All Implemented Interfaces:
Plugin, EclipseProjectCreatorPlugin

public class EclipseJavaProjectCreatorPlugin
extends Object
implements EclipseProjectCreatorPlugin

This EclipseProjectCreatorPlugin knows how to create EclipseJavaProjectImpl objects for Java projects.

Since:
0.8
Author:
Karl Gustafsson
Task_package:
org.schmant.task.base

Field Summary
 
Fields inherited from interface org.schmant.project.eclipse.EclipseProjectCreatorPlugin
ECLIPSE_PROJECT_CREATOR_PLUGIN_NAME
 
Constructor Summary
EclipseJavaProjectCreatorPlugin()
           
 
Method Summary
protected  ClasspathFileParser createClasspathFileParser()
          This is called by the constructor to create a ClasspathFileParser .
protected  Project createEclipseProjectFromProjectInfo(EclipseWorkspace wos, DirectoryView workspaceDir, EclipseWorkspaceSettings settings, EclipseWorkspaceConfiguration parsedSettings, DirectoryView projDir, EclipseProjectInfo pi)
          Create a Project from information parsed from a .project file.
 Project createProject(EclipseWorkspace wos, DirectoryView workspaceDir, EclipseWorkspaceSettings settings, EclipseWorkspaceConfiguration parsedSettings, DirectoryView projectDir)
          Attempt to create a project from the contents of the supplied directory.
protected  ProjectFileParser createProjectFileParser()
          This is called by the constructor to create a ProjectFileParser.
protected  ClasspathFileParser getClasspathFileParser()
           
protected  ProjectFileParser getProjectFileParser()
          Get the .project file parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseJavaProjectCreatorPlugin

public EclipseJavaProjectCreatorPlugin()
Method Detail

createProjectFileParser

protected ProjectFileParser createProjectFileParser()
This is called by the constructor to create a ProjectFileParser. This implementation creates a ProjectFileParserImpl instance. Subclasses may override this method to create some other implementation.

Returns:
A .project file parser.

createClasspathFileParser

protected ClasspathFileParser createClasspathFileParser()
This is called by the constructor to create a ClasspathFileParser . This implementation creates a ClasspathFileParserImpl instance. Subclasses may override this method to create some other implementation.

Returns:
A .classpath file parser.

getProjectFileParser

protected ProjectFileParser getProjectFileParser()
Get the .project file parser.

Returns:
The project file parser.

getClasspathFileParser

protected ClasspathFileParser getClasspathFileParser()

createEclipseProjectFromProjectInfo

protected Project createEclipseProjectFromProjectInfo(EclipseWorkspace wos,
                                                      DirectoryView workspaceDir,
                                                      EclipseWorkspaceSettings settings,
                                                      EclipseWorkspaceConfiguration parsedSettings,
                                                      DirectoryView projDir,
                                                      EclipseProjectInfo pi)
                                               throws IOException
Create a Project from information parsed from a .project file.

This can be overridden by subclasses to introduce new kinds of projects.

Parameters:
wos - The Eclipse workspace. Cannot call any methods on this object (see EclipseWorkspaceInfoCollector.collect(EclipseWorkspace)
projDir - The project directory.
pi - Data parsed from the .project file using this class' ProjectFileParser.
Returns:
The created Project or null if the project should be ignored.
Throws:
IOException

createProject

public Project createProject(EclipseWorkspace wos,
                             DirectoryView workspaceDir,
                             EclipseWorkspaceSettings settings,
                             EclipseWorkspaceConfiguration parsedSettings,
                             DirectoryView projectDir)
Description copied from interface: EclipseProjectCreatorPlugin
Attempt to create a project from the contents of the supplied directory.

Specified by:
createProject in interface EclipseProjectCreatorPlugin
Parameters:
wos - The Eclipse workspace that is being built.
workspaceDir - The workspace's root directory. Not locked when this method is called unless locked by the build script.
settings - Settings for the workspace. This may be null.
parsedSettings - Settings for the workspace parsed from the workspace metadata. User-supplied settings in the settings object (if any) should override these settings.
projectDir - The project directory. Not locked when this method is called unless locked by the build script.
Returns:
A Project if one can be created from the contents in the directory, otherwise null. If null is returned, the info collector will let the next registered project creator plugin try to create a project.