Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 95bb8849996529cfbedbf0668a82422855b59a02 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************************************
 * Copyright (c) 2014 Takari, 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:
 *      Takari, Inc. - initial API and implementation
 *******************************************************************************/

package org.eclipse.m2e.core.internal.launch;



/**
 * @since 1.5
 */
public abstract class ClasspathEntry {
  public String toExternalForm() {
    if(this instanceof ProjectClasspathEntry) {
      return "P/" + ((ProjectClasspathEntry) this).getProject();
    }
    throw new IllegalArgumentException();
  }

  public static ClasspathEntry fromExternalForm(String str) {
    if(str.startsWith("P/")) {
      return new ProjectClasspathEntry(str.substring(2));
    }
    return null;
  }
}

Back to the top