Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| SWIXML 2.0 beta 1 (#201)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.swixml
Interface Factory

All Known Implementing Classes:
  DefaultFactory

    public interface Factory

An interface to represent a generic factory

Version:
  $Revision: 1.1 $
Author:
  Wolf Paulus

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

### SETTER_ID

    static final String SETTER_ID

  Specifies the prefix string for all setter methods

  See Also:
    Constant Field Values

### ADDER_ID

    static final String ADDER_ID

See Also:
  Constant Field Values

Method Detail

### newInstance

    Object newInstance()
                       throws Exception

  Create a new component instance

  Returns:
    instance `Object` a new instance of a template class
  Throws:
    `Exception`

### newInstance

    Object newInstance(Object parameter)
                       throws Exception

  Creates a new Object which class is `getTemplate()`

  Parameters:
    `parameter` - `Object`, parameter used during construction or initialization.
  Returns:
    instance `Object` a new instance of a template class
  Throws:
    `Exception`

### newInstance

    Object newInstance(Object[] parameter)
                       throws InstantiationException,
                              IllegalAccessException,
                              InvocationTargetException

  Creates a new Object which class is `getTemplate()` and the constructor parameter are `parameter`.

  Parameters:
    `parameter` - `Object[]` the parameter array to be passed into the constructor
  Returns:
    `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

### getTemplate

    Class getTemplate()

  Returns:
    class - `Class` the backing class template

### getSetters

    Collection getSetters()

  Returns:
    `Collection` - containing all available setter methods

### getSetter

    Method getSetter(Class template)

  Returns a setter method, which accepts a parameter of the given type

  Parameters:
    `template` - `Class` type of the setter method's parameter
  Returns:
    `Method` setter method which maybe invoked on an object of the template class

### getSetter

    Method getSetter(String name)

  Returns a setter method by name

  Parameters:
    `name` - `String` name of the setter method
  Returns:
    `Method` - setter method which can be invoked on an object of the template class
  See Also:
    `

        Typical Use:
         Method method = factory.getSetter("set" + Parser.capitalize(attr.getName()));

    `

### guessSetter

    Method guessSetter(String name)

  Returns a setter method by a Attribute name. Differently to the `getSetter` method, here the attibute name can be used directly and case doesn't matter.

  Parameters:
    `name` - `String` name of the setter method
  Returns:
    `Method` - setter method which can invoked on an object of the template class
  See Also:
    `

        Typical Use:
         Method method = factory.getSetter( attr.getName() );

    `

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| SWIXML 2.0 beta 1 (#201)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 - 2011 - Wolf Paulus - wolfpaulus.com. All rights reserved.