Class FHIRAbstractGenerator

    • Field Detail

      • prettyPrinting

        protected final boolean prettyPrinting
    • Constructor Detail

      • FHIRAbstractGenerator

        protected FHIRAbstractGenerator​(boolean prettyPrinting)
    • Method Detail

      • generate

        public abstract void generate​(Visitable visitable,
                                      OutputStream out)
                               throws FHIRGeneratorException
        Description copied from interface: FHIRGenerator
        Write visitable to the passed OutputStream. This method does not close the passed OutputStream. For visitable of type Resource, this serializes the resource in accordance with the specification. For visitable of type Element, this serializes the element content using a suitable wrapper for the configured format.
        Specified by:
        generate in interface FHIRGenerator
        Parameters:
        visitable - The visitable Resource or Element to serialize
        Throws:
        FHIRGeneratorException
      • generate

        public abstract void generate​(Visitable visitable,
                                      Writer writer)
                               throws FHIRGeneratorException
        Description copied from interface: FHIRGenerator
        Write visitable using the passed Writer. This method does not close the passed Writer. For visitable of type Resource, this serializes the resource in accordance with the specification. For visitable of type Element, this serializes the element content using a suitable wrapper for the configured format.
        Specified by:
        generate in interface FHIRGenerator
        Parameters:
        visitable - The visitable Resource or Element to serialize
        Throws:
        FHIRGeneratorException
      • isPrettyPrinting

        public boolean isPrettyPrinting()
        Specified by:
        isPrettyPrinting in interface FHIRGenerator
        Returns:
        whether this FHIRGenerator is configured to pretty-print its output
      • getProperty

        public <T> T getProperty​(String name,
                                 Class<T> type)
        Specified by:
        getProperty in interface FHIRGenerator
        Returns:
        the property value or null if the property has no value
      • getPropertyOrDefault

        public <T> T getPropertyOrDefault​(String name,
                                          T defaultValue,
                                          Class<T> type)
        Specified by:
        getPropertyOrDefault in interface FHIRGenerator
        Returns:
        the property value or defaultValue if the property has no value