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.impl; 20 21 import java.util.Collection; 22 23 import org.eclipse.aether.artifact.Artifact; 24 import org.eclipse.aether.metadata.Metadata; 25 26 /** 27 * A metadata generator that participates in the installation/deployment of artifacts. 28 * 29 * @provisional This type is provisional and can be changed, moved or removed without prior notice. 30 */ 31 public interface MetadataGenerator { 32 33 /** 34 * Prepares the generator to transform artifacts. 35 * 36 * @param artifacts The artifacts to install/deploy, must not be {@code null}. 37 * @return The metadata to process (e.g. merge with existing metadata) before artifact transformations, never 38 * {@code null}. 39 */ 40 Collection<? extends Metadata> prepare(Collection<? extends Artifact> artifacts); 41 42 /** 43 * Enables the metadata generator to transform the specified artifact. 44 * 45 * @param artifact The artifact to transform, must not be {@code null}. 46 * @return The transformed artifact (or just the input artifact), never {@code null}. 47 */ 48 Artifact transformArtifact(Artifact artifact); 49 50 /** 51 * Allows for metadata generation based on the transformed artifacts. 52 * 53 * @param artifacts The (transformed) artifacts to install/deploy, must not be {@code null}. 54 * @return The additional metadata to process after artifact transformations, never {@code null}. 55 */ 56 Collection<? extends Metadata> finish(Collection<? extends Artifact> artifacts); 57 }