| 1 |
package org.jboss.resteasy.spi.metadata; |
| 2 |
|
| 3 |
import org.jboss.resteasy.util.Types; |
| 4 |
|
| 5 |
import java.lang.reflect.Constructor; |
| 6 |
import java.lang.reflect.Method; |
| 7 |
import java.lang.reflect.Type; |
| 8 |
import java.lang.reflect.TypeVariable; |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
public class ResourceConstructor |
| 15 |
{ |
| 16 |
protected ResourceClass resourceClass; |
| 17 |
protected Constructor constructor; |
| 18 |
protected ConstructorParameter[] params = {}; |
| 19 |
|
| 20 |
public ResourceConstructor(ResourceClass resourceClass, Constructor constructor) |
| 21 |
{ |
| 22 |
this.resourceClass = resourceClass; |
| 23 |
this.constructor = constructor; |
| 24 |
if (constructor.getParameterTypes() != null) |
| 25 |
{ |
| 26 |
this.params = new ConstructorParameter[constructor.getParameterTypes().length]; |
| 27 |
for (int i = 0; i < constructor.getParameterTypes().length; i++) |
| 28 |
{ |
| 29 |
this.params[i] = new ConstructorParameter(this, constructor.getParameterTypes()[i], constructor.getGenericParameterTypes()[i], constructor.getParameterAnnotations()[i]); |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
public ResourceClass getResourceClass() |
| 35 |
{ |
| 36 |
return resourceClass; |
| 37 |
} |
| 38 |
|
| 39 |
public Constructor getConstructor() |
| 40 |
{ |
| 41 |
return constructor; |
| 42 |
} |
| 43 |
|
| 44 |
public ConstructorParameter[] getParams() |
| 45 |
{ |
| 46 |
return params; |
| 47 |
} |
| 48 |
} |