Interface ITargetDefinition


public interface ITargetDefinition
Defines a target platform. A target platform is a collection of bundles and features configured for a specific environment.
Since:
3.8
See Also:
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a list of all resolved bundles in this target definition or null.
    Returns the list of feature models available in this target or null if this target has not been resolved.
    Returns the identifier of the architecture this target is configured for, or null to default to the running architecture.
    Returns all bundles included in this target definition or null if this container is not resolved.
    Returns the Document that represents this target, or null if none
    Returns a handle to this target definition.
    Returns the implicit dependencies set on this target or null if none.
    Returns a list of descriptors that filter the resolved plug-ins in this target.
    Returns JRE container path that this target definition should be built against, or null if the workspace default JRE should be used.
    Returns the name of this target, or null if none
    Returns the identifier of the locale this target is configured for, or null for default.
    Returns the identifier of the operating system this target is configured for, possibly null.
    Returns any program arguments that should be used when launching this target or null if none.
    Returns a MultiStatus containing all problems with this target.
    Returns the locations defined by this target, possible null.
    Returns any VM arguments that should be used when launching this target or null if none.
    Returns the identifier of the window system this target is configured for, possibly null.
    boolean
    Returns whether all ITargetLocations in this target currently in a resolved state.
    Resolves all contents of this target definition by resolving each ITargetLocation in this target definition.
    void
    Sets the architecture this target is configured for, or null to default to the running architecture.
    void
    Sets the XML document that stores the state of this target.
    void
    Sets implicit dependencies for this target.
    void
    Sets a list of descriptors to filter the resolved plug-ins in this target.
    void
    setJREContainer(IPath containerPath)
    Sets the JRE that this target definition should be built against, or null to use the workspace default JRE.
    void
    Sets the name of this target.
    void
    Sets the locale this target is configured for or null for default.
    void
    Sets the operating system this target is configured for or null to default to the running operating system.
    void
    Sets any program arguments that should be used when launching this target or null if none.
    void
    Sets the locations in this target definition or null if none.
    void
    Sets any VM arguments that should be used when launching this target or null if none.
    void
    Sets the window system this target is configured for or null to default to the running window system.
  • Method Details

    • resolve

      IStatus resolve(IProgressMonitor monitor)
      Resolves all contents of this target definition by resolving each ITargetLocation in this target definition.

      Returns a MultiStatus containing any non-OK statuses produced when resolving each ITargetLocation. An OK status will be returned if no non-OK statuses are returned from the locations. A CANCEL status will be returned if the monitor is cancelled.

      For more information on how a target resolves, see ITargetLocation.resolve(ITargetDefinition, IProgressMonitor)

      Parameters:
      monitor - progress monitor or null
      Returns:
      resolution multi-status
    • isResolved

      boolean isResolved()
      Returns whether all ITargetLocations in this target currently in a resolved state.
      Returns:
      true if all locations are currently resolved
    • setDocument

      void setDocument(Document document)
      Sets the XML document that stores the state of this target. The document is updated with each setter that has an affect on the target file source.
      Parameters:
      document - xml document or null
      Since:
      3.12
    • getDocument

      Document getDocument()
      Returns the Document that represents this target, or null if none
      Returns:
      document or null
      Since:
      3.12
    • getBundles

      TargetBundle[] getBundles()
      Returns all bundles included in this target definition or null if this container is not resolved. Takes all the bundles available from the set target locations (returned by getAllBundles() and applies the filters (returned by getIncluded()) to determine the final list of bundles in this target.

      Some of the returned bundles may have non-OK statuses. These bundles may be missing some information (location, version, source target). To get a bundle's status call TargetBundle.getStatus(). Calling getStatus() will return all problems in this target definition.

      Returns:
      resolved bundles or null
    • getAllBundles

      TargetBundle[] getAllBundles()
      Returns a list of all resolved bundles in this target definition or null. Does not filter based on any filters (getIncluded(). Returns null if this target has not been resolved. Use getBundles() to get the filtered list of bundles.

      Some of the returned bundles may have non-OK statuses. These bundles may be missing some information (location, version, source target). To get a bundle's status call TargetBundle.getStatus(). Calling getStatus() will return all problems in this target definition.

      Returns:
      collection of resolved bundles or null
    • getAllFeatures

      TargetFeature[] getAllFeatures()
      Returns the list of feature models available in this target or null if this target has not been resolved.
      Returns:
      collection of feature models or null
    • getStatus

      IStatus getStatus()
      Returns a MultiStatus containing all problems with this target. Returns an OK status if there are no problems. Returns null if this target has not been resolved.

      The returned status will include all non-OK statuses returned by resolve(IProgressMonitor) as well as any non-OK statuses found in TargetBundles returned by getBundles(). For more information on the statuses that can be returned see ITargetLocation.getStatus() and TargetBundle.getStatus().

      Returns:
      MultiStatus containing all problems with this target or null
    • getHandle

      ITargetHandle getHandle()
      Returns a handle to this target definition.
      Returns:
      target handle
    • getName

      String getName()
      Returns the name of this target, or null if none
      Returns:
      name or null
    • setName

      void setName(String name)
      Sets the name of this target.
      Parameters:
      name - target name or null
    • getTargetLocations

      ITargetLocation[] getTargetLocations()
      Returns the locations defined by this target, possible null.
      Returns:
      target locations or null
    • setTargetLocations

      void setTargetLocations(ITargetLocation[] containers)
      Sets the locations in this target definition or null if none.
      Parameters:
      containers - target locations or null
    • getIncluded

      NameVersionDescriptor[] getIncluded()
      Returns a list of descriptors that filter the resolved plug-ins in this target. The list may include both plug-ins and features. The returned descriptors will have an id, may have a version and will have either NameVersionDescriptor.TYPE_FEATURE or NameVersionDescriptor.TYPE_PLUGIN as their type. If the target is set to include all units (no filtering is being done), this method will return null.
      Returns:
      list of name version descriptors or null
      See Also:
    • setIncluded

      void setIncluded(NameVersionDescriptor[] included)
      Sets a list of descriptors to filter the resolved plug-ins in this target. The list may include both plug-ins and features. To include all plug-ins in the target, pass null as the argument.

      The descriptions passed to this method must have an ID set. The version may be null to include any version of the matches the ID. Only descriptors with a type of NameVersionDescriptor.TYPE_FEATURE or NameVersionDescriptor.TYPE_PLUGIN will be considered.

      Parameters:
      included - list of descriptors to include in the target or null to include all plug-ins
      See Also:
    • getJREContainer

      IPath getJREContainer()
      Returns JRE container path that this target definition should be built against, or null if the workspace default JRE should be used. JavaRuntime can be used to resolve JRE's and execution environments from a container path.
      Returns:
      JRE container path or null
      See Also:
    • setJREContainer

      void setJREContainer(IPath containerPath)
      Sets the JRE that this target definition should be built against, or null to use the workspace default JRE. JavaRuntime should be used to generate and parse JRE container paths.
      Parameters:
      containerPath - JRE container path
      See Also:
    • getOS

      String getOS()
      Returns the identifier of the operating system this target is configured for, possibly null.
      Returns:
      operating system identifier or null to default to the running operating system
    • setOS

      void setOS(String os)
      Sets the operating system this target is configured for or null to default to the running operating system.
      Parameters:
      os - operating system identifier - one of the operating system constants defined by Constants or null to default to the running operating system
    • getWS

      String getWS()
      Returns the identifier of the window system this target is configured for, possibly null.
      Returns:
      window system identifier - one of the window system constants defined by Constants, or null to default to the running window system
    • setWS

      void setWS(String ws)
      Sets the window system this target is configured for or null to default to the running window system.
      Parameters:
      ws - window system identifier or null to default to the running window system
    • getArch

      String getArch()
      Returns the identifier of the architecture this target is configured for, or null to default to the running architecture.
      Returns:
      architecture identifier - one of the architecture constants defined by Constants or null to default to the running architecture
    • setArch

      void setArch(String arch)
      Sets the architecture this target is configured for, or null to default to the running architecture.
      Parameters:
      arch - architecture identifier or null to default to the running architecture.
    • getNL

      String getNL()
      Returns the identifier of the locale this target is configured for, or null for default.
      Returns:
      locale identifier or null for default
    • setNL

      void setNL(String nl)
      Sets the locale this target is configured for or null for default.
      Parameters:
      nl - locale identifier or null for default
    • getProgramArguments

      String getProgramArguments()
      Returns any program arguments that should be used when launching this target or null if none.
      Returns:
      program arguments or null if none
    • setProgramArguments

      void setProgramArguments(String args)
      Sets any program arguments that should be used when launching this target or null if none.
      Parameters:
      args - program arguments or null
    • getVMArguments

      String getVMArguments()
      Returns any VM arguments that should be used when launching this target or null if none.
      Returns:
      VM arguments or null if none
    • setVMArguments

      void setVMArguments(String args)
      Sets any VM arguments that should be used when launching this target or null if none.
      Parameters:
      args - VM arguments or null
    • setImplicitDependencies

      void setImplicitDependencies(NameVersionDescriptor[] bundles)
      Sets implicit dependencies for this target. Bundles in this collection are always considered by PDE when computing plug-in dependencies. Only symbolic names need to be specified in the given descriptors.
      Parameters:
      bundles - implicit dependencies or null if none
    • getImplicitDependencies

      NameVersionDescriptor[] getImplicitDependencies()
      Returns the implicit dependencies set on this target or null if none.
      Returns:
      implicit dependencies or null