com.atlassian.configurable
Class XMLObjectConfigurationFactory

java.lang.Object
  extended by com.atlassian.configurable.XMLObjectConfigurationFactory
All Implemented Interfaces:
ObjectConfigurationFactory

public class XMLObjectConfigurationFactory
extends Object
implements ObjectConfigurationFactory

This class retrieves an Object Configuration with a particular id.

The Object Configuration must be unique as a user will set their own parameters on the object during its lifetime.


Constructor Summary
XMLObjectConfigurationFactory()
          Creates a new XMLObjectConfigurationFactory object.
 
Method Summary
 ObjectConfiguration getObjectConfiguration(String id, Map params)
          This function retrieves an ObjectConfiguration based on a specified identifier, N.B.
 boolean hasObjectConfiguration(String id)
          Does this factory know about an ObjectConfiguration with the specified id
 void loadObjectConfiguration(String xmlFile, String id)
          This procedure loads an xml file into a holder object which is then used to construct a real object when the get function is called.
 void loadObjectConfiguration(String xmlFile, String id, ClassLoader classLoader)
          This procedure loads an xml file into a holder object which is then used to construct a real object when the get function is called.
 void loadObjectConfigurationFromElement(org.dom4j.Element element, ObjectDescriptor od, String id)
           
 void loadObjectConfigurationFromElement(org.dom4j.Element element, ObjectDescriptor od, String id, ClassLoader classLoader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLObjectConfigurationFactory

public XMLObjectConfigurationFactory()
Creates a new XMLObjectConfigurationFactory object.

Method Detail

hasObjectConfiguration

public boolean hasObjectConfiguration(String id)
Does this factory know about an ObjectConfiguration with the specified id

Specified by:
hasObjectConfiguration in interface ObjectConfigurationFactory
Parameters:
id - Identifier for the object configuration to retrieve.
Returns:
object configuration is available.

getObjectConfiguration

public ObjectConfiguration getObjectConfiguration(String id,
                                                  Map params)
                                           throws ObjectConfigurationException
This function retrieves an ObjectConfiguration based on a specified identifier, N.B. must be mutable

Specified by:
getObjectConfiguration in interface ObjectConfigurationFactory
Parameters:
id - Identifier for the object configuration to retrieve.
Returns:
a ObjectConfiguration
Throws:
ObjectConfigurationException

loadObjectConfiguration

public void loadObjectConfiguration(String xmlFile,
                                    String id)
                             throws ObjectConfigurationException
This procedure loads an xml file into a holder object which is then used to construct a real object when the get function is called. Uses the same class loader that loaded this instance of XMLObjectConfigurationFactory to load the xml file and descriptor classes.

Parameters:
xmlFile - the name of the resource on the classpath from which to load the config.
id - Identifier for the object configuration to retrieve.
Throws:
ObjectConfigurationException - if something is really wrong

loadObjectConfiguration

public void loadObjectConfiguration(String xmlFile,
                                    String id,
                                    ClassLoader classLoader)
                             throws ObjectConfigurationException
This procedure loads an xml file into a holder object which is then used to construct a real object when the get function is called. Uses the provided class loader to load the xml file and descriptor classes.

Specified by:
loadObjectConfiguration in interface ObjectConfigurationFactory
Parameters:
xmlFile - the name of the resource on the classpath from which to load the config.
id - Identifier for the object configuration to retrieve.
classLoader - ClassLoader to use to load ObjectDescriptor classes and the xml file
Throws:
ObjectConfigurationException - if something is really wrong

loadObjectConfigurationFromElement

public void loadObjectConfigurationFromElement(org.dom4j.Element element,
                                               ObjectDescriptor od,
                                               String id)

loadObjectConfigurationFromElement

public void loadObjectConfigurationFromElement(org.dom4j.Element element,
                                               ObjectDescriptor od,
                                               String id,
                                               ClassLoader classLoader)
Specified by:
loadObjectConfigurationFromElement in interface ObjectConfigurationFactory


Copyright © 2002-2014 Atlassian. All Rights Reserved.