com.sun.jersey.spi.service
Class ComponentConstructor

java.lang.Object
  extended by com.sun.jersey.spi.service.ComponentConstructor
Direct Known Subclasses:
ResourceConstructor

public class ComponentConstructor
extends java.lang.Object

A class that may be used to obtain the most appropriate constructor (with injectables) for a component.

Author:
Paul.Sandoz@Sun.Com

Nested Class Summary
static class ComponentConstructor.ConstructorComparator<T>
           
static class ComponentConstructor.ConstructorInjectablePair<T>
          A tuple of a constructor and the list of injectables associated with the parameters of the constructor.
 
Field Summary
protected  InjectableProviderContext ipc
           
 
Constructor Summary
ComponentConstructor(InjectableProviderContext ipc)
          Create a component constructor with the injectable provider context.
 
Method Summary
<T> ComponentConstructor.ConstructorInjectablePair<T>
getConstructor(java.lang.Class<T> c)
          Get the most suitable constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ipc

protected final InjectableProviderContext ipc
Constructor Detail

ComponentConstructor

public ComponentConstructor(InjectableProviderContext ipc)
Create a component constructor with the injectable provider context.

Parameters:
ipc - the injectable provider context.
Method Detail

getConstructor

public <T> ComponentConstructor.ConstructorInjectablePair<T> getConstructor(java.lang.Class<T> c)
Get the most suitable constructor. The constructor with the most parameters and that has the most parameters associated with Injectable instances will be chosen.

Type Parameters:
T - The type to construct.
Parameters:
c - the class to instantiate.
Returns:
a list of constructor and list of injectables for the constructor parameters.


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.