5459N/A/*
5459N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
5459N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5459N/A *
5459N/A * This code is free software; you can redistribute it and/or modify it
5459N/A * under the terms of the GNU General Public License version 2 only, as
5459N/A * published by the Free Software Foundation. Oracle designates this
5459N/A * particular file as subject to the "Classpath" exception as provided
5459N/A * by Oracle in the LICENSE file that accompanied this code.
5459N/A *
5459N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5459N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5459N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5459N/A * version 2 for more details (a copy is included in the LICENSE file that
5459N/A * accompanied this code).
5459N/A *
5459N/A * You should have received a copy of the GNU General Public License version
5459N/A * 2 along with this work; if not, write to the Free Software Foundation,
5459N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5459N/A *
5459N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5459N/A * or visit www.oracle.com if you need additional information or have any
5459N/A * questions.
5459N/A */
5459N/A
5459N/Apackage java.lang.invoke;
5459N/Aimport java.lang.invoke.MethodHandleNatives.Constants;
5459N/A
5459N/A//Not yet public: public
5459N/Aclass MethodHandleInfo {
5459N/A public static final int
5459N/A REF_NONE = Constants.REF_NONE,
5459N/A REF_getField = Constants.REF_getField,
5459N/A REF_getStatic = Constants.REF_getStatic,
5459N/A REF_putField = Constants.REF_putField,
5459N/A REF_putStatic = Constants.REF_putStatic,
5459N/A REF_invokeVirtual = Constants.REF_invokeVirtual,
5459N/A REF_invokeStatic = Constants.REF_invokeStatic,
5459N/A REF_invokeSpecial = Constants.REF_invokeSpecial,
5459N/A REF_newInvokeSpecial = Constants.REF_newInvokeSpecial,
5459N/A REF_invokeInterface = Constants.REF_invokeInterface;
5459N/A
5459N/A private final Class<?> declaringClass;
5459N/A private final String name;
5459N/A private final MethodType methodType;
5459N/A private final int referenceKind;
5459N/A
5459N/A public MethodHandleInfo(MethodHandle mh) throws ReflectiveOperationException {
5459N/A MemberName mn = mh.internalMemberName();
5459N/A this.declaringClass = mn.getDeclaringClass();
5459N/A this.name = mn.getName();
5459N/A this.methodType = mn.getMethodType();
5459N/A this.referenceKind = mn.getReferenceKind();
5459N/A }
5459N/A
5459N/A public Class<?> getDeclaringClass() {
5459N/A return declaringClass;
5459N/A }
5459N/A
5459N/A public String getName() {
5459N/A return name;
5459N/A }
5459N/A
5459N/A public MethodType getMethodType() {
5459N/A return methodType;
5459N/A }
5459N/A
5459N/A public int getReferenceKind() {
5459N/A return referenceKind;
5459N/A }
5459N/A}