/** * A private method that handles reading the policy and creates the correct * kind of AbstractPolicy. * Because this makes use of the policyFinder, it cannot be reused between finders. * Consider moving to policyManager, which is not intended to be reused outside * of a policyFinderModule, which is not intended to be reused amongst PolicyFinder instances. */ protected AbstractPolicy handleDocument(Document doc, PolicyFinder policyFinder) throws ParsingException { // handle the policy, if it's a known type Element root = doc.getDocumentElement(); String name = root.getTagName(); // see what type of policy this is if (name.equals("Policy")) { return Policy.getInstance(root); } else if (name.equals("PolicySet")) { return PolicySet.getInstance(root, policyFinder); } else { // this isn't a root type that we know how to handle throw new ParsingException("Unknown root document type: " + name); } }
/** * A private method that handles reading the policy and creates the * correct kind of AbstractPolicy. */ private AbstractPolicy handleDocument(Document doc) throws ParsingException { // handle the policy, if it's a known type Element root = doc.getDocumentElement(); String name = root.getTagName(); // see what type of policy this is if (name.equals("Policy")) { return Policy.getInstance(root); } else if (name.equals("PolicySet")) { return PolicySet.getInstance(root, finder); } else { // this isn't a root type that we know how to handle throw new ParsingException("Unknown root document type: " + name); } }
return Policy.getInstance(root); } else if (name.equals("PolicySet")) { return PolicySet.getInstance(root, finder);
policies.add(PolicySet.getInstance(child, finder)); } else if (name.equals("Policy")) { policies.add(Policy.getInstance(child)); } else if (name.equals("PolicySetIdReference")) { policies.add(PolicyReference.getInstance(child, finder,
try { if (rootName.equals("Policy")) { return Policy.getInstance(root); } else if (rootName.equals("PolicySet")) { return PolicySet.getInstance(root);
try { if (rootName.equals("Policy")) { return Policy.getInstance(root); } else if (rootName.equals("PolicySet")) { return PolicySet.getInstance(root);