View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.eclipse.aether.collection;
20  
21  import org.eclipse.aether.RepositorySystemSession;
22  
23  /**
24   * A context used during dependency collection to exchange information within a chain of dependency graph transformers.
25   *
26   * @see DependencyGraphTransformer
27   * @noimplement This interface is not intended to be implemented by clients.
28   * @noextend This interface is not intended to be extended by clients.
29   */
30  public interface DependencyGraphTransformationContext {
31  
32      /**
33       * Gets the repository system session during which the graph transformation happens.
34       *
35       * @return The repository system session, never {@code null}.
36       */
37      RepositorySystemSession getSession();
38  
39      /**
40       * Gets a keyed value from the context.
41       *
42       * @param key The key used to query the value, must not be {@code null}.
43       * @return The queried value or {@code null} if none.
44       */
45      Object get(Object key);
46  
47      /**
48       * Puts a keyed value into the context.
49       *
50       * @param key The key used to store the value, must not be {@code null}.
51       * @param value The value to store, may be {@code null} to remove the mapping.
52       * @return The previous value associated with the key or {@code null} if none.
53       */
54      Object put(Object key, Object value);
55  }