Path: blob/master/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependency.java
41161 views
/*1* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.tools.classfile;262728/**29* A directed relationship between two {@link Dependency.Location Location}s.30* Subtypes of {@code Dependency} may provide additional detail about the dependency.31*32* @see Dependency.Finder33* @see Dependency.Filter34* @see Dependencies35*/36public interface Dependency {37/**38* A filter used to select dependencies of interest, and to discard others.39*/40public interface Filter {41/**42* Return true if the dependency is of interest.43* @param dependency the dependency to be considered44* @return true if and only if the dependency is of interest.45*/46boolean accepts(Dependency dependency);47}4849/**50* An interface for finding the immediate dependencies of a given class file.51*/52public interface Finder {53/**54* Find the immediate dependencies of a given class file.55* @param classfile the class file to be examined56* @return the dependencies located in the given class file.57*/58public Iterable<? extends Dependency> findDependencies(ClassFile classfile);59}606162/**63* A location somewhere within a class. Subtypes of {@code Location}64* may be used to provide additional detail about the location.65*/66public interface Location {67/**68* Get the name of the class containing the location.69* This name will be used to locate the class file for transitive70* dependency analysis.71* @return the name of the class containing the location.72*/73String getName();7475/**76* Get the fully-qualified name of the class containing the location.77* @return the fully-qualified name of the class containing the location.78*/79String getClassName();8081/**82* Get the package name of the class containing the location.83* @return the package name of the class containing the location.84*/85String getPackageName();86}878889/**90* Get the location that has the dependency.91* @return the location that has the dependency.92*/93Location getOrigin();9495/**96* Get the location that is being depended upon.97* @return the location that is being depended upon.98*/99Location getTarget();100}101102103104