use of org.apache.ivy.core.module.descriptor.DependencyDescriptorMediator in project ant-ivy by apache.
the class XmlModuleDescriptorWriter method printAllMediators.
private static void printAllMediators(ModuleDescriptor md, PrintWriter out) {
Map<MapMatcher, DependencyDescriptorMediator> mediators = md.getAllDependencyDescriptorMediators().getAllRules();
for (Map.Entry<MapMatcher, DependencyDescriptorMediator> mediatorRule : mediators.entrySet()) {
MapMatcher matcher = mediatorRule.getKey();
DependencyDescriptorMediator mediator = mediatorRule.getValue();
if (mediator instanceof OverrideDependencyDescriptorMediator) {
OverrideDependencyDescriptorMediator oddm = (OverrideDependencyDescriptorMediator) mediator;
out.print(String.format("\t\t<override org=\"%s\" module=\"%s\" matcher=\"%s\"", XMLHelper.escape(matcher.getAttributes().get(IvyPatternHelper.ORGANISATION_KEY)), XMLHelper.escape(matcher.getAttributes().get(IvyPatternHelper.MODULE_KEY)), XMLHelper.escape(matcher.getPatternMatcher().getName())));
if (oddm.getBranch() != null) {
out.print(" branch=\"" + XMLHelper.escape(oddm.getBranch()) + "\"");
}
if (oddm.getVersion() != null) {
out.print(" rev=\"" + XMLHelper.escape(oddm.getVersion()) + "\"");
}
out.println("/>");
} else {
Message.verbose("ignoring unhandled DependencyDescriptorMediator: " + mediator.getClass());
}
}
}
Aggregations