mirror of
https://github.com/corda/corda.git
synced 2025-02-05 02:29:20 +00:00
implemented getDeclaredConstructor method
This commit is contained in:
parent
f9426f084f
commit
4aa731bacf
@ -219,6 +219,25 @@ public final class Class <T> {
|
||||
}
|
||||
}
|
||||
|
||||
public Constructor getDeclaredConstructor(Class ... parameterTypes)
|
||||
throws NoSuchMethodException
|
||||
{
|
||||
Constructor c = null;
|
||||
Constructor[] constructors = getDeclaredConstructors();
|
||||
|
||||
for (int i = 0; i < constructors.length; ++i) {
|
||||
if (match(parameterTypes, constructors[i].getParameterTypes())) {
|
||||
c = constructors[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (c == null) {
|
||||
throw new NoSuchMethodException();
|
||||
} else {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
private int countConstructors(boolean publicOnly) {
|
||||
int count = 0;
|
||||
if (methodTable != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user