Sun, 16 Dec 2012 11:09:36 +0100
8005098: Provide isSynthesized() information on Attribute.Compound
Reviewed-by: jjg
jjg@451 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
jjg@451 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@451 | 4 | * |
jjg@451 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@451 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
jjg@451 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
jjg@451 | 10 | * |
jjg@451 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@451 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@451 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@451 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@451 | 15 | * accompanied this code). |
jjg@451 | 16 | * |
jjg@451 | 17 | * You should have received a copy of the GNU General Public License version |
jjg@451 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@451 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@451 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
jjg@451 | 24 | */ |
jjg@451 | 25 | |
jjg@451 | 26 | package com.sun.tools.classfile; |
jjg@451 | 27 | |
jjg@451 | 28 | |
jjg@451 | 29 | /** |
jjg@451 | 30 | * A directed relationship between two {@link Dependency.Location Location}s. |
jjg@451 | 31 | * Subtypes of {@code Dependency} may provide additional detail about the dependency. |
jjg@451 | 32 | * |
jjg@451 | 33 | * @see Dependency.Finder |
jjg@451 | 34 | * @see Dependency.Filter |
jjg@451 | 35 | * @see Dependencies |
jjg@451 | 36 | */ |
jjg@451 | 37 | public interface Dependency { |
jjg@451 | 38 | /** |
jjg@451 | 39 | * A filter used to select dependencies of interest, and to discard others. |
jjg@451 | 40 | */ |
jjg@451 | 41 | public interface Filter { |
jjg@451 | 42 | /** |
jjg@451 | 43 | * Return true if the dependency is of interest. |
jjg@451 | 44 | * @param dependency the dependency to be considered |
jjg@451 | 45 | * @return true if and only if the dependency is of interest. |
jjg@451 | 46 | */ |
jjg@451 | 47 | boolean accepts(Dependency dependency); |
jjg@451 | 48 | } |
jjg@451 | 49 | |
jjg@451 | 50 | /** |
jjg@451 | 51 | * An interface for finding the immediate dependencies of a given class file. |
jjg@451 | 52 | */ |
jjg@451 | 53 | public interface Finder { |
jjg@451 | 54 | /** |
jjg@451 | 55 | * Find the immediate dependencies of a given class file. |
jjg@451 | 56 | * @param classfile the class file to be examined |
jjg@452 | 57 | * @return the dependencies located in the given class file. |
jjg@451 | 58 | */ |
jjg@451 | 59 | public Iterable<? extends Dependency> findDependencies(ClassFile classfile); |
jjg@451 | 60 | } |
jjg@451 | 61 | |
jjg@451 | 62 | |
jjg@451 | 63 | /** |
jjg@451 | 64 | * A location somewhere within a class. Subtypes of {@code Location} |
jjg@451 | 65 | * may be used to provide additional detail about the location. |
jjg@451 | 66 | */ |
jjg@451 | 67 | public interface Location { |
jjg@451 | 68 | /** |
jjg@451 | 69 | * Get the name of the class containing the location. |
jjg@451 | 70 | * This name will be used to locate the class file for transitive |
jjg@451 | 71 | * dependency analysis. |
jjg@451 | 72 | * @return the name of the class containing the location. |
jjg@451 | 73 | */ |
jjg@451 | 74 | String getClassName(); |
jjg@451 | 75 | } |
jjg@451 | 76 | |
jjg@451 | 77 | |
jjg@451 | 78 | /** |
jjg@451 | 79 | * Get the location that has the dependency. |
jjg@451 | 80 | * @return the location that has the dependency. |
jjg@451 | 81 | */ |
jjg@451 | 82 | Location getOrigin(); |
jjg@451 | 83 | |
jjg@451 | 84 | /** |
jjg@451 | 85 | * Get the location that is being depended upon. |
jjg@451 | 86 | * @return the location that is being depended upon. |
jjg@451 | 87 | */ |
jjg@451 | 88 | Location getTarget(); |
jjg@451 | 89 | } |
jjg@451 | 90 |