public interface Factory
| Modifier and Type | Field and Description |
|---|---|
static String |
ADDER_ID |
static String |
SETTER_ID
Specifies the prefix string for all setter methods
|
| Modifier and Type | Method and Description |
|---|---|
Method |
getSetter(Class template)
Returns a setter method, which accepts a parameter of the given type
|
Method |
getSetter(String name)
Returns a setter method by name
|
Collection |
getSetters() |
Class |
getTemplate() |
Method |
guessSetter(String name)
Returns a setter method by a Attribute name.
|
Object |
newInstance()
Create a new component instance
|
Object |
newInstance(Object parameter)
Creates a new Object which class is
getTemplate() |
Object |
newInstance(Object[] parameter)
Creates a new Object which class is
getTemplate() and the constructor
parameter are parameter. |
static final String SETTER_ID
static final String ADDER_ID
Object newInstance() throws Exception
Object a new instance of a template classExceptionObject newInstance(Object parameter) throws Exception
getTemplate()parameter - Object, parameter used during construction or initialization.Object a new instance of a template classExceptionObject newInstance(Object[] parameter) throws InstantiationException, IllegalAccessException, InvocationTargetException
getTemplate() and the constructor
parameter are parameter.parameter - Object[] the parameter array to be passed into the constructorObject - the created object, an instance of the template classInstantiationException - if the creation of the object failedIllegalAccessException - if the constructor is either private or protected.InvocationTargetException - if the constructor invoked throws an exceptionClass getTemplate()
Class the backing class templateCollection getSetters()
Collection - containing all available setter methodsMethod getSetter(Class template)
template - Class type of the setter method's parameterMethod setter method which maybe invoked on an object of the template classMethod getSetter(String name)
name - String name of the setter methodMethod - setter method which can be invoked on an object of the template classTypical Use:
Method method = factory.getSetter("set" + Parser.capitalize(attr.getName()));
Method guessSetter(String name)
getSetter method, here the attibute name can be used directly and
case doesn't matter.name - String name of the setter methodMethod - setter method which can invoked on an object of the template classTypical Use:
Method method = factory.getSetter( attr.getName() );
Copyright © 2002 - 2013 - Wolf Paulus - wolfpaulus.com. All rights reserved.