/** * Encodes this class into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<VariableReference VariableId=\"" + variableId + "\"/>"); }
/** * Encodes this <code>MapFunction</code> into its 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) { PrintStream out = new PrintStream(output); out.println(indenter.makeString() + "<Function FunctionId=\"" + NAME_MAP + "\"/>"); }
/** * Encodes this selector into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); String tag = "<AttributeSelector RequestContextPath=\"" + contextPath + "\" DataType=\"" + type.toString() + "\""; if (mustBePresent) tag += " MustBePresent=\"true\""; tag += "/>"; out.println(indent + tag); }
@Override public void encode(OutputStream output, Indenter indenter) { // setup the formatting & outstream stuff String indent = indenter.makeString(); PrintStream out = new PrintStream(output); // write out the encoded form out.append(indent); encodeToStream(out); }
/** * Encodes this <code>HigherOrderFunction</code> into its 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) { PrintStream out = new PrintStream(output); out.println(indenter.makeString() + "<Function FunctionId=\"" + getIdentifier().toString() + "\"/>"); }
/** * Encodes this <code>FunctionBase</code> into its 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) { PrintStream out = new PrintStream(output); out.println(indenter.makeString() + "<Function FunctionId=\"" + getFunctionName() + "\"/>"); }
@Override public void encode(OutputStream output, Indenter indenter) { // setup the formatting & outstream stuff String indent = indenter.makeString(); PrintStream out = new PrintStream(output); // write out the encoded form out.append(indent); encodeToStream(out); }
/** * Encodes this designator into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); String tag = "<" + targetTypes[target] + "AttributeDesignator"; if ((target == SUBJECT_TARGET) && (subjectCategory != null)) tag += " SubjectCategory=\"" + subjectCategory.toString() + "\""; tag += " AttributeId=\"" + id.toString() + "\""; tag += " DataType=\"" + type.toString() + "\""; if (issuer != null) tag += " Issuer=\"" + issuer.toString() + "\""; if (mustBePresent) tag += " MustBePresent=\"true\""; tag += "/>"; out.println(indent + tag); }
/** * Encodes this <code>AttributeValue</code> into its XML representation * and writes this encoding to the given <code>OutputStream</code> with * indentation. This will always produce the version used in a * policy rather than that used in a request, so this is equivalent * to calling <code>encodeWithTags(true)</code> and then stuffing that * into a stream. * * @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) { PrintStream out = new PrintStream(output); out.println(indenter.makeString() + encodeWithTags(true)); }
/** * Encodes this attribute into its 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) { // setup the formatting & outstream stuff String indent = indenter.makeString(); PrintStream out = new PrintStream(output); // write out the encoded form out.println(indent + encode()); }
/** * Encodes this <code>PolicyReference</code> into its 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) { PrintStream out = new PrintStream(output); String encoded = indenter.makeString(); if (policyType == POLICY_REFERENCE) { out.println(encoded + "<PolicyIdReference" + encodeConstraints() + ">" + reference.toString() + "</PolicyIdReference>"); } else { out.println(encoded + "<PolicySetIdReference" + encodeConstraints() + ">" + reference.toString() + "</PolicySetIdReference>"); } }
/** * Encodes the object in XML */ private void encodeStatusCode(PrintStream out, Indenter indenter, Iterator iterator) { String in = indenter.makeString(); String code = (String)(iterator.next()); if (iterator.hasNext()) { indenter.in(); out.println(in + "<StatusCode Value=\"" + code + "\">"); encodeStatusCode(out, indenter, iterator); out.println(in + "</StatusCode>"); indenter.out(); } else { out.println(in + "<StatusCode Value=\"" + code + "\"/>"); } }
/** * Private helper function to encode the subjects */ private void encodeSubject(Subject subject, PrintStream out, Indenter indenter) { char [] indent = indenter.makeString().toCharArray(); out.print(indent); out.append("<Subject SubjectCategory=\"") .append(subject.getCategory().toString()).append('"'); List subjectAttrs = subject.getAttributesAsList(); if (subjectAttrs.size() == 0) { // there's nothing in this Subject, so just close the tag out.println("/>"); } else { // there's content, so fill it in out.println('>'); encodeAttributes(subjectAttrs, out, indenter); out.print(indent); out.println("</Subject>"); } }
/** * Encodes this status data into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<Status>"); indenter.in(); encodeStatusCode(out, indenter, code.iterator()); if (message != null) out.println(indenter.makeString() + "<StatusMessage>" + message + "</StatusMessage>"); if (detail != null) out.println(detail.getEncoded()); indenter.out(); out.println(indent + "</Status>"); }
public void encode(OutputStream output, Indenter indenter, String nsURI) { // Make a PrintStream for a nicer printing interface PrintStream out = new PrintStream(output); // Prepare the indentation string String topIndent = indenter.makeString(); out.println(topIndent + "<Response xmlns='"+nsURI+"'>"); // Now write the XML... // Go through all results Iterator it = results.iterator(); indenter.in(); while (it.hasNext()) { Result result = (Result)(it.next()); result.encode(out, indenter); } indenter.out(); // Finish the XML for a response out.println(topIndent + "</Response>"); } }
/** * Encodes this class into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<VariableDefinition VariableId=\"" + variableId + "\">"); indenter.in(); expression.encode(output, indenter); out.println("</VariableDefinition>"); indenter.out(); }
/** * Private helper that encodes the parameters based on the type */ private void encodeParamaters(OutputStream output, Indenter indenter, String prefix, String id) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); Iterator it = getParameters().iterator(); out.println(indent + "<" + prefix + "CombinerParameters " + prefix + "IdRef=\"" + id + "\">"); indenter.in(); while (it.hasNext()) { CombinerParameter param = (CombinerParameter)(it.next()); param.encode(output, indenter); } out.println(indent + "</" + prefix + "CombinerParameters>"); indenter.out(); }
/** * Encodes this <code>Apply</code> into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<Apply FunctionId=\"" + function.getIdentifier() + "\">"); indenter.in(); Iterator it = xprs.iterator(); while (it.hasNext()) { Expression xpr = (Expression)(it.next()); xpr.encode(output, indenter); } indenter.out(); out.println(indent + "</Apply>"); }
/** * Encodes this <code>TargetMatch</code> into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); String tagName = NAMES[type] + "Match"; out.println(indent + "<" + tagName + " MatchId=\"" + function.getIdentifier().toString()+ "\">"); indenter.in(); attrValue.encode(output, indenter); eval.encode(output, indenter); indenter.out(); out.println(indent + "</" + tagName + ">"); }
/** * Encodes this parameter into its 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) { PrintStream out = new PrintStream(output); String indent = indenter.makeString(); out.println(indent + "<CombinerParameter ParameterName=\"" + getName() + "\">"); indenter.in(); getValue().encode(output, indenter); out.println(indent + "</CombinerParameter>"); indenter.out(); }