Path: blob/master/src/java.base/share/classes/jdk/internal/reflect/FieldAccessor.java
41159 views
/*1* Copyright (c) 2001, 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 jdk.internal.reflect;2627/** This interface provides the declarations for the accessor methods28of java.lang.reflect.Field. Each Field object is configured with a29(possibly dynamically-generated) class which implements this30interface. */3132public interface FieldAccessor {33/** Matches specification in {@link java.lang.reflect.Field} */34public Object get(Object obj) throws IllegalArgumentException;3536/** Matches specification in {@link java.lang.reflect.Field} */37public boolean getBoolean(Object obj) throws IllegalArgumentException;3839/** Matches specification in {@link java.lang.reflect.Field} */40public byte getByte(Object obj) throws IllegalArgumentException;4142/** Matches specification in {@link java.lang.reflect.Field} */43public char getChar(Object obj) throws IllegalArgumentException;4445/** Matches specification in {@link java.lang.reflect.Field} */46public short getShort(Object obj) throws IllegalArgumentException;4748/** Matches specification in {@link java.lang.reflect.Field} */49public int getInt(Object obj) throws IllegalArgumentException;5051/** Matches specification in {@link java.lang.reflect.Field} */52public long getLong(Object obj) throws IllegalArgumentException;5354/** Matches specification in {@link java.lang.reflect.Field} */55public float getFloat(Object obj) throws IllegalArgumentException;5657/** Matches specification in {@link java.lang.reflect.Field} */58public double getDouble(Object obj) throws IllegalArgumentException;5960/** Matches specification in {@link java.lang.reflect.Field} */61public void set(Object obj, Object value)62throws IllegalArgumentException, IllegalAccessException;6364/** Matches specification in {@link java.lang.reflect.Field} */65public void setBoolean(Object obj, boolean z)66throws IllegalArgumentException, IllegalAccessException;6768/** Matches specification in {@link java.lang.reflect.Field} */69public void setByte(Object obj, byte b)70throws IllegalArgumentException, IllegalAccessException;7172/** Matches specification in {@link java.lang.reflect.Field} */73public void setChar(Object obj, char c)74throws IllegalArgumentException, IllegalAccessException;7576/** Matches specification in {@link java.lang.reflect.Field} */77public void setShort(Object obj, short s)78throws IllegalArgumentException, IllegalAccessException;7980/** Matches specification in {@link java.lang.reflect.Field} */81public void setInt(Object obj, int i)82throws IllegalArgumentException, IllegalAccessException;8384/** Matches specification in {@link java.lang.reflect.Field} */85public void setLong(Object obj, long l)86throws IllegalArgumentException, IllegalAccessException;8788/** Matches specification in {@link java.lang.reflect.Field} */89public void setFloat(Object obj, float f)90throws IllegalArgumentException, IllegalAccessException;9192/** Matches specification in {@link java.lang.reflect.Field} */93public void setDouble(Object obj, double d)94throws IllegalArgumentException, IllegalAccessException;95}969798