|
Marshalling API version 1.0.0.Beta2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.marshalling.reflect.ReflectiveCreator
public class ReflectiveCreator
A creator that simply uses reflection to locate and invoke a zero-argument constructor.
Constructor Summary | |
---|---|
ReflectiveCreator()
|
Method Summary | ||
---|---|---|
|
create(Class<T> clazz)
Create an object instance. |
|
protected
|
getCachedConstructor(Class<T> clazz)
Get a cached constructor for the class. |
|
protected
|
getNewConstructor(Class<T> clazz)
Get the constructor to use for a class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectiveCreator()
Method Detail |
---|
protected <T> Constructor<T> getNewConstructor(Class<T> clazz)
null
if no suitable constructor is available.
clazz
- the class to get a constructor for
null
if none is availableprotected <T> Constructor<T> getCachedConstructor(Class<T> clazz) throws InstantiationException
getNewConstructor()
method is invoked to get it. If no constructor is available then an
InstantiationException
is thrown.
clazz
- the class to look up
InstantiationException
- if no suitable constructor is availablepublic <T> T create(Class<T> clazz) throws InstantiationException, IllegalAccessException
create
in interface Creator
clazz
- the type of object to create
InstantiationException
- if the object could not be instantiated
IllegalAccessException
- if there was an access violation
|
Marshalling API version 1.0.0.Beta2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |