use of io.milton.http.XmlWriter.Element in project lobcder by skoulouzis.
the class ResourceTypeValueWriter method writeValue.
@Override
public void writeValue(XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes) {
List<QName> list = (List<QName>) val;
if (list != null && list.size() > 0) {
Element rt = writer.begin(prefix, localName);
for (QName name : list) {
String childNsUri = name.getNamespaceURI();
String childPrefix = nsPrefixes.get(childNsUri);
// so if null write the full uri
if (childPrefix == null) {
String p = lookupUnspecifiedPrefix(childNsUri);
rt.begin(childNsUri, p, name.getLocalPart()).noContent(false);
} else {
// don't write a new line - see http://www.ettrema.com:8080/browse/MIL-83
rt.begin(childPrefix, name.getLocalPart()).noContent(false);
}
}
rt.close();
} else {
writer.writeProperty(prefix, localName);
}
}
use of io.milton.http.XmlWriter.Element in project lobcder by skoulouzis.
the class SupportedReportSetWriter method writeValue.
@Override
public void writeValue(XmlWriter writer, String nsUri, String prefix, String localName, Object val, String href, Map<String, String> nsPrefixes) {
SupportedReportSetList list = (SupportedReportSetList) val;
Element reportSet = writer.begin(WebDavProtocol.DAV_PREFIX + ":supported-report-set").open();
if (list != null) {
for (String s : list) {
Element supportedReport = writer.begin(WebDavProtocol.DAV_PREFIX + ":supported-report").open();
Element report = writer.begin(WebDavProtocol.DAV_PREFIX + ":report").open();
writer.writeProperty(WebDavProtocol.DAV_PREFIX + ":" + s);
report.close();
supportedReport.close();
}
}
reportSet.close();
}
Aggregations