/*******************************************************************************
* Copyright (c) 2015 Pivotal, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.launch.util;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.springsource.ide.eclipse.commons.livexp.util.Parser;
public class ProjectNameParser implements Parser<IProject> {
public static final ProjectNameParser INSTANCE = new ProjectNameParser();
private ProjectNameParser() {
}
@Override
public IProject parse(String projectName) {
if (projectName!=null) {
return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
}
return null;
}
}