|
SWIXML 1.2 (#140) |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface to represent a generic factory
Field Summary | |
static String |
ADDER_ID
|
static String |
SETTER_ID
Specifies the prefix string for all setter methods |
Method Summary | |
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 . |
Field Detail |
public static final String SETTER_ID
public static final String ADDER_ID
Method Detail |
public Object newInstance() throws Exception
Object
a new instance of a template class
Exception
public Object newInstance(Object parameter) throws Exception
getTemplate()
parameter
- Object
, parameter used during construction or initialization.
Object
a new instance of a template class
Exception
public Object newInstance(Object[] parameter) throws InstantiationException, IllegalAccessException, InvocationTargetException
getTemplate()
and the constructor
parameter are parameter
.
parameter
- Object[]
the parameter array to be passed into the constructor
Object - the created object, an instance of the template class
- Throws:
InstantiationException
- if the creation of the object failed
IllegalAccessException
- if the constructor is either private or protected.
InvocationTargetException
- if the constructor invoked throws an exception
public Class getTemplate()
Class
the backing class templatepublic Collection getSetters()
Collection
- containing all available setter methodspublic Method getSetter(Class template)
template
- Class
type of the setter method's parameter
Method
setter method which maybe invoked on an object of the template classpublic Method getSetter(String name)
name
- String
name of the setter method
Method
- setter method which can be invoked on an object of the template classTypical Use:
Method method = factory.getSetter("set" + Parser.capitalize(attr.getName()));
public 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 method
Method
- setter method which can invoked on an object of the template classTypical Use:
Method method = factory.getSetter( attr.getName() );
|
SWIXML 1.2 (#140) |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |