java.lang.Object
eu.europa.esig.dss.validation.process.bbb.xcv.sub.checks.PolicyTreeNode

public class PolicyTreeNode extends Object
Represents a valid_policy_tree node (leaf) as per RFC 5280
  • Constructor Details

    • PolicyTreeNode

      public PolicyTreeNode(String policyOid, String policyQualifier)
      Default constructor
      Parameters:
      policyOid - String OID of the policy
      policyQualifier - String qualifier URL of the policy
  • Method Details

    • initTree

      public static PolicyTreeNode initTree()
      Initialize the first node of the valid policy tree (containing anyPolicy as the first element)
      Returns:
      PolicyTreeNode
    • isAnyPolicy

      public boolean isAnyPolicy()
      Returns if the current policy node represents anyPolicy
      Returns:
      TRUE if the policy node represents anyPolicy, FALSE otherwise
    • addChildNodeIfMatch

      public boolean addChildNodeIfMatch(PolicyTreeNode policyNode)
      This method adds a policyNode to the node's children, when applicable
      Parameters:
      policyNode - PolicyTreeNode to add if applicable
      Returns:
      whether the node has been added
    • createAnyPolicyChildren

      public Set<PolicyTreeNode> createAnyPolicyChildren()
      Creates any policy children corresponding to the current policy node
      Returns:
      set of PolicyTreeNodes
    • deleteNodesAtLevelWithoutChildren

      public PolicyTreeNode deleteNodesAtLevelWithoutChildren(int depthLevel)
      Removes nodes at the given depthLevel if not having children nodes
      Parameters:
      depthLevel - the level to remove nodes without children from (0 is considered as the current node)
      Returns:
      PolicyTreeNode