org.eclipse.aether.graph

## Interface DependencyNode

- All Known Implementing Classes:
    DefaultDependencyNode

      public interface DependencyNode

  A node within a dependency graph. Note: When traversing a dirty graph, i.e. a graph which hasn't undergone conflict resolution, there can be multiple paths leading to the same node instance.
  Restriction:
    This interface is not intended to be extended by clients.
  Restriction:
    This interface is not intended to be implemented by clients.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(DependencyVisitor visitor)` Traverses this node and potentially its children using the specified visitor.
    `Collection<Artifact>` | `getAliases()` Gets the known aliases for this dependency's artifact.
    `List<DependencyNode>` | `getChildren()` Gets the child nodes of this node.
    `Map<Object,Object>` | `getData()` Gets the custom data associated with this dependency node.
    `Dependency` | `getDependency()` Gets the dependency associated with this node.
    `String` | `getPremanagedScope()` Gets the scope for the dependency before dependency management was applied (if any).
    `String` | `getPremanagedVersion()` Gets the version or version range for the dependency before dependency management was applied (if any).
    `List<Artifact>` | `getRelocations()` Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.
    `List<RemoteRepository>` | `getRepositories()` Gets the remote repositories from which this node's artifact shall be resolved.
    `String` | `getRequestContext()` Gets the request context in which this dependency node was created.
    `Version` | `getVersion()` Gets the version that was selected for the dependency's target artifact.
    `VersionConstraint` | `getVersionConstraint()` Gets the version constraint that was parsed from the dependency's version declaration.
    `void` | `setArtifact(Artifact artifact)` Sets the artifact of the dependency.
    `void` | `setData(Object key, Object value)` Associates the specified dependency node data with the given key.
    `void` | `setRequestContext(String context)` Sets the request context in which this dependency node was created.
    `void` | `setScope(String scope)` Sets the scope of the dependency.

- - ### Method Detail

    - #### getChildren

          List<DependencyNode> getChildren()

      Gets the child nodes of this node.
      Returns:
        The child nodes of this node, never `null`.

    - #### getDependency

          Dependency getDependency()

      Gets the dependency associated with this node. Note: For dependency graphs that have been constructed without a root dependency, the root node will not have a dependency associated with it.
      Returns:
        The dependency or `null` if none.

    - #### setArtifact

          void setArtifact(Artifact artifact)

      Sets the artifact of the dependency.
      Parameters:
        `artifact` - The artifact satisfying the dependency, must not be `null`.

    - #### getRelocations

          List<Artifact> getRelocations()

      Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.
      Returns:
        The (read-only) sequence of relocations, never `null`.

    - #### getAliases

          Collection<Artifact> getAliases()

      Gets the known aliases for this dependency's artifact. An alias can be used to mark a patched rebuild of some other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as a conflict.
      Returns:
        The (read-only) set of known aliases, never `null`.

    - #### getVersionConstraint

          VersionConstraint getVersionConstraint()

      Gets the version constraint that was parsed from the dependency's version declaration.
      Returns:
        The version constraint for this node or `null`.

    - #### getVersion

          Version getVersion()

      Gets the version that was selected for the dependency's target artifact.
      Returns:
        The parsed version or `null`.

    - #### setScope

          void setScope(String scope)

      Sets the scope of the dependency.
      Parameters:
        `scope` - The scope, may be `null`.

    - #### getPremanagedVersion

          String getPremanagedVersion()

      Gets the version or version range for the dependency before dependency management was applied (if any).
      Returns:
        The dependency version before dependency management or `null` if the version was not managed.

    - #### getPremanagedScope

          String getPremanagedScope()

      Gets the scope for the dependency before dependency management was applied (if any).
      Returns:
        The dependency scope before dependency management or `null` if the scope was not managed.

    - #### getRepositories

          List<RemoteRepository> getRepositories()

      Gets the remote repositories from which this node's artifact shall be resolved.
      Returns:
        The (read-only) list of remote repositories to use for artifact resolution, never `null`.

    - #### getRequestContext

          String getRequestContext()

      Gets the request context in which this dependency node was created.
      Returns:
        The request context, never `null`.

    - #### setRequestContext

          void setRequestContext(String context)

      Sets the request context in which this dependency node was created.
      Parameters:
        `context` - The context, may be `null`.

    - #### getData

          Map<Object,Object> getData()

      Gets the custom data associated with this dependency node. Clients of the repository system can use this data to annotate dependency nodes with domain-specific information.
      Returns:
        The (read-only) key-value mappings, never `null`.

    - #### setData

          void setData(Object key,
                     Object value)

      Associates the specified dependency node data with the given key. Note: This method must not be called while `getData()` is being iterated.
      Parameters:
        `key` - The key under which to store the data, must not be `null`.
        `value` - The data to associate with the key, may be `null` to remove the mapping.

    - #### accept

          boolean accept(DependencyVisitor visitor)

      Traverses this node and potentially its children using the specified visitor.
      Parameters:
        `visitor` - The visitor to call back, must not be `null`.
      Returns:
        `true` to visit siblings nodes of this node as well, `false` to skip siblings.

Copyright © 2010-2012 The Eclipse Foundation. All Rights Reserved.