1 /* 2 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.lang.invoke; 27 28 import java.lang.reflect.Constructor; 29 import java.lang.reflect.Field; 30 import java.lang.reflect.Member; 31 import java.lang.reflect.Method; 32 import java.util.List; 33 34 public class MethodHandles { 35 lookup()36 public static Lookup lookup() { return null; } 37 publicLookup()38 public static Lookup publicLookup() { return null; } 39 40 public static <T extends Member> T reflectAs(Class<T> expected, MethodHandle target)41 reflectAs(Class<T> expected, MethodHandle target) { return null; } 42 43 public static final 44 class Lookup { 45 public static final int PUBLIC = 0; 46 47 public static final int PRIVATE = 0; 48 49 public static final int PROTECTED = 0; 50 51 public static final int PACKAGE = 0; 52 lookupClass()53 public Class<?> lookupClass() { return null; } 54 lookupModes()55 public int lookupModes() { return 0; } 56 in(Class<?> requestedLookupClass)57 public Lookup in(Class<?> requestedLookupClass) { return null; } 58 59 public findStatic(Class<?> refc, String name, MethodType type)60 MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; } 61 findVirtual(Class<?> refc, String name, MethodType type)62 public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; } 63 findConstructor(Class<?> refc, MethodType type)64 public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; } 65 findSpecial(Class<?> refc, String name, MethodType type, Class<?> specialCaller)66 public MethodHandle findSpecial(Class<?> refc, String name, MethodType type, 67 Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException { return null; } 68 findGetter(Class<?> refc, String name, Class<?> type)69 public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; } 70 findSetter(Class<?> refc, String name, Class<?> type)71 public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; } 72 findStaticGetter(Class<?> refc, String name, Class<?> type)73 public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; } 74 findStaticSetter(Class<?> refc, String name, Class<?> type)75 public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; } 76 bind(Object receiver, String name, MethodType type)77 public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; } 78 unreflect(Method m)79 public MethodHandle unreflect(Method m) throws IllegalAccessException { return null; } 80 unreflectSpecial(Method m, Class<?> specialCaller)81 public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException { return null; } 82 unreflectConstructor(Constructor<?> c)83 public MethodHandle unreflectConstructor(Constructor<?> c) throws IllegalAccessException { return null; } 84 unreflectGetter(Field f)85 public MethodHandle unreflectGetter(Field f) throws IllegalAccessException { return null; } 86 unreflectSetter(Field f)87 public MethodHandle unreflectSetter(Field f) throws IllegalAccessException { return null; } 88 revealDirect(MethodHandle target)89 public MethodHandleInfo revealDirect(MethodHandle target) { return null; } 90 91 } 92 93 public static arrayElementGetter(Class<?> arrayClass)94 MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException { return null; } 95 96 public static arrayElementSetter(Class<?> arrayClass)97 MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException { return null; } 98 99 static public spreadInvoker(MethodType type, int leadingArgCount)100 MethodHandle spreadInvoker(MethodType type, int leadingArgCount) { return null; } 101 102 static public exactInvoker(MethodType type)103 MethodHandle exactInvoker(MethodType type) { return null; } 104 105 static public invoker(MethodType type)106 MethodHandle invoker(MethodType type) { return null; } 107 108 public static explicitCastArguments(MethodHandle target, MethodType newType)109 MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) { return null; } 110 111 public static permuteArguments(MethodHandle target, MethodType newType, int... reorder)112 MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) { return null; } 113 114 public static constant(Class<?> type, Object value)115 MethodHandle constant(Class<?> type, Object value) { return null; } 116 117 public static identity(Class<?> type)118 MethodHandle identity(Class<?> type) { return null; } 119 120 public static insertArguments(MethodHandle target, int pos, Object... values)121 MethodHandle insertArguments(MethodHandle target, int pos, Object... values) { return null; } 122 123 public static dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes)124 MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) { return null; } 125 126 public static dropArguments(MethodHandle target, int pos, Class<?>... valueTypes)127 MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) { return null; } 128 129 public static filterArguments(MethodHandle target, int pos, MethodHandle... filters)130 MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) { return null; } 131 132 public static collectArguments(MethodHandle target, int pos, MethodHandle filter)133 MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle filter) { return null; } 134 135 public static filterReturnValue(MethodHandle target, MethodHandle filter)136 MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) { return null; } 137 138 public static foldArguments(MethodHandle target, MethodHandle combiner)139 MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) { return null; } 140 141 public static guardWithTest(MethodHandle test, MethodHandle target, MethodHandle fallback)142 MethodHandle guardWithTest(MethodHandle test, 143 MethodHandle target, 144 MethodHandle fallback) { return null; } 145 146 public static catchException(MethodHandle target, Class<? extends Throwable> exType, MethodHandle handler)147 MethodHandle catchException(MethodHandle target, 148 Class<? extends Throwable> exType, 149 MethodHandle handler) { return null; } 150 151 public static throwException(Class<?> returnType, Class<? extends Throwable> exType)152 MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) { return null; } 153 } 154