mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
add classes and methods needed for GNU Classpath compatibility
Most of these methods are stubs which throw UnsupportedOperationExceptions for now.
This commit is contained in:
@ -10,7 +10,9 @@
|
||||
|
||||
package java.lang.reflect;
|
||||
|
||||
public class Constructor<T> extends AccessibleObject implements Member {
|
||||
public class Constructor<T> extends AccessibleObject
|
||||
implements Member, GenericDeclaration
|
||||
{
|
||||
private Method<T> method;
|
||||
|
||||
public Constructor(Method<T> method) {
|
||||
@ -46,6 +48,18 @@ public class Constructor<T> extends AccessibleObject implements Member {
|
||||
return method.getName();
|
||||
}
|
||||
|
||||
public boolean isSynthetic() {
|
||||
return method.isSynthetic();
|
||||
}
|
||||
|
||||
public TypeVariable<Constructor<T>>[] getTypeParameters() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Type[] getGenericParameterTypes() {
|
||||
return method.getGenericParameterTypes();
|
||||
}
|
||||
|
||||
private static native <T> T make(Class<T> c);
|
||||
|
||||
public T newInstance(Object ... arguments)
|
||||
|
@ -101,6 +101,38 @@ public class Field<T> extends AccessibleObject {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getBoolean(Object instance) throws IllegalAccessException {
|
||||
return ((Boolean) get(instance)).booleanValue();
|
||||
}
|
||||
|
||||
public byte getByte(Object instance) throws IllegalAccessException {
|
||||
return ((Byte) get(instance)).byteValue();
|
||||
}
|
||||
|
||||
public short getShort(Object instance) throws IllegalAccessException {
|
||||
return ((Short) get(instance)).shortValue();
|
||||
}
|
||||
|
||||
public char getChar(Object instance) throws IllegalAccessException {
|
||||
return ((Character) get(instance)).charValue();
|
||||
}
|
||||
|
||||
public int getInt(Object instance) throws IllegalAccessException {
|
||||
return ((Integer) get(instance)).intValue();
|
||||
}
|
||||
|
||||
public float getFloat(Object instance) throws IllegalAccessException {
|
||||
return ((Float) get(instance)).floatValue();
|
||||
}
|
||||
|
||||
public long getLong(Object instance) throws IllegalAccessException {
|
||||
return ((Long) get(instance)).longValue();
|
||||
}
|
||||
|
||||
public double getDouble(Object instance) throws IllegalAccessException {
|
||||
return ((Double) get(instance)).doubleValue();
|
||||
}
|
||||
|
||||
public void set(Object instance, Object value)
|
||||
throws IllegalAccessException
|
||||
{
|
||||
@ -162,6 +194,10 @@ public class Field<T> extends AccessibleObject {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnumConstant() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
private static native long getPrimitive
|
||||
(Object instance, int code, int offset);
|
||||
|
||||
|
15
classpath/java/lang/reflect/GenericDeclaration.java
Normal file
15
classpath/java/lang/reflect/GenericDeclaration.java
Normal file
@ -0,0 +1,15 @@
|
||||
/* Copyright (c) 2009, Avian Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
There is NO WARRANTY for this software. See license.txt for
|
||||
details. */
|
||||
|
||||
package java.lang.reflect;
|
||||
|
||||
public interface GenericDeclaration {
|
||||
public TypeVariable<?>[] getTypeParameters();
|
||||
}
|
@ -19,4 +19,6 @@ public interface Member {
|
||||
public int getModifiers();
|
||||
|
||||
public String getName();
|
||||
|
||||
public boolean isSynthetic();
|
||||
}
|
||||
|
@ -10,7 +10,9 @@
|
||||
|
||||
package java.lang.reflect;
|
||||
|
||||
public class Method<T> extends AccessibleObject implements Member {
|
||||
public class Method<T> extends AccessibleObject
|
||||
implements Member, GenericDeclaration
|
||||
{
|
||||
private byte vmFlags;
|
||||
private byte returnCode;
|
||||
private byte parameterCount;
|
||||
@ -124,4 +126,28 @@ public class Method<T> extends AccessibleObject implements Member {
|
||||
}
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
public boolean isSynthetic() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Object getDefaultValue() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Type[] getGenericParameterTypes() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Type getGenericReturnType() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Class[] getExceptionTypes() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public TypeVariable<Method<T>>[] getTypeParameters() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
13
classpath/java/lang/reflect/Type.java
Normal file
13
classpath/java/lang/reflect/Type.java
Normal file
@ -0,0 +1,13 @@
|
||||
/* Copyright (c) 2009, Avian Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
There is NO WARRANTY for this software. See license.txt for
|
||||
details. */
|
||||
|
||||
package java.lang.reflect;
|
||||
|
||||
public interface Type { }
|
19
classpath/java/lang/reflect/TypeVariable.java
Normal file
19
classpath/java/lang/reflect/TypeVariable.java
Normal file
@ -0,0 +1,19 @@
|
||||
/* Copyright (c) 2009, Avian Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice appear
|
||||
in all copies.
|
||||
|
||||
There is NO WARRANTY for this software. See license.txt for
|
||||
details. */
|
||||
|
||||
package java.lang.reflect;
|
||||
|
||||
public interface TypeVariable<T extends GenericDeclaration>
|
||||
extends Type
|
||||
{
|
||||
public Type[] getBounds();
|
||||
public T getGenericDeclaration();
|
||||
public String getName();
|
||||
}
|
Reference in New Issue
Block a user