Class XMLObjectConfigurationFactory

java.lang.Object
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 Details

    • XMLObjectConfigurationFactory

      public XMLObjectConfigurationFactory()
      Creates a new XMLObjectConfigurationFactory object.
  • Method Details

    • 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(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 interface ObjectConfigurationFactory