Class FHIRJsonGenerator
- java.lang.Object
-
- org.linuxforhealth.fhir.model.generator.FHIRAbstractGenerator
-
- org.linuxforhealth.fhir.model.generator.FHIRJsonGenerator
-
- All Implemented Interfaces:
FHIRGenerator
public class FHIRJsonGenerator extends FHIRAbstractGenerator
-
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.model.generator.FHIRAbstractGenerator
prettyPrinting, properties
-
Fields inherited from interface org.linuxforhealth.fhir.model.generator.FHIRGenerator
PROPERTY_INDENT_AMOUNT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRJsonGenerator(boolean prettyPrinting)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate(Visitable visitable, java.io.OutputStream out)
Writevisitable
to the passed OutputStream.void
generate(Visitable visitable, java.io.Writer writer)
Writevisitable
using the passed Writer.boolean
isPrettyPrinting()
-
Methods inherited from class org.linuxforhealth.fhir.model.generator.FHIRAbstractGenerator
as, getProperty, getProperty, getPropertyOrDefault, getPropertyOrDefault, isPropertySupported, setProperty
-
-
-
-
Method Detail
-
generate
public void generate(Visitable visitable, java.io.OutputStream out) throws FHIRGeneratorException
Description copied from interface:FHIRGenerator
Writevisitable
to the passed OutputStream. This method does not close the passed OutputStream. Forvisitable
of type Resource, this serializes the resource in accordance with the specification. Forvisitable
of type Element, this serializes the element content using a suitable wrapper for the configured format.- Specified by:
generate
in interfaceFHIRGenerator
- Specified by:
generate
in classFHIRAbstractGenerator
- Parameters:
visitable
- The visitable Resource or Element to serialize- Throws:
FHIRGeneratorException
-
generate
public void generate(Visitable visitable, java.io.Writer writer) throws FHIRGeneratorException
Description copied from interface:FHIRGenerator
Writevisitable
using the passed Writer. This method does not close the passed Writer. Forvisitable
of type Resource, this serializes the resource in accordance with the specification. Forvisitable
of type Element, this serializes the element content using a suitable wrapper for the configured format.- Specified by:
generate
in interfaceFHIRGenerator
- Specified by:
generate
in classFHIRAbstractGenerator
- Parameters:
visitable
- The visitable Resource or Element to serialize- Throws:
FHIRGeneratorException
-
isPrettyPrinting
public boolean isPrettyPrinting()
- Specified by:
isPrettyPrinting
in interfaceFHIRGenerator
- Overrides:
isPrettyPrinting
in classFHIRAbstractGenerator
- Returns:
- whether this FHIRGenerator is configured to pretty-print its output
-
-