if (!(m instanceof URLRewriteMediator)) {
handleException("Unsupported mediator passed in for serialization : " + m.getType());
return null;
}
URLRewriteMediator mediator = (URLRewriteMediator) m;
OMElement rewrite = fac.createOMElement("rewrite", synNS);
String inProperty = mediator.getInputProperty();
String outProperty = mediator.getOutputProperty();
if (inProperty != null) {
rewrite.addAttribute(fac.createOMAttribute("inProperty", nullNS,
inProperty));
}
if (outProperty != null) {
rewrite.addAttribute(fac.createOMAttribute("outProperty", nullNS,
outProperty));
}
saveTracingState(rewrite, mediator);
List<RewriteRule> rules = mediator.getRules();
try {
for (RewriteRule r : rules) {
OMElement rule = serializeRule(r);
rewrite.addChild(rule);
}