Class FHIRJsonParser
- java.lang.Object
-
- org.linuxforhealth.fhir.model.parser.FHIRAbstractParser
-
- org.linuxforhealth.fhir.model.parser.FHIRJsonParser
-
- All Implemented Interfaces:
FHIRParser
@NotThreadSafe @Generated("org.linuxforhealth.fhir.tools.CodeGenerator") public class FHIRJsonParser extends FHIRAbstractParser
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
-
Fields inherited from class org.linuxforhealth.fhir.model.parser.FHIRAbstractParser
ignoringUnrecognizedElements, properties, validating
-
-
Constructor Summary
Constructors Constructor Description FHIRJsonParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Resource>
Tparse(jakarta.json.JsonObject jsonObject)
Read a resource from a JsonObject.<T extends Resource>
Tparse(java.io.InputStream in)
Read a resource from the passed InputStream.<T extends Resource>
Tparse(java.io.Reader reader)
Read a resource using the passed Reader.<T extends Resource>
TparseAndFilter(jakarta.json.JsonObject jsonObject, java.util.Collection<java.lang.String> elementsToInclude)
Read a resource from a JsonObject and filter its top-level elements to the collection of elementsToInclude.<T extends Resource>
TparseAndFilter(java.io.InputStream in, java.util.Collection<java.lang.String> elementsToInclude)
Read a resource from the passed InputStream and filter its top-level elements to the collection of elementsToInclude.<T extends Resource>
TparseAndFilter(java.io.Reader reader, java.util.Collection<java.lang.String> elementsToInclude)
Read a resource using the passed Reader and filter its top-level elements to the collection of elementsToInclude.-
Methods inherited from class org.linuxforhealth.fhir.model.parser.FHIRAbstractParser
as, getProperty, getProperty, getPropertyOrDefault, getPropertyOrDefault, isIgnoringUnrecognizedElements, isPropertySupported, isValidating, setIgnoringUnrecognizedElements, setProperty, setValidating
-
-
-
-
Method Detail
-
parse
public <T extends Resource> T parse(java.io.InputStream in) throws FHIRParserException
Description copied from interface:FHIRParser
Read a resource from the passed InputStream. This method does not close the passed InputStream.- Specified by:
parse
in interfaceFHIRParser
- Specified by:
parse
in classFHIRAbstractParser
- Type Parameters:
T
- The resource type to read- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
parseAndFilter
public <T extends Resource> T parseAndFilter(java.io.InputStream in, java.util.Collection<java.lang.String> elementsToInclude) throws FHIRParserException
Read a resource from the passed InputStream and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.- Type Parameters:
T
- The resource type to read- Parameters:
in
- An input stream with the JSON contents of a FHIR resourceelementsToInclude
- The top-level elements to include or null to indicate that no filter should be applied- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
parse
public <T extends Resource> T parse(java.io.Reader reader) throws FHIRParserException
Description copied from interface:FHIRParser
Read a resource using the passed Reader. This method does not close the passed Reader.- Specified by:
parse
in interfaceFHIRParser
- Specified by:
parse
in classFHIRAbstractParser
- Type Parameters:
T
- The resource type to read- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
parseAndFilter
public <T extends Resource> T parseAndFilter(java.io.Reader reader, java.util.Collection<java.lang.String> elementsToInclude) throws FHIRParserException
Read a resource using the passed Reader and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.- Type Parameters:
T
- The resource type to read- Parameters:
reader
- A reader with the JSON contents of a FHIR resourceelementsToInclude
- The top-level elements to include or null to indicate that no filter should be applied- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
parse
public <T extends Resource> T parse(jakarta.json.JsonObject jsonObject) throws FHIRParserException
Read a resource from a JsonObject. This method does not close the passed InputStream.- Type Parameters:
T
- The resource type to read- Parameters:
jsonObject
- A JsonObject with the contents of a FHIR resource- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
parseAndFilter
public <T extends Resource> T parseAndFilter(jakarta.json.JsonObject jsonObject, java.util.Collection<java.lang.String> elementsToInclude) throws FHIRParserException
Read a resource from a JsonObject and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.- Type Parameters:
T
- The resource type to read- Parameters:
jsonObject
- A JsonObject with the contents of a FHIR resourceelementsToInclude
- The top-level elements to include or null to indicate that no filter should be applied- Returns:
- Throws:
FHIRParserException
- if the resource could not be parsed for any reason
-
-