Package com.ibm.fhir.model.generator
Class FHIRJsonGenerator
- java.lang.Object
-
- com.ibm.fhir.model.generator.FHIRAbstractGenerator
-
- com.ibm.fhir.model.generator.FHIRJsonGenerator
-
- All Implemented Interfaces:
FHIRGenerator
public class FHIRJsonGenerator extends FHIRAbstractGenerator
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.generator.FHIRAbstractGenerator
properties
-
Fields inherited from interface com.ibm.fhir.model.generator.FHIRGenerator
PROPERTY_INDENT_AMOUNT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FHIRJsonGenerator()
protected
FHIRJsonGenerator(boolean prettyPrinting)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate(Visitable visitable, OutputStream out)
Writevisitable
to the passed OutputStream.void
generate(Visitable visitable, Writer writer)
Writevisitable
using the passed Writer.boolean
isPrettyPrinting()
static void
main(String[] args)
-
Methods inherited from class com.ibm.fhir.model.generator.FHIRAbstractGenerator
as, getProperty, getProperty, getPropertyOrDefault, getPropertyOrDefault, isPropertySupported, setProperty
-
-
-
-
Method Detail
-
generate
public void generate(Visitable visitable, 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, 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
- Specified by:
isPrettyPrinting
in classFHIRAbstractGenerator
- Returns:
- whether this FHIRGenerator is configured to pretty-print its output
-
-