public class JsonParser extends BaseParser implements IJsonLikeParser
FhirContext.newJsonParser() to get an instance.BaseParser.CompositeChildElement| Constructor and Description |
|---|
JsonParser(FhirContext theContext,
IParserErrorHandler theParserErrorHandler)
Do not use this constructor, the recommended way to obtain a new instance of the JSON parser is to invoke
FhirContext.newJsonParser(). |
| Modifier and Type | Method and Description |
|---|---|
void |
doEncodeBundleToJsonLikeWriter(Bundle theBundle,
JsonLikeWriter theEventWriter) |
void |
doEncodeBundleToWriter(Bundle theBundle,
Writer theWriter) |
void |
doEncodeResourceToJsonLikeWriter(IBaseResource theResource,
JsonLikeWriter theEventWriter) |
protected void |
doEncodeResourceToWriter(IBaseResource theResource,
Writer theWriter) |
<T extends IBaseResource> |
doParseResource(Class<T> theResourceType,
JsonLikeStructure theJsonStructure) |
<T extends IBaseResource> |
doParseResource(Class<T> theResourceType,
Reader theReader) |
void |
encodeBundleToJsonLikeWriter(Bundle theBundle,
JsonLikeWriter theJsonLikeWriter) |
void |
encodeResourceToJsonLikeWriter(IBaseResource theResource,
JsonLikeWriter theJsonLikeWriter) |
void |
encodeTagListToJsonLikeWriter(TagList theTagList,
JsonLikeWriter theEventWriter) |
void |
encodeTagListToWriter(TagList theTagList,
Writer theWriter)
Encodes a tag list, as defined in the FHIR
Specification.
|
EncodingEnum |
getEncoding()
Which encoding does this parser instance produce?
|
static com.google.gson.Gson |
newGson() |
<T extends IBaseResource> |
parseBundle(Class<T> theResourceType,
JsonLikeStructure theJsonStructure)
Parse a DSTU1 style Atom Bundle.
|
<T extends IBaseResource> |
parseBundle(Class<T> theResourceType,
Reader theReader)
Parse a DSTU1 style Atom Bundle.
|
Bundle |
parseBundle(JsonLikeStructure theJsonLikeStructure)
Parse a DSTU1 style Atom Bundle.
|
<T extends IBaseResource> |
parseResource(Class<T> theResourceType,
JsonLikeStructure theJsonLikeStructure)
Parses a resource from a JSON-like data structure
|
IBaseResource |
parseResource(JsonLikeStructure theJsonLikeStructure)
Parses a resource from a JSON-like data structure
|
TagList |
parseTagList(JsonLikeStructure theJsonStructure)
Parses a tag list from a JSON-like data structure
|
TagList |
parseTagList(Reader theReader)
Parses a tag list, as defined in the FHIR
Specification.
|
IParser |
setPrettyPrint(boolean thePrettyPrint)
Sets the "pretty print" flag, meaning that the parser will encode resources with human-readable spacing and
newlines between elements instead of condensing output as much as possible.
|
compositeChildIterator, containResourcesForEncoding, encodeBundleToString, encodeBundleToWriter, encodeResourceToString, encodeResourceToWriter, encodeTagListToString, extractMetadataListNotNull, fixContainedResourceId, getCompositeElementId, getDontStripVersionsFromReferencesAtPaths, getEncodeElements, getEncodeElementsAppliesToResourceTypes, getEncodeForceResourceId, getErrorHandler, getExtensionUrl, getMetaTagsForEncoding, getOverrideResourceIdWithBundleEntryFullUrl, getPreferTypes, getProfileTagsForEncoding, getServerBaseUrl, getStripVersionsFromReferences, getSuppressNarratives, isChildContained, isOmitResourceId, isSummaryMode, isSuppressNarratives, parseBundle, parseBundle, parseResource, parseResource, parseResource, parseResource, parseTagList, preProcessValues, setDontEncodeElements, setDontStripVersionsFromReferencesAtPaths, setDontStripVersionsFromReferencesAtPaths, setEncodeElements, setEncodeElementsAppliesToResourceTypes, setEncodeForceResourceId, setOmitResourceId, setOverrideResourceIdWithBundleEntryFullUrl, setParserErrorHandler, setPreferTypes, setServerBaseUrl, setStripVersionsFromReferences, setSummaryMode, setSuppressNarratives, shouldAddSubsettedTag, shouldEncodeResourceId, shouldEncodeResourceMeta, throwExceptionForUnknownChildTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencodeBundleToString, encodeBundleToWriter, encodeResourceToString, encodeResourceToWriter, encodeTagListToString, getDontStripVersionsFromReferencesAtPaths, getEncodeElements, getEncodeElementsAppliesToResourceTypes, getEncodeForceResourceId, getOverrideResourceIdWithBundleEntryFullUrl, getPreferTypes, getStripVersionsFromReferences, isOmitResourceId, isSummaryMode, parseBundle, parseBundle, parseResource, parseResource, parseResource, parseResource, parseTagList, setDontEncodeElements, setDontStripVersionsFromReferencesAtPaths, setDontStripVersionsFromReferencesAtPaths, setEncodeElements, setEncodeElementsAppliesToResourceTypes, setEncodeForceResourceId, setOmitResourceId, setOverrideResourceIdWithBundleEntryFullUrl, setParserErrorHandler, setPreferTypes, setServerBaseUrl, setStripVersionsFromReferences, setSummaryMode, setSuppressNarrativespublic JsonParser(FhirContext theContext, IParserErrorHandler theParserErrorHandler)
FhirContext.newJsonParser().theParserErrorHandler - public void doEncodeBundleToWriter(Bundle theBundle, Writer theWriter) throws IOException
doEncodeBundleToWriter in class BaseParserIOExceptionpublic void doEncodeBundleToJsonLikeWriter(Bundle theBundle, JsonLikeWriter theEventWriter) throws IOException
IOExceptionprotected void doEncodeResourceToWriter(IBaseResource theResource, Writer theWriter) throws IOException
doEncodeResourceToWriter in class BaseParserIOExceptionpublic void doEncodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theEventWriter) throws IOException
IOExceptionpublic <T extends IBaseResource> T doParseResource(Class<T> theResourceType, Reader theReader)
doParseResource in class BaseParserpublic <T extends IBaseResource> T doParseResource(Class<T> theResourceType, JsonLikeStructure theJsonStructure)
public void encodeBundleToJsonLikeWriter(Bundle theBundle, JsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException
encodeBundleToJsonLikeWriter in interface IJsonLikeParserIOExceptionDataFormatExceptionpublic void encodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException
encodeResourceToJsonLikeWriter in interface IJsonLikeParserIOExceptionDataFormatExceptionpublic void encodeTagListToWriter(TagList theTagList, Writer theWriter) throws IOException
IParserencodeTagListToWriter in interface IParsertheTagList - The tag list to encode. Must not be null.theWriter - The writer to encode toIOExceptionpublic void encodeTagListToJsonLikeWriter(TagList theTagList, JsonLikeWriter theEventWriter) throws IOException
encodeTagListToJsonLikeWriter in interface IJsonLikeParserIOExceptionpublic EncodingEnum getEncoding()
IParsergetEncoding in interface IParserpublic <T extends IBaseResource> Bundle parseBundle(Class<T> theResourceType, Reader theReader)
IParserIParser.parseResource(Class, Reader) with the Bundle class found in the
ca.uhn.hapi.fhir.model.[version].resource package instead.parseBundle in interface IParserpublic Bundle parseBundle(JsonLikeStructure theJsonLikeStructure) throws DataFormatException
IJsonLikeParserIJsonLikeParser.parseResource(Class, JsonLikeStructure) with the Bundle class found in the
ca.uhn.hapi.fhir.model.[version].resource package instead.parseBundle in interface IJsonLikeParserDataFormatExceptionpublic <T extends IBaseResource> Bundle parseBundle(Class<T> theResourceType, JsonLikeStructure theJsonStructure)
IJsonLikeParserIJsonLikeParser.parseResource(Class, JsonLikeStructure) with the Bundle class found in the
ca.uhn.hapi.fhir.model.[version].resource package instead.parseBundle in interface IJsonLikeParserpublic <T extends IBaseResource> T parseResource(Class<T> theResourceType, JsonLikeStructure theJsonLikeStructure) throws DataFormatException
IJsonLikeParserparseResource in interface IJsonLikeParsertheResourceType - The resource type to use. This can be used to explicitly specify a class which extends a built-in type
(e.g. a custom type extending the default Patient class)theJsonLikeStructure - The JSON-like structure to parseDataFormatException - If the resource can not be parsed because the data is not recognized or invalid for any reasonpublic IBaseResource parseResource(JsonLikeStructure theJsonLikeStructure) throws DataFormatException
IJsonLikeParserparseResource in interface IJsonLikeParsertheJsonLikeStructure - The JSON-like structure to parseIResource or
IAnyResource depending on the specific FhirContext which created this parser.DataFormatException - If the resource can not be parsed because the data is not recognized or invalid for any reasonpublic TagList parseTagList(Reader theReader)
IParserparseTagList in interface IParsertheReader - A reader which will supply a tag listpublic TagList parseTagList(JsonLikeStructure theJsonStructure)
IJsonLikeParserparseTagList in interface IJsonLikeParsertheJsonStructure - The JSON-like structure to parsepublic IParser setPrettyPrint(boolean thePrettyPrint)
IParsersetPrettyPrint in interface IParserthePrettyPrint - The flagthis parser so that method calls can be chained togetherpublic static com.google.gson.Gson newGson()
Copyright © 2014–2017 University Health Network. All rights reserved.