Class ResourceNode<T extends ResourceNode<?>>

    • Field Detail

      • compiler

        protected de.mhus.lib.core.directory.ResourceNode.ConfigStringCompiler compiler
    • Constructor Detail

      • ResourceNode

        public ResourceNode()
    • Method Detail

      • getPropertyKeys

        public abstract Collection<String> getPropertyKeys()
        Return all existing keys. A property key is unique.
        Returns:
        all keys
      • getNode

        public abstract T getNode​(String key)
        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.
        Parameters:
        key -
        Returns:
        the node with the name
      • getNodes

        public abstract Collection<T> getNodes()
        Return all inner configurations ignoring the name. The order is like in the configuration file. This never returns null.
        Returns:
        all nodes
      • getNodes

        public abstract Collection<T> getNodes​(String key)
        Return all inner configurations by the given name. The order is like in the configuration file. This never returns null.
        Parameters:
        key -
        Returns:
        all nodes with the name
      • getNodeKeys

        public abstract Collection<String> getNodeKeys()
        Return all possible, existing inner configuration names.
        Returns:
        keys from nodes
      • getName

        public abstract String getName()
                                throws de.mhus.lib.errors.MException
        Return a name of this config element could also be null. The name most time is the name of a sub config.
        Returns:
        node of this node
        Throws:
        de.mhus.lib.errors.MException
      • getInputStream

        public InputStream getInputStream()
        Return the default content input stream.
        Returns:
        input stream
      • getInputStream

        public abstract InputStream getInputStream​(String rendition)
        Return the input stream of a content resource.
        Parameters:
        rendition - Name of a rendition or null for the default content
        Returns:
        input stream
      • getRenditions

        public abstract Collection<String> getRenditions()
        Returns a list of available renditions. Will not return the default rendition.
        Returns:
        The list or null if hasContent() is false
      • getRenditionProperties

        public IProperties getRenditionProperties()
      • getRenditionProperties

        public abstract IProperties getRenditionProperties​(String rendition)
        Returns a set of properties to define the rendition.
        Parameters:
        rendition -
        Returns:
        properties
      • getExtracted

        public String getExtracted​(String key)
        Returns a compiled and executed string. The string is compiled with StringCompiler and is cached. Example is "this is the value of another $anothername,default$" or with the prefix "root.": "This is a root attribute $root.name$ User the "../" prefix to go one back ...
        Parameters:
        key -
        Returns:
        extracted values
        See Also:
        StringCompiler
      • getParent

        public abstract ResourceNode<?> getParent()
        return the parent config if possible.
        Returns:
        parent node
      • getUrl

        public abstract URL getUrl()
      • isValid

        public abstract boolean isValid()
      • hasContent

        public abstract boolean hasContent()
      • getNodeByPath

        public T getNodeByPath​(String path)
      • dump

        public String dump()
                    throws de.mhus.lib.errors.MException
        Throws:
        de.mhus.lib.errors.MException
      • containsValue

        public boolean containsValue​(Object value)