1 |
/* IllegalAccessException.java -- exception thrown when trying to load a |
/* IllegalAccessException.java -- thrown on attempt to reflect on |
2 |
class that is not public and in another package. |
inaccessible data |
3 |
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
8 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
9 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
10 |
any later version. |
any later version. |
11 |
|
|
12 |
GNU Classpath is distributed in the hope that it will be useful, but |
GNU Classpath is distributed in the hope that it will be useful, but |
13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
39 |
|
|
40 |
package java.lang; |
package java.lang; |
41 |
|
|
|
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 |
|
|
* "The Java Language Specification", ISBN 0-201-63451-1 |
|
|
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com. |
|
|
* Status: Believed complete and correct. |
|
|
*/ |
|
|
|
|
42 |
/** |
/** |
43 |
* Exceptions may be thrown by one part of a Java program and caught |
* Thrown whenever a reflective method tries to do something that the |
44 |
* by another in order to deal with exceptional conditions. |
* compiler would not allow. For example, using reflection to set a private |
45 |
* Thrown in two cases. The first is when try to load a class that is |
* variable that belongs to a class in another package is bad. |
|
* not public and in another package using specific methods from |
|
|
* <code>ClassLoader</code> and <code>Class</code>. The second case is |
|
|
* when trying to create a new instance of a class to which you do not have |
|
|
* access to the zero argument constructor as in using the |
|
|
* <code>newsInstance</code> method of class <code>Class</code>. |
|
46 |
* |
* |
|
* @since JDK 1.0 |
|
|
* |
|
47 |
* @author Brian Jones |
* @author Brian Jones |
48 |
* @author Warren Levy <warrenl@cygnus.com> |
* @author Warren Levy <warrenl@cygnus.com> |
49 |
* @date September 18, 1998. |
* @see Class#newInstance() |
50 |
|
* @see Field#set(Object, Object) |
51 |
|
* @see Field#setBoolean(Object, boolean) |
52 |
|
* @see Field#setByte(Object, byte) |
53 |
|
* @see Field#setShort(Object, short) |
54 |
|
* @see Field#setChar(Object, char) |
55 |
|
* @see Field#setInt(Object, int) |
56 |
|
* @see Field#setLong(Object, long) |
57 |
|
* @see Field#setFloat(Object, float) |
58 |
|
* @see Field#setDouble(Object, double) |
59 |
|
* @see Field#get(Object) |
60 |
|
* @see Field#getBoolean(Object) |
61 |
|
* @see Field#getByte(Object) |
62 |
|
* @see Field#getShort(Object) |
63 |
|
* @see Field#getChar(Object) |
64 |
|
* @see Field#getInt(Object) |
65 |
|
* @see Field#getLong(Object) |
66 |
|
* @see Field#getFloat(Object) |
67 |
|
* @see Field#getDouble(Object) |
68 |
|
* @see Method#invoke(Object, Object[]) |
69 |
|
* @see Constructor#newInstance(Object[]) |
70 |
|
* @status updated to 1.4 |
71 |
*/ |
*/ |
72 |
public class IllegalAccessException extends Exception |
public class IllegalAccessException extends Exception |
73 |
{ |
{ |
74 |
static final long serialVersionUID = 6616958222490762034L; |
/** |
75 |
|
* Compatible with JDK 1.0+. |
76 |
|
*/ |
77 |
|
private static final long serialVersionUID = 6616958222490762034L; |
78 |
|
|
79 |
/** |
/** |
80 |
* Create an exception without a message. |
* Create an exception without a message. |
81 |
*/ |
*/ |
82 |
public IllegalAccessException() |
public IllegalAccessException() |
83 |
{ |
{ |
84 |
super(); |
} |
|
} |
|
85 |
|
|
86 |
/** |
/** |
87 |
* Create an exception with a message. |
* Create an exception with a message. |
88 |
|
* |
89 |
|
* @param s the message |
90 |
*/ |
*/ |
91 |
public IllegalAccessException(String s) |
public IllegalAccessException(String s) |
92 |
{ |
{ |
93 |
super(s); |
super(s); |
94 |
} |
} |
95 |
} |
} |