Interface IParser

    • Method Detail

      • getType

        ParserType getType()
        check what kind of parser this is
        Returns:
        what kind of parser this is
      • getHandleComments

        boolean getHandleComments()
        Whether to parse or ignore comments - either reading or writing
      • isAllowUnknownContent

        boolean isAllowUnknownContent()
        Parameters:
        allowUnknownContent - Whether to throw an exception if unknown content is found (or just skip it) when parsing
      • setSuppressXhtml

        IParser setSuppressXhtml​(String message)
        This method is used by the publication tooling to stop the xhrtml narrative being generated. It is not valid to use in production use. The tooling uses it to generate json/xml representations in html that are not cluttered by escaped html representations of the html representation
      • parse

        Resource parse​(InputStream input)
                throws IOException,
                       org.hl7.fhir.exceptions.FHIRFormatError
        parse content that is known to be a resource
        Throws:
        org.xmlpull.v1.XmlPullParserException
        org.hl7.fhir.exceptions.FHIRFormatError
        IOException
      • parse

        Resource parse​(byte[] bytes)
                throws org.hl7.fhir.exceptions.FHIRFormatError,
                       IOException
        parse content that is known to be a resource
        Throws:
        IOException
        org.hl7.fhir.exceptions.FHIRFormatError
      • parseType

        Type parseType​(InputStream input,
                       String knownType)
                throws IOException,
                       org.hl7.fhir.exceptions.FHIRFormatError
        This is used to parse a type - a fragment of a resource. There's no reason to use this in production - it's used in the build tools Not supported by all implementations
        Parameters:
        input -
        knownType - . if this is blank, the parser may try to infer the type (xml only)
        Returns:
        Throws:
        org.xmlpull.v1.XmlPullParserException
        org.hl7.fhir.exceptions.FHIRFormatError
        IOException
      • parseType

        Type parseType​(String input,
                       String knownType)
                throws UnsupportedEncodingException,
                       org.hl7.fhir.exceptions.FHIRFormatError,
                       IOException
        This is used to parse a type - a fragment of a resource. There's no reason to use this in production - it's used in the build tools Not supported by all implementations
        Parameters:
        input -
        knownType - . if this is blank, the parser may try to infer the type (xml only)
        Returns:
        Throws:
        UnsupportedEncodingException
        IOException
        org.hl7.fhir.exceptions.FHIRFormatError
      • parseType

        Type parseType​(byte[] bytes,
                       String knownType)
                throws org.hl7.fhir.exceptions.FHIRFormatError,
                       IOException
        This is used to parse a type - a fragment of a resource. There's no reason to use this in production - it's used in the build tools Not supported by all implementations
        Parameters:
        input -
        knownType - . if this is blank, the parser may try to infer the type (xml only)
        Returns:
        Throws:
        IOException
        org.hl7.fhir.exceptions.FHIRFormatError
      • compose

        void compose​(OutputStream stream,
                     Resource resource)
              throws IOException
        Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
        Throws:
        IOException
      • composeString

        String composeString​(Resource resource)
                      throws IOException
        Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
        Throws:
        IOException
      • composeBytes

        byte[] composeBytes​(Resource resource)
                     throws IOException
        Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
        Throws:
        IOException
      • compose

        void compose​(OutputStream stream,
                     Type type,
                     String rootName)
              throws IOException
        Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON format
        Throws:
        org.xmlpull.v1.XmlPullParserException
        org.hl7.fhir.exceptions.FHIRFormatError
        IOException
      • composeString

        String composeString​(Type type,
                             String rootName)
                      throws IOException
        Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON format
        Throws:
        IOException
      • composeBytes

        byte[] composeBytes​(Type type,
                            String rootName)
                     throws IOException
        Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON format
        Throws:
        IOException