Class DirConfig

    • Constructor Detail

      • DirConfig

        public DirConfig​(File dir)
    • Method Detail

      • getNode

        public IConfig getNode​(String key)
        Description copied from class: ResourceNode
        Returns a inner configuration by the name. Inner configurations are not unique. If more then one configurations exists it will return the first one. if no configuration exists it returns null.
        Overrides:
        getNode in class PropertiesConfig
        Returns:
        the node with the name
      • getNodes

        public List<IConfig> getNodes​(String key)
        Description copied from class: ResourceNode
        Return all inner configurations by the given name. The order is like in the configuration file. This never returns null.
        Overrides:
        getNodes in class PropertiesConfig
        Returns:
        all nodes with the name
      • getNodes

        public List<IConfig> getNodes()
        Description copied from class: ResourceNode
        Return all inner configurations ignoring the name. The order is like in the configuration file. This never returns null.
        Overrides:
        getNodes in class PropertiesConfig
        Returns:
        all nodes
      • getName

        public String getName()
        Description copied from class: ResourceNode
        Return a name of this config element could also be null. The name most time is the name of a sub config.
        Overrides:
        getName in class PropertiesConfig
        Returns:
        node of this node
      • createConfig

        public IConfig createConfig​(String key)
                             throws de.mhus.lib.errors.MException
        Description copied from class: WritableResourceNode
        Create a new config and append it at the end of the list. After creation the element is already at the end of the list.
        Overrides:
        createConfig in class PropertiesConfig
        Returns:
        new config node
        Throws:
        de.mhus.lib.errors.MException - if editing is not possible
      • moveConfig

        public int moveConfig​(IConfig config,
                              int newPos)
                       throws de.mhus.lib.errors.MException
        Description copied from class: WritableResourceNode
        Move the position of the configuration in the hole set of configurations. If the config is not part of the set it will throw an exception. The first position is 0.
        Overrides:
        moveConfig in class PropertiesConfig
        Parameters:
        config - The config object which you want to move
        newPos - Absolute new position or one of the move operators MOVE_UP, MOVE_DOWN, MOVE_FIRST, MOVE_LAST
        Returns:
        The new pos of the config
        Throws:
        de.mhus.lib.errors.MException - if editing is not possible or the position is out of range
      • removeConfig

        public void removeConfig​(IConfig config)
                          throws de.mhus.lib.errors.MException
        Description copied from class: WritableResourceNode
        Remove a config element from the set. If the config element is not part of the set it will not throw an error.
        Overrides:
        removeConfig in class PropertiesConfig
        Parameters:
        config - The config object which should be removed.
        Throws:
        de.mhus.lib.errors.MException - if editing is not possible
      • getDirectory

        public File getDirectory()