public class JsonMetadataTypeWriter extends AbstractJsonMetadataTypeWriter
MetadataTypeWriter implementation that serialize a full MetadataType structure to a matching JSON object.prettyPrint, typeStack, writer| Constructor and Description |
|---|
JsonMetadataTypeWriter()
Creates a new instance which serializes all types explicitly without handling references
|
JsonMetadataTypeWriter(ObjectTypeReferenceHandler referenceHandler)
Creates a new instance which handles type references through the given
referenceHandler |
JsonMetadataTypeWriter(ObjectTypeReferenceHandler referenceHandler,
boolean allowNullInput) |
| Modifier and Type | Method and Description |
|---|---|
JsonMetadataTypeWriter |
setPrettyPrint(boolean prettyPrint)
Changes the value of PrettyPrint property of the
ReducedJsonMetadataTypeWriter. |
protected void |
write(MetadataType type)
Given a
MetadataType, serializes it into a JSON format. |
toString, writepublic JsonMetadataTypeWriter()
public JsonMetadataTypeWriter(ObjectTypeReferenceHandler referenceHandler)
referenceHandlerreferenceHandler - an ObjectTypeReferenceHandlerpublic JsonMetadataTypeWriter(ObjectTypeReferenceHandler referenceHandler, boolean allowNullInput)
protected void write(MetadataType type) throws IOException
MetadataType, serializes it into a JSON format.
It is expected that a proper writer is already set to this object.
write in class AbstractJsonMetadataTypeWritertype - MetadataType to doSerialize.IOException - if any error occurred when writing the JSON file.public JsonMetadataTypeWriter setPrettyPrint(boolean prettyPrint)
AbstractJsonMetadataTypeWriterReducedJsonMetadataTypeWriter. If it is enabled, when
AbstractJsonMetadataTypeWriter.toString(MetadataType) is executed the output String will be printed in a human readable format, otherwise,
by default, the JSON will be printed in a compact and more performable format.setPrettyPrint in class AbstractJsonMetadataTypeWriterprettyPrint - boolean value indicating if the writer should pretty print the JSONTypeWriter instanceCopyright © 2022 MuleSoft, Inc.. All rights reserved.