/** * Encodes this <code>Rule</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)); }
/** * Encodes this element's <code>Rule</code> and parameters into their * XML representation and writes this encoding to the given * <code>OutputStream</code> with indentation. * * @param output a stream into which the XML-encoded data is written * @param indenter an object that creates indentation strings */ public void encode(OutputStream output, Indenter indenter) { Iterator it = getParameters().iterator(); if (it.hasNext()) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<RuleCombinerParameters RuleIdRef=\"" + getRule().getId() + "\">"); indenter.in(); while (it.hasNext()) { CombinerParameter param = (CombinerParameter)(it.next()); param.encode(output, indenter); } out.println(indent + "</RuleCombinerParameters>"); indenter.out(); } getRule().encode(output, indenter); }