Package jmri.profile

Interface AuxiliaryConfiguration

All Known Implementing Classes:
JmriConfiguration, ProfileConfiguration

public interface AuxiliaryConfiguration
JMRI local copy of the NetBeans Platform org.netbeans.spi.project.AuxiliaryConfiguration.

Note This uses Element instead of Element because the NetBeans Platform uses the DOM model included in the JRE.

  • Method Details

    • getConfigurationFragment

      @CheckForNull Element getConfigurationFragment​(@Nonnull String elementName, @Nonnull String namespace, boolean shared)
      Get a configuration fragment as an XML element.

      Multiple elements in a configuration file can have the same name as long as they have different namespaces. If using versioned namespaces, this would allow two different versions of JMRI with incompatible preferences for a given element to use the same name without stomping on each other.

      Note: Use JDOMUtil.toJDOMElement(org.w3c.dom.Element) to convert a non-null result to a JDOM Element.

      Parameters:
      elementName - the name of the element.
      namespace - the namespace of the element.
      shared - true if the fragment is for all computers using this profile, false if the fragment is for just the current computer.
      Returns:
      the matching Element or null if a matching element cannot be found.
    • putConfigurationFragment

      void putConfigurationFragment​(@Nonnull Element fragment, boolean shared)
      Store a configuration fragement as an XML element.

      Multiple elements in a configuration file can have the same name as long as they have different namespaces. If using versioned namespaces, this would allow two different versions of JMRI with incompatible preferences for a given element to use the same name without stomping on each other.

      Note: Use JDOMUtil.toW3CElement(org.jdom2.Element) to convert a JDOM Element to a W3C Element. The JDOM element must have a namespace associated with it.

      Parameters:
      fragment - the XML element. It must have a valid namespace property.
      shared - true if the fragment is for all computers using this profile, false if the fragment is for just the current computer.
    • removeConfigurationFragment

      boolean removeConfigurationFragment​(String elementName, String namespace, boolean shared)
      Remove a configuration fragment from the configuration.

      Multiple elements in a configuration file can have the same name as long as they have different namespaces. If using versioned namespaces, this would allow two different versions of JMRI with incompatible preferences for a given element to use the same name without stomping on each other.

      Parameters:
      elementName - the name of the element.
      namespace - the namespace of the element.
      shared - true if the fragment is for all computers using this profile, false if the fragment is for just the current computer.
      Returns:
      true if the fragment could be removed, false otherwise.