Interface PropertyHandler

    • Method Detail

      • hasProperties

        boolean hasProperties()
        Tests, if the implementing object has properties. This can be tested by looking for a generic root node.
        Returns:
        true, if a property is set, false otherwise.
      • getPropertyRootNode

        PropertyTreeNode getPropertyRootNode()
        Returns the propertyRootNode of the implementing object.
        Returns:
        the propertyRootNode if set. Null otherwise.
      • getPropertyNode

        PropertyTreeNode getPropertyNode​(String key)
        Search for a property node within the whole tree of properties. The first node with a given name will be returned. The generic root node cannot be returned. The used search algorithm to iterate the property tree is BFS.
        Parameters:
        key - the name of the property to search for
        Returns:
        the found property node, or null, if there are no properties or no node has this key
      • getAllPropertyNodes

        List<PropertyTreeNode> getAllPropertyNodes​(String key)
        Searches for all property nodes within the property tree. The result will never be null (but could be an empty set).
        Parameters:
        key - the key of the property
        Returns:
        a set with the found property nodes
      • getAllProperties

        List<String> getAllProperties​(String key)
        Searches for all property values within the property tree. The result will never be null (but could be an empty set).
        Parameters:
        key - the key of the property
        Returns:
        a set with the found property nodes
      • addProperty

        void addProperty​(PropertyTreeNode node)
        Add a property to the property tree. This property node (or subtree) will be added right below the generic root.
        Parameters:
        node - the node to be added
      • addProperty

        void addProperty​(String name,
                         String value)
        Add a property to the property tree. This property node (or subtree) will be added right below the generic root.
        Parameters:
        name - the name of the node to add
        value - the value of the node to add
        See Also:
        addProperty(PropertyTreeNode)
      • removeProperty

        String removeProperty​(String name)
        Remove any node from the property tree. The first node to be found with this name, will be removed (including all children).
        Parameters:
        name - the name of the node to be removed
        Returns:
        the value of the removed node, or null, if no node could be removed
      • getProperty

        String getProperty​(String propertyName)
        Gets the value of the node that has the given name and is found first. If the property does not exists, null will be returned.
        Parameters:
        propertyName - The name of the property.
        Returns:
        The property value or null if the property does not exists.
        See Also:
        getPropertyNode(String)
      • getPropertyNames

        String[] getPropertyNames()
        To receive all properties that are set by addProperty(String, String) use this method. Every name contained in the complete tree will be considered. The result will never be null.
        Returns:
        An array of defined property names.