All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jdt.core.IClasspathContainer Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2000, 2010 IBM Corporation and others.
 * 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.core;

import org.eclipse.core.runtime.IPath;

/**
 * Interface of a classpath container.
 * A classpath container provides a way to indirectly reference a set of classpath entries through
 * a classpath entry of kind CPE_CONTAINER. Typically, a classpath container can
 * be used to describe a complex library composed of multiple JARs or projects, considering also
 * that containers can map to different set of entries on each project, in other words, several
 * projects can reference the same generic container path, but have each of them actually bound
 * to a different container object.
 * 

* The set of entries associated with a classpath container may contain any of the following: *

    *
  • library entries (CPE_LIBRARY)
  • *
  • project entries (CPE_PROJECT)
  • *
* In particular, a classpath container can neither reference further classpath containers or classpath variables. *

* A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If the * container wants such referenced entries to be part of the classpath, the container must explicitly add them to the * array returned from {@link #getClasspathEntries()}. *

* Classpath container values are persisted locally to the workspace, but are not preserved from a * session to another. It is thus highly recommended to register a ClasspathContainerInitializer * for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer"). *

* @see IClasspathEntry * @since 2.0 */ public interface IClasspathContainer { /** * Kind for a container mapping to an application library */ int K_APPLICATION = 1; /** * Kind for a container mapping to a system library */ int K_SYSTEM = 2; /** * Kind for a container mapping to a default system library, implicitly contributed by the runtime */ int K_DEFAULT_SYSTEM = 3; /** * Answers the set of classpath entries this container is mapping to. *

* The set of entries associated with a classpath container may contain any of the following: *

    *
  • library entries (CPE_LIBRARY)
  • *
  • project entries (CPE_PROJECT)
  • *
* A classpath container can neither reference further classpath containers * or classpath variables. *

* A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If * the container wants such referenced entries to be part of the classpath, the container must explicitly add them * to the result. *

* This method is called by the Java model when it needs to resolve this * classpath container entry into a list of library and project entries. * The method is typically called exactly once for a given Java project, * and the resulting list of entries cached internally by the Java model. * This method must not be called by other clients. *

* There are a wide variety of conditions under which this method may be * invoked. To ensure that the implementation does not interfere with * correct functioning of the Java model, the implementation should use * only the following Java model APIs: *

    *
  • {@link JavaCore#newLibraryEntry(IPath, IPath, IPath, boolean)} and variants
  • *
  • {@link JavaCore#newProjectEntry(IPath, boolean)} and variants
  • *
  • {@link JavaCore#create(org.eclipse.core.resources.IWorkspaceRoot)}
  • *
  • {@link JavaCore#create(org.eclipse.core.resources.IProject)}
  • *
  • {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} with null as project
  • *
  • {@link IJavaModel#getJavaProjects()}
  • *
  • {@link IJavaProject#getRawClasspath()}
  • *
  • {@link IJavaProject#readRawClasspath()}
  • *
  • {@link IJavaProject#getOutputLocation()}
  • *
  • {@link IJavaProject#readOutputLocation()}
  • *
  • Java element operations marked as "handle-only"
  • *
* The effects of using other Java model APIs are unspecified. *

* * @return IClasspathEntry[] - the classpath entries this container represents * @see IClasspathEntry */ IClasspathEntry[] getClasspathEntries(); /** * Answers a readable description of this container * * @return String - a string description of the container */ String getDescription(); /** * Answers the kind of this container. Can be either: *
    *
  • K_APPLICATION if this container maps to an application library
  • *
  • K_SYSTEM if this container maps to a system library
  • *
  • K_DEFAULT_SYSTEM if this container maps to a default system library (library * implicitly contributed by the runtime).
  • *
* Typically, system containers should be placed first on a build path. * @return the kind of this container */ int getKind(); /** * Answers the container path identifying this container. * A container path is formed by a first ID segment followed with extra segments, which * can be used as additional hints for resolving to this container. *

* The container ID is also used to identify aClasspathContainerInitializer * registered on the extension point "org.eclipse.jdt.core.classpathContainerInitializer", which can * be invoked if needing to resolve the container before it is explicitly set. *

* @return IPath - the container path that is associated with this container */ IPath getPath(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy