Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Bug 1293 - Switch packaging of config-util to bundle"
[controller.git]
/
opendaylight
/
md-sal
/
sal-rest-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
rest
/
impl
/
StructuredDataToXmlProvider.java
diff --git
a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
index e5a56cf47566c6ca4d3d8e1113b817706b404d71..3a235ced858a4be9af6dc24d9152602ff806bc09 100644
(file)
--- a/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
+++ b/
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/StructuredDataToXmlProvider.java
@@
-11,7
+11,6
@@
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
@@
-26,7
+25,6
@@
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-
import org.opendaylight.controller.sal.rest.api.Draft02;
import org.opendaylight.controller.sal.rest.api.RestconfService;
import org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.controller.sal.rest.api.Draft02;
import org.opendaylight.controller.sal.rest.api.RestconfService;
import org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException;
@@
-70,7
+68,7
@@
public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
@Override
public boolean isWriteable(final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) {
@Override
public boolean isWriteable(final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType) {
- return type.equals(
StructuredData.class
);
+ return type.equals(
StructuredData.class
);
}
@Override
}
@Override
@@
-90,6
+88,11
@@
public enum StructuredDataToXmlProvider implements MessageBodyWriter<StructuredD
final Transformer trans;
try {
trans = TRANSFORMER.get();
final Transformer trans;
try {
trans = TRANSFORMER.get();
+ if (t.isPrettyPrintMode()) {
+ trans.setOutputProperty(OutputKeys.INDENT, "yes");
+ } else {
+ trans.setOutputProperty(OutputKeys.INDENT, "no");
+ }
} catch (RuntimeException e) {
throw new RestconfDocumentedException(e.getMessage(), ErrorType.TRANSPORT,
ErrorTag.OPERATION_FAILED);
} catch (RuntimeException e) {
throw new RestconfDocumentedException(e.getMessage(), ErrorType.TRANSPORT,
ErrorTag.OPERATION_FAILED);