/** * Creates a <code>Target</code> based on its DOM node. * * @param root the node to parse for the target group * @param matchType the type of the match * @param metaData meta-date associated with the policy * * @return a new <code>TargetMatchGroup</code> constructed by parsing * * @throws ParsingException if the DOM node is invalid */ public static TargetMatchGroup getInstance(Node root, int matchType, PolicyMetaData metaData) throws ParsingException { List matches = new ArrayList(); NodeList children = root.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); String name = SunxacmlUtil.getNodeName(child); if (name.equals(TargetMatch.NAMES[matchType] + "Match")) { matches.add(TargetMatch.getInstance(child, matchType, metaData)); } } return new TargetMatchGroup(matches, matchType); }