Class HashConfig

    • Constructor Detail

      • HashConfig

        public HashConfig()
      • HashConfig

        public HashConfig​(String name,
                          IConfig parent)
    • 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.
        Specified by:
        getNode in class ResourceNode<IConfig>
        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.
        Specified by:
        getNodes in class ResourceNode<IConfig>
        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.
        Specified by:
        getNodes in class ResourceNode<IConfig>
        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.
        Specified by:
        getName in class ResourceNode<IConfig>
        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.
        Specified by:
        createConfig in class WritableResourceNode<IConfig>
        Returns:
        new config node
        Throws:
        de.mhus.lib.errors.MException - if editing is not possible
      • unlink

        public void unlink()
                    throws de.mhus.lib.errors.MException
        Throws:
        de.mhus.lib.errors.MException
      • setConfig

        public IConfig setConfig​(String key,
                                 HashConfig child)
                          throws de.mhus.lib.errors.MException
        Throws:
        de.mhus.lib.errors.MException
      • 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.
        Specified by:
        moveConfig in class WritableResourceNode<IConfig>
        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.
        Specified by:
        removeConfig in class WritableResourceNode<IConfig>
        Parameters:
        config - The config object which should be removed.
        Throws:
        de.mhus.lib.errors.MException - if editing is not possible
      • getInputStream

        public InputStream getInputStream​(String key)
        Description copied from class: ResourceNode
        Return the input stream of a content resource.
        Specified by:
        getInputStream in class ResourceNode<IConfig>
        Parameters:
        key - Name of a rendition or null for the default content
        Returns:
        input stream
      • clear

        public void clear()