53 * <p> 54 * A Java type. This includs declaration, but also includes such 55 * things like arrays, primitive types, parameterized types, and etc. 56 * 57 * @author Kohsuke Kawaguchi (kk@kohsuke.org) 58 */ 59 public interface Navigator<T,C,F,M> { 60 /** 61 * Gets the base class of the specified class. 62 * 63 * @return 64 * null if the parameter represents {@link Object}. 65 */ 66 C getSuperClass(C clazz); 67 68 /** 69 * Gets the parameterization of the given base type. 70 * 71 * <p> 72 * For example, given the following 73 * <pre><xmp> 74 * interface Foo<T> extends List<List<T>> {} 75 * interface Bar extends Foo<String> {} 76 * </xmp></pre> 77 * This method works like this: 78 * <pre><xmp> 79 * getBaseClass( Bar, List ) = List<List<String> 80 * getBaseClass( Bar, Foo ) = Foo<String> 81 * getBaseClass( Foo<? extends Number>, Collection ) = Collection<List<? extends Number>> 82 * getBaseClass( ArrayList<? extends BigInteger>, List ) = List<? extends BigInteger> 83 * </xmp></pre> 84 * 85 * @param type 86 * The type that derives from {@code baseType} 87 * @param baseType 88 * The class whose parameterization we are interested in. 89 * @return 90 * The use of {@code baseType} in {@code type}. 91 * or null if the type is not assignable to the base type. 92 */ 93 T getBaseClass(T type, C baseType); 94 95 /** 96 * Gets the fully-qualified name of the class. 97 * ("java.lang.Object" for {@link Object}) 98 */ 99 String getClassName(C clazz); 100 101 /** 102 * Gets the display name of the type object 103 * | 53 * <p> 54 * A Java type. This includs declaration, but also includes such 55 * things like arrays, primitive types, parameterized types, and etc. 56 * 57 * @author Kohsuke Kawaguchi (kk@kohsuke.org) 58 */ 59 public interface Navigator<T,C,F,M> { 60 /** 61 * Gets the base class of the specified class. 62 * 63 * @return 64 * null if the parameter represents {@link Object}. 65 */ 66 C getSuperClass(C clazz); 67 68 /** 69 * Gets the parameterization of the given base type. 70 * 71 * <p> 72 * For example, given the following 73 * <pre>{@code 74 * interface Foo<T> extends List<List<T>> {} 75 * interface Bar extends Foo<String> {} 76 * }</pre> 77 * This method works like this: 78 * <pre>{@code 79 * getBaseClass( Bar, List ) = List<List<String>> 80 * getBaseClass( Bar, Foo ) = Foo<String> 81 * getBaseClass( Foo<? extends Number>, Collection ) = Collection<List<? extends Number>> 82 * getBaseClass( ArrayList<? extends BigInteger>, List ) = List<? extends BigInteger> 83 * }</pre> 84 * 85 * @param type 86 * The type that derives from {@code baseType} 87 * @param baseType 88 * The class whose parameterization we are interested in. 89 * @return 90 * The use of {@code baseType} in {@code type}. 91 * or null if the type is not assignable to the base type. 92 */ 93 T getBaseClass(T type, C baseType); 94 95 /** 96 * Gets the fully-qualified name of the class. 97 * ("java.lang.Object" for {@link Object}) 98 */ 99 String getClassName(C clazz); 100 101 /** 102 * Gets the display name of the type object 103 * |