use of org.xwiki.rest.model.jaxb.MapEntry in project xwiki-platform by xwiki.
the class ModelFactory method toRestMapEntry.
public MapEntry toRestMapEntry(String key, java.lang.Object value) throws XWikiRestException {
MapEntry restMapEntry = this.objectFactory.createMapEntry();
restMapEntry.setKey(key);
try {
restMapEntry.setValue(this.jaxbConverter.serializeAny(value));
} catch (ParserConfigurationException e) {
throw new XWikiRestException("Failed to serialize property [" + key + "] with value [" + value + "]", e);
}
return restMapEntry;
}
use of org.xwiki.rest.model.jaxb.MapEntry in project xwiki-platform by xwiki.
the class ModelFactory method toJobRequest.
public DefaultRequest toJobRequest(JobRequest restJobRequest) {
DefaultRequest request = new DefaultRequest();
if (restJobRequest.getId() != null) {
request.setId(restJobRequest.getId().getElements());
}
request.setInteractive(restJobRequest.isInteractive());
request.setVerbose(restJobRequest.isVerbose());
request.setStatusSerialized(restJobRequest.isStatusSerialized());
request.setStatusLogIsolated(restJobRequest.isStatusLogIsolated());
for (MapEntry restEntry : restJobRequest.getProperties()) {
request.setProperty(restEntry.getKey(), this.jaxbConverter.unserializeAny(restEntry.getValue()));
}
return request;
}
Aggregations