/** * Encodes this <code>TargetMatchGroup</code> into its XML representation * and writes this encoding to the given <code>OutputStream</code> with no * indentation. * * @param output a stream into which the XML-encoded data is written */ public void encode(OutputStream output) { encode(output, new Indenter(0)); }
/** * 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); }
policy.getTarget().getResourcesSection().getMatchGroups(); for (TargetMatchGroup t : tmg) { if (t.match(context).getResult() > 0) { continue;
groups.add(TargetMatchGroup.getInstance(child, matchType, metaData)); } else if (name.equals("Any" + typeName)) {
policy.getTarget().getResourcesSection().getMatchGroups(); for (TargetMatchGroup t : tmg) { if (t.match(context).getResult() > 0) { continue;
private String extractResourceId(TargetMatchGroup tmg) { ByteArrayOutputStream output = new ByteArrayOutputStream(); tmg.encode(output, new Indenter(4));
MatchResult result = group.match(context);
private String extractResourceId(TargetMatchGroup tmg) { ByteArrayOutputStream output = new ByteArrayOutputStream(); tmg.encode(output, new Indenter(4));
while (it.hasNext()) { TargetMatchGroup group = (TargetMatchGroup)(it.next()); group.encode(output, indenter);