Example usage for java.security.cert PolicyNode PolicyNode

List of usage examples for java.security.cert PolicyNode PolicyNode

Introduction

In this page you can find the example usage for java.security.cert PolicyNode PolicyNode.

Prototype

PolicyNode

Source Link

Usage

From source file:Main.java

/**
 * Creates policy tree stub containing two <code>PolicyNode</code>s
 * for testing purposes/*from  w  w w. j a  va2s  .co  m*/
 *
 * @return root <code>PolicyNode</code> of the policy tree
 */
public static PolicyNode getPolicyTree() {
    return new PolicyNode() {
        final PolicyNode parent = this;

        public int getDepth() {
            // parent
            return 0;
        }

        public boolean isCritical() {
            return false;
        }

        public String getValidPolicy() {
            return null;
        }

        public PolicyNode getParent() {
            return null;
        }

        public Iterator<PolicyNode> getChildren() {
            PolicyNode child = new PolicyNode() {
                public int getDepth() {
                    // child
                    return 1;
                }

                public boolean isCritical() {
                    return false;
                }

                public String getValidPolicy() {
                    return null;
                }

                public PolicyNode getParent() {
                    return parent;
                }

                public Iterator<PolicyNode> getChildren() {
                    return null;
                }

                public Set<String> getExpectedPolicies() {
                    return null;
                }

                public Set<? extends PolicyQualifierInfo> getPolicyQualifiers() {
                    return null;
                }
            };
            HashSet<PolicyNode> s = new HashSet<PolicyNode>();
            s.add(child);
            return s.iterator();
        }

        public Set<String> getExpectedPolicies() {
            return null;
        }

        public Set<? extends PolicyQualifierInfo> getPolicyQualifiers() {
            return null;
        }
    };
}