Class TargetBundle


  • public class TargetBundle
    extends java.lang.Object
    Describes a single bundle in a target definition. Also used to represent content in the target that is missing or invalid.
    Since:
    3.8
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected BundleInfo fInfo  
      protected boolean fIsFragment  
      protected java.lang.String fSourcePath  
      protected BundleInfo fSourceTarget  
      static int STATUS_FEATURE_DOES_NOT_EXIST
      Status code indicating that this target bundle represents a required feature that is missing from a target definition
      static int STATUS_INVALID_MANIFEST
      Deprecated, for removal: This API element is subject to removal in a future version.
      not used anymore
      static int STATUS_PLUGIN_DOES_NOT_EXIST
      Status code indicating that this target bundle represents a required plug-in that is missing from a target definition
      static int STATUS_VERSION_DOES_NOT_EXIST
      Status code indicating that a required bundle version does not exist (a bundle with the correct symbolic name is present, but the specified version was not found).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TargetBundle()
      Constructs an empty target bundle with no information.
        TargetBundle​(java.io.File bundleLocation)
      Constructs a target bundle for a local bundle.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BundleInfo getBundleInfo()
      Returns a BundleInfo object containing additional information about the bundle this target bundle represents.
      java.lang.String getSourcePath()
      Returns bundle relative path to old-style source folders, or null if not applicable.
      BundleInfo getSourceTarget()
      If this bundle is a source bundle this method returns a bundle info representing the executable bundle that this bundle provides source for.
      IStatus getStatus()
      Returns a status object describing any problems with this target bundle.
      boolean isFragment()
      Returns whether this bundle is a fragment.
      boolean isSourceBundle()
      Returns true if this bundle is a source bundle and false if this bundle is an executable bundle.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • STATUS_PLUGIN_DOES_NOT_EXIST

        public static final int STATUS_PLUGIN_DOES_NOT_EXIST
        Status code indicating that this target bundle represents a required plug-in that is missing from a target definition
        See Also:
        Constant Field Values
      • STATUS_FEATURE_DOES_NOT_EXIST

        public static final int STATUS_FEATURE_DOES_NOT_EXIST
        Status code indicating that this target bundle represents a required feature that is missing from a target definition
        See Also:
        Constant Field Values
      • STATUS_VERSION_DOES_NOT_EXIST

        public static final int STATUS_VERSION_DOES_NOT_EXIST
        Status code indicating that a required bundle version does not exist (a bundle with the correct symbolic name is present, but the specified version was not found).
        See Also:
        Constant Field Values
      • STATUS_INVALID_MANIFEST

        @Deprecated(forRemoval=true)
        public static final int STATUS_INVALID_MANIFEST
        Deprecated, for removal: This API element is subject to removal in a future version.
        not used anymore
        Status code indicating that a bundle's manifest could not be read, or did not exist.
        See Also:
        Constant Field Values
      • fIsFragment

        protected boolean fIsFragment
      • fSourceTarget

        protected BundleInfo fSourceTarget
      • fSourcePath

        protected java.lang.String fSourcePath
    • Constructor Detail

      • TargetBundle

        public TargetBundle​(java.io.File bundleLocation)
                     throws CoreException
        Constructs a target bundle for a local bundle. The bundle may be a directory or an archive file. The manifest of the bundle will be read to collect the additional information.
        Parameters:
        bundleLocation - the location of the bundle (directory or archive) to open
        Throws:
        CoreException - if there is a problem opening the bundle or its manifest
      • TargetBundle

        protected TargetBundle()
        Constructs an empty target bundle with no information.
    • Method Detail

      • getBundleInfo

        public BundleInfo getBundleInfo()
        Returns a BundleInfo object containing additional information about the bundle this target bundle represents. It is not guaranteed that the bundle info will have any fields set. The base implementation of TargetBundle will fill in the location, symbolic name and version if that information was available in the bundle's manifest.
        Returns:
        a bundle info object with information on the bundle this target bundle represents
      • getStatus

        public IStatus getStatus()
        Returns a status object describing any problems with this target bundle. The base implementation of TargetBundle will always return an OK status.
        Returns:
        status of this bundle
      • isSourceBundle

        public boolean isSourceBundle()
        Returns true if this bundle is a source bundle and false if this bundle is an executable bundle.
        Returns:
        whether the resolved bundle is a source bundle
      • getSourceTarget

        public BundleInfo getSourceTarget()
        If this bundle is a source bundle this method returns a bundle info representing the executable bundle that this bundle provides source for. The returned bundle info may not have a symbolic name and version set if this source bundle is an old style source plug-in.
        Returns:
        bundle info representing bundle this bundle provides source for or null
      • isFragment

        public boolean isFragment()
        Returns whether this bundle is a fragment.
        Returns:
        whether this bundle is a fragment
      • getSourcePath

        public java.lang.String getSourcePath()
        Returns bundle relative path to old-style source folders, or null if not applicable.
        Returns:
        bundle relative path to old-style source folders, or null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object