org.vraptor.component
Class Clazz<T>

java.lang.Object
  extended by org.vraptor.component.Clazz<T>

public class Clazz<T>
extends Object

Wrapper for reflecting on Class with generic functionalities.

Since:
2.3.1
Author:
Guilherme Silveira

Constructor Summary
Clazz(Class<T> type)
           
 
Method Summary
 BeanConstructor findSingleConstructor()
          Returns the single constructor - if there is only one.
 Class<T> getType()
           
 Object newInstance()
          Creates a new instance from this type, using a default implementation of a collection when needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clazz

public Clazz(Class<T> type)
Method Detail

getType

public Class<T> getType()

newInstance

public Object newInstance()
                   throws ComponentInstantiationException
Creates a new instance from this type, using a default implementation of a collection when needed. If the type is a primitive, return its default value.

Returns:
the new instance
Throws:
ComponentInstantiationException

findSingleConstructor

public BeanConstructor findSingleConstructor()
                                      throws InvalidComponentException
Returns the single constructor - if there is only one.

Returns:
the single constructor.
Throws:
InvalidComponentException - if there is more than one constructor.


Copyright © 2004-2008 VRaptor. All Rights Reserved.