org.apache.commons.clazz.bean
Class BeanClazzConstructorInstanceFactory

java.lang.Object
  extended by org.apache.commons.clazz.common.ClazzElementSupport
      extended by org.apache.commons.clazz.common.ClazzFeatureSupport
          extended by org.apache.commons.clazz.bean.BeanClazzConstructorInstanceFactory
All Implemented Interfaces:
ClazzElement, ClazzFeature, ClazzInstanceFactory

public class BeanClazzConstructorInstanceFactory
extends ClazzFeatureSupport
implements ClazzInstanceFactory

An instance factory based on a Constructor. The first argument of the Constructor is always of type Clazz. This parameter is not included in the factory signature.

Version:
$Id: BeanClazzConstructorInstanceFactory.java 155436 2005-02-26 13:17:48Z dirkv $
Author:
Dmitri Plotnikov

Constructor Summary
BeanClazzConstructorInstanceFactory(Clazz declaringClazz, Constructor constructor)
          Constructor for ReflectedClazzProperty.
 
Method Summary
 Constructor getConstructor()
           
 String getName()
          Returns the name of the factory.
 Clazz[] getParameterClazzes()
          Returns the factory parameter types.
 String getSignature()
          Returns the signature of the factory in the format "factoryName(paramType1,...)", where "factoryName" may be empty.
 Object newInstance(Object[] parameters)
          Creates a new instance.
 String toString()
           
 
Methods inherited from class org.apache.commons.clazz.common.ClazzFeatureSupport
getDeclaringClazz
 
Methods inherited from class org.apache.commons.clazz.common.ClazzElementSupport
getAttribute, getAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.commons.clazz.ClazzFeature
getDeclaringClazz
 
Methods inherited from interface org.apache.commons.clazz.ClazzElement
getAttribute, getAttributes
 

Constructor Detail

BeanClazzConstructorInstanceFactory

public BeanClazzConstructorInstanceFactory(Clazz declaringClazz,
                                           Constructor constructor)
Constructor for ReflectedClazzProperty.

Method Detail

getConstructor

public Constructor getConstructor()

getName

public String getName()
Description copied from interface: ClazzInstanceFactory
Returns the name of the factory. May be null.

Specified by:
getName in interface ClazzInstanceFactory

getSignature

public String getSignature()
Description copied from interface: ClazzInstanceFactory
Returns the signature of the factory in the format "factoryName(paramType1,...)", where "factoryName" may be empty.

Specified by:
getSignature in interface ClazzInstanceFactory
See Also:
ClazzOperation.getSignature()

getParameterClazzes

public Clazz[] getParameterClazzes()
Description copied from interface: ClazzInstanceFactory
Returns the factory parameter types.

Specified by:
getParameterClazzes in interface ClazzInstanceFactory
See Also:
ClazzOperation.getParameterClazzes()

newInstance

public Object newInstance(Object[] parameters)
Description copied from interface: ClazzInstanceFactory
Creates a new instance.

Specified by:
newInstance in interface ClazzInstanceFactory
Parameters:
parameters - is the list of parameters. It can be null if the factory takes no parameters.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.