public final class JavaProjectBuilder
extends java.lang.Object
JavaProjectBuilder
provides tools for creating
and / or configuring Java project into the current workspace
instance.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BINARY_PATH
Path to use as binary folder.
|
private static java.lang.String |
CREATE_PROJECT_TASK
Task name for the Java project creation.
|
private org.eclipse.core.runtime.IProgressMonitor |
monitor
Monitor instance used for project creation.
|
private org.eclipse.core.resources.IProject |
project
Target project contribution is made for.
|
static java.lang.String |
SOURCE_PATH
Path to use as source folder.
|
Modifier | Constructor and Description |
---|---|
private |
JavaProjectBuilder(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
build()
Creates the java project.
|
static org.eclipse.core.resources.IProject |
build(java.lang.String name,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates if not exist, and configures the given
project as a valid Java project instance.
|
private org.eclipse.jdt.core.IClasspathEntry[] |
createClasspath(org.eclipse.core.runtime.IPath sourcePath)
Creates and returns an array of valid java class path entry
including the given sourcePath folder.
|
private void |
setNature()
Sets the internal project nature.
|
public static final java.lang.String SOURCE_PATH
private static final java.lang.String BINARY_PATH
private final org.eclipse.core.resources.IProject project
private final org.eclipse.core.runtime.IProgressMonitor monitor
private static final java.lang.String CREATE_PROJECT_TASK
private JavaProjectBuilder(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor)
project
- Target java project to be created.monitor
- Monitor instance used for project creation.private void setNature() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
- If any error occurs while setting project nature.private org.eclipse.jdt.core.IClasspathEntry[] createClasspath(org.eclipse.core.runtime.IPath sourcePath)
sourcePath
- Path of the source folder to integrate into the created entry list.private void build() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
- If any error occurs while creating or configuring project.public static org.eclipse.core.resources.IProject build(java.lang.String name, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
name
- Name of the project to create.monitor
- Monitor instance used for project creation.org.eclipse.core.runtime.CoreException
- If any error occurs during project creation and / or configuration.