Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/reflect/LangReflectAccess.java
38829 views
/*1* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.reflect;2627import java.lang.reflect.*;2829/** An interface which gives privileged packages Java-level access to30internals of java.lang.reflect. */3132public interface LangReflectAccess {33/** Creates a new java.lang.reflect.Field. Access checks as per34java.lang.reflect.AccessibleObject are not overridden. */35public Field newField(Class<?> declaringClass,36String name,37Class<?> type,38int modifiers,39int slot,40String signature,41byte[] annotations);4243/** Creates a new java.lang.reflect.Method. Access checks as per44java.lang.reflect.AccessibleObject are not overridden. */45public Method newMethod(Class<?> declaringClass,46String name,47Class<?>[] parameterTypes,48Class<?> returnType,49Class<?>[] checkedExceptions,50int modifiers,51int slot,52String signature,53byte[] annotations,54byte[] parameterAnnotations,55byte[] annotationDefault);5657/** Creates a new java.lang.reflect.Constructor. Access checks as58per java.lang.reflect.AccessibleObject are not overridden. */59public <T> Constructor<T> newConstructor(Class<T> declaringClass,60Class<?>[] parameterTypes,61Class<?>[] checkedExceptions,62int modifiers,63int slot,64String signature,65byte[] annotations,66byte[] parameterAnnotations);6768/** Gets the MethodAccessor object for a java.lang.reflect.Method */69public MethodAccessor getMethodAccessor(Method m);7071/** Sets the MethodAccessor object for a java.lang.reflect.Method */72public void setMethodAccessor(Method m, MethodAccessor accessor);7374/** Gets the ConstructorAccessor object for a75java.lang.reflect.Constructor */76public ConstructorAccessor getConstructorAccessor(Constructor<?> c);7778/** Sets the ConstructorAccessor object for a79java.lang.reflect.Constructor */80public void setConstructorAccessor(Constructor<?> c,81ConstructorAccessor accessor);8283/** Gets the byte[] that encodes TypeAnnotations on an Executable. */84public byte[] getExecutableTypeAnnotationBytes(Executable ex);8586/** Gets the "slot" field from a Constructor (used for serialization) */87public int getConstructorSlot(Constructor<?> c);8889/** Gets the "signature" field from a Constructor (used for serialization) */90public String getConstructorSignature(Constructor<?> c);9192/** Gets the "annotations" field from a Constructor (used for serialization) */93public byte[] getConstructorAnnotations(Constructor<?> c);9495/** Gets the "parameterAnnotations" field from a Constructor (used for serialization) */96public byte[] getConstructorParameterAnnotations(Constructor<?> c);9798//99// Copying routines, needed to quickly fabricate new Field,100// Method, and Constructor objects from templates101//102103/** Makes a "child" copy of a Method */104public Method copyMethod(Method arg);105106/** Makes a "child" copy of a Field */107public Field copyField(Field arg);108109/** Makes a "child" copy of a Constructor */110public <T> Constructor<T> copyConstructor(Constructor<T> arg);111}112113114