Package com.atlassian.configurable
Class XMLObjectConfigurationFactory
java.lang.Object
com.atlassian.configurable.XMLObjectConfigurationFactory
- All Implemented Interfaces:
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
ConstructorDescriptionCreates a new XMLObjectConfigurationFactory object. -
Method Summary
Modifier and TypeMethodDescriptiongetObjectConfiguration
(String id, Map params) This function retrieves an ObjectConfiguration based on a specified identifier, N.B.boolean
Does this factory know about an ObjectConfiguration with the specified idvoid
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
(com.atlassian.plugin.module.Element element, ObjectDescriptor od, String id) void
loadObjectConfigurationFromElement
(com.atlassian.plugin.module.Element element, ObjectDescriptor od, String id, ClassLoader classLoader)
-
Constructor Details
-
XMLObjectConfigurationFactory
public XMLObjectConfigurationFactory()Creates a new XMLObjectConfigurationFactory object.
-
-
Method Details
-
hasObjectConfiguration
Does this factory know about an ObjectConfiguration with the specified id- Specified by:
hasObjectConfiguration
in interfaceObjectConfigurationFactory
- 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 interfaceObjectConfigurationFactory
- Parameters:
id
- Identifier for the object configuration to retrieve.- Returns:
- a ObjectConfiguration
- Throws:
ObjectConfigurationException
-
loadObjectConfiguration
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 interfaceObjectConfigurationFactory
- 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(com.atlassian.plugin.module.Element element, ObjectDescriptor od, String id) -
loadObjectConfigurationFromElement
public void loadObjectConfigurationFromElement(com.atlassian.plugin.module.Element element, ObjectDescriptor od, String id, ClassLoader classLoader) - Specified by:
loadObjectConfigurationFromElement
in interfaceObjectConfigurationFactory
-