net.sourceforge.cruisecontrol
Class PluginXMLHelper

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.PluginXMLHelper

public class PluginXMLHelper
extends java.lang.Object

Helps mapping the XML to object by instantiating and initializing beans. Some plugins can be self-configuring. For the others, the the configureObject(org.jdom.Element, Object, boolean) defines the operations to be performed.


Constructor Summary
PluginXMLHelper(ProjectHelper plugins)
           
 
Method Summary
 java.lang.Object configure(org.jdom.Element objectElement, java.lang.Class pluginClass, boolean skipChildElements)
          Given a JDOM Element and a class, this method will instantiate an object of type pluginClass, and configure the element.
 java.lang.Object configure(org.jdom.Element objectElement, java.lang.Object pluginInstance, boolean skipChildElements)
          Same as configure(org.jdom.Element, Class, boolean), except that the client already has a pluginInstance.
protected  void configureObject(org.jdom.Element objectElement, java.lang.Object object, boolean skipChildElements)
          Configure the specified plugin object given the JDOM Element defining the plugin configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginXMLHelper

public PluginXMLHelper(ProjectHelper plugins)
Method Detail

configure

public java.lang.Object configure(org.jdom.Element objectElement,
                                  java.lang.Class pluginClass,
                                  boolean skipChildElements)
                           throws CruiseControlException
Given a JDOM Element and a class, this method will instantiate an object of type pluginClass, and configure the element.

When the plugin is self-configuring the plugin takes the responsibility of configuring itself

configure(org.jdom.Element, Object, boolean) to use when one already has an instance.

Parameters:
objectElement - the JDOM Element defining the plugin configuration
pluginClass - the class to instantiate
skipChildElements - false to recurse the configuration, true otherwise
Returns:
fully configured Object
Throws:
CruiseControlException - if the plugin class cannot be instantiated, if the configuration fails
See Also:
configure(org.jdom.Element, Object, boolean)

configure

public java.lang.Object configure(org.jdom.Element objectElement,
                                  java.lang.Object pluginInstance,
                                  boolean skipChildElements)
                           throws CruiseControlException
Same as configure(org.jdom.Element, Class, boolean), except that the client already has a pluginInstance.

Throws:
CruiseControlException - if the configuration fails

configureObject

protected void configureObject(org.jdom.Element objectElement,
                               java.lang.Object object,
                               boolean skipChildElements)
                        throws CruiseControlException
Configure the specified plugin object given the JDOM Element defining the plugin configuration.

Parameters:
objectElement - the JDOM Element defining the plugin configuration
object - the instance to configure to instantiate
skipChildElements - false to recurse the configuration, true otherwise
Throws:
CruiseControlException