public final class PrettyPrinter extends Object implements PrettyPrinterInterface
NO_OP_PRETTY_PRINTER
Constructor and Description |
---|
PrettyPrinter(com.google.api.ads.common.lib.conf.AdsApiConfiguration adsApiConfiguration,
org.slf4j.Logger libLogger,
com.google.common.base.Supplier<XPath> xpathSupplier,
com.google.common.base.Supplier<Transformer> transformerSupplier,
com.google.common.base.Supplier<DocumentBuilder> documentBuilderSupplier)
Default constructor used by Guice.
|
Modifier and Type | Method and Description |
---|---|
String |
prettyPrint(String xml)
Transforms XML into a pretty-printed format with sensitive strings removed.
|
@Inject public PrettyPrinter(com.google.api.ads.common.lib.conf.AdsApiConfiguration adsApiConfiguration, org.slf4j.Logger libLogger, com.google.common.base.Supplier<XPath> xpathSupplier, com.google.common.base.Supplier<Transformer> transformerSupplier, com.google.common.base.Supplier<DocumentBuilder> documentBuilderSupplier)
Supplier
instances for XPath
,
Transformer
, and DocumentBuilder
because the corresponding factory objects are
not thread-safe. The Guice modules creating these suppliers should guarantee that the
Supplier
is thread-safe, however.adsApiConfiguration
- the API configurationlibLogger
- the logger to use for errorsxpathSupplier
- a thread-safe supplier of XPath
objectstransformerSupplier
- a thread-safe supplier of Transformer
objectsdocumentBuilderSupplier
- a thread-safe supplier of DocumentBuilder
objectspublic String prettyPrint(String xml)
prettyPrint
in interface PrettyPrinterInterface
xml
- the XML message to be pretty printedCopyright © 2018. All Rights Reserved.