Interface HstNode


  • public interface HstNode
    • Method Detail

      • getName

        String getName()
        Returns:
        name of the hst node
      • getSubstitutedName

        String getSubstitutedName()

        For example if the HstNode has a getName() '${environment}', or 'foo-${environment}', then if there is a system property 'environment', the '${environment}' will be replaced with the value of the system property. If the HstNode has a getName() with one or more placeholders, then if one of the placeholder cannot be resolved, then an IllegalStateException is thrown

        Returns:
        the substitutedName where property place holders are resolved.
        Throws:
        RuntimeException - If a placeholder cannot be resolved or if the substituted name contains a '.'
      • getNode

        HstNode getNode​(String relPath)
                 throws IllegalArgumentException
        Parameters:
        relPath - a path that does not start with a slash, for example 'foo' or 'foo/bar'.
        Returns:
        the descendant node at relPath or null if it does not exist
        Throws:
        IllegalArgumentException - if relPath is not a valid relPath
      • getNodes

        List<HstNode> getNodes()
        Returns:
        List<{@link HstNode}> of all the child nodes
      • getNodeTypeName

        String getNodeTypeName()
        Returns:
        the node type of the backing provider
      • getMixinNames

        List<String> getMixinNames()
        Returns:
        immutable list of mixin names and empty list in case no mixins present
      • getParent

        HstNode getParent()
        Returns:
        the parent of this HstNode or null when there is no parent.
      • addNode

        void addNode​(String name,
                     HstNode hstNode)
        Adds or replaces a child HST node with the given name. If an HstNode with the given name already exits, it is replaced with the given HST node. Since the HstNode's are used for the HST config model that does not support same name siblings this is not a problem.
        Parameters:
        name - the name for the new HST node.
        hstNode - the HST node to add or replace.
      • removeNode

        void removeNode​(String name)
        removes child node with name and does nothing if not present
        Parameters:
        name -
      • setJCRValueProvider

        void setJCRValueProvider​(JCRValueProvider valueProvider)
        sets the new valueProvider
        Parameters:
        valueProvider -
      • markStaleByPropertyEvent

        void markStaleByPropertyEvent()
        marks the HstNode as stale due to property event: The JCRValueProvider is out-of-date.
      • markStaleByNodeEvent

        void markStaleByNodeEvent()
        marks the HstNode as stale due to node event: The JCRValueProvider might be out-of-date and/or the child nodes.
      • isStale

        boolean isStale()
        Returns:
        true when this HstNode is stale