/** * Creates an instance of a <code>Policy</code> object based on a * DOM node. The node must be the root of PolicyType XML object, * otherwise an exception is thrown. * * @param root the DOM root of a PolicyType XML type * * @throws ParsingException if the PolicyType is invalid */ public static Policy getInstance(Node root) throws ParsingException { // first off, check that it's the right kind of node if (! SunxacmlUtil.getNodeName(root).equals("Policy")) { throw new ParsingException("Cannot create Policy from root of " + "type " + SunxacmlUtil.getNodeName(root)); } return new Policy(root); }