Home | History | Annotate | Download | only in invoke
      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 
     36     public static Lookup lookup() { return null; }
     37 
     38     public static Lookup publicLookup() { return null; }
     39 
     40     public static <T extends Member> T
     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 
     53         public Class<?> lookupClass() { return null; }
     54 
     55         public int lookupModes() { return 0; }
     56 
     57         public Lookup in(Class<?> requestedLookupClass) { return null; }
     58 
     59         public
     60         MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; }
     61 
     62         public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; }
     63 
     64         public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; }
     65 
     66         public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
     67                                         Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException { return null; }
     68 
     69         public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; }
     70 
     71         public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; }
     72 
     73         public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; }
     74 
     75         public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException { return null; }
     76 
     77         public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { return null; }
     78 
     79         public MethodHandle unreflect(Method m) throws IllegalAccessException { return null; }
     80 
     81         public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException { return null; }
     82 
     83         public MethodHandle unreflectConstructor(Constructor<?> c) throws IllegalAccessException { return null; }
     84 
     85         public MethodHandle unreflectGetter(Field f) throws IllegalAccessException { return null; }
     86 
     87         public MethodHandle unreflectSetter(Field f) throws IllegalAccessException { return null; }
     88 
     89         public MethodHandleInfo revealDirect(MethodHandle target) { return null; }
     90 
     91     }
     92 
     93     public static
     94     MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException { return null; }
     95 
     96     public static
     97     MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException { return null; }
     98 
     99     static public
    100     MethodHandle spreadInvoker(MethodType type, int leadingArgCount) { return null; }
    101 
    102     static public
    103     MethodHandle exactInvoker(MethodType type) { return null; }
    104 
    105     static public
    106     MethodHandle invoker(MethodType type) { return null; }
    107 
    108     public static
    109     MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) { return null; }
    110 
    111     public static
    112     MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) { return null; }
    113 
    114     public static
    115     MethodHandle constant(Class<?> type, Object value) { return null; }
    116 
    117     public static
    118     MethodHandle identity(Class<?> type) { return null; }
    119 
    120     public static
    121     MethodHandle insertArguments(MethodHandle target, int pos, Object... values) { return null; }
    122 
    123     public static
    124     MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) { return null; }
    125 
    126     public static
    127     MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) { return null; }
    128 
    129     public static
    130     MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) { return null; }
    131 
    132     public static
    133     MethodHandle collectArguments(MethodHandle target, int pos, MethodHandle filter) { return null; }
    134 
    135     public static
    136     MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) { return null; }
    137 
    138     public static
    139     MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) { return null; }
    140 
    141     public static
    142     MethodHandle guardWithTest(MethodHandle test,
    143                                MethodHandle target,
    144                                MethodHandle fallback) { return null; }
    145 
    146     public static
    147     MethodHandle catchException(MethodHandle target,
    148                                 Class<? extends Throwable> exType,
    149                                 MethodHandle handler) { return null; }
    150 
    151     public static
    152     MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) { return null; }
    153 }
    154