001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.eclipse.aether.spi.validator; 020 021import org.eclipse.aether.artifact.Artifact; 022import org.eclipse.aether.graph.Dependency; 023import org.eclipse.aether.metadata.Metadata; 024import org.eclipse.aether.repository.LocalRepository; 025import org.eclipse.aether.repository.RemoteRepository; 026 027/** 028 * A repository system main input validator; this validator is used in repository system "main entry methods". 029 * 030 * @since 2.0.8 031 */ 032public interface Validator { 033 /** 034 * Validates artifact. 035 * 036 * @param artifact The artifact to validate, never {@code null}. 037 * @throws IllegalArgumentException if artifact is invalid. 038 */ 039 default void validateArtifact(Artifact artifact) throws IllegalArgumentException {} 040 041 /** 042 * Validates metadata. 043 * 044 * @param metadata The metadata to validate, never {@code null}. 045 * @throws IllegalArgumentException if artifact is invalid. 046 */ 047 default void validateMetadata(Metadata metadata) throws IllegalArgumentException {} 048 049 /** 050 * Validates dependency. 051 * 052 * @param dependency The dependency to validate, never {@code null}. 053 * @throws IllegalArgumentException if dependency is invalid. 054 */ 055 default void validateDependency(Dependency dependency) throws IllegalArgumentException {} 056 057 /** 058 * Validates local repository. 059 * 060 * @param localRepository The local repository to validate, never {@code null}. 061 * @throws IllegalArgumentException if local repository is invalid. 062 */ 063 default void validateLocalRepository(LocalRepository localRepository) throws IllegalArgumentException {} 064 065 /** 066 * Validates remote repository. 067 * 068 * @param remoteRepository The remote repository to validate, never {@code null}. 069 * @throws IllegalArgumentException if remote repository is invalid. 070 */ 071 default void validateRemoteRepository(RemoteRepository remoteRepository) throws IllegalArgumentException {} 072}