public class JsonParser extends BaseParser implements IJsonLikeParser
FhirContext.newJsonParser() to get an instance.BaseParser.CompositeChildElement, BaseParser.ElementsPath, BaseParser.EncodeContext, BaseParser.EncodeContextPath, BaseParser.EncodeContextPathElement| 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 |
doEncodeResourceToJsonLikeWriter(IBaseResource theResource,
JsonLikeWriter theEventWriter,
BaseParser.EncodeContext theEncodeContext) |
protected void |
doEncodeResourceToWriter(IBaseResource theResource,
Writer theWriter,
BaseParser.EncodeContext theEncodeContext) |
<T extends IBaseResource> |
doParseResource(Class<T> theResourceType,
JsonLikeStructure theJsonStructure) |
<T extends IBaseResource> |
doParseResource(Class<T> theResourceType,
Reader theReader) |
void |
encodeResourceToJsonLikeWriter(IBaseResource theResource,
JsonLikeWriter theJsonLikeWriter) |
EncodingEnum |
getEncoding()
Which encoding does this parser instance produce?
|
static com.google.gson.Gson |
newGson() |
<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
|
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, encodeResourceToString, encodeResourceToWriter, encodeResourceToWriter, extractMetadataListNotNull, fixContainedResourceId, getCompositeElementId, getDontStripVersionsFromReferencesAtPaths, getEncodeForceResourceId, getErrorHandler, getExtensionMetadataKeys, getExtensionUrl, getMetaTagsForEncoding, getOverrideResourceIdWithBundleEntryFullUrl, getPreferTypes, getProfileTagsForEncoding, getServerBaseUrl, getStripVersionsFromReferences, getSuppressNarratives, isChildContained, isEncodeElementsAppliesToChildResourcesOnly, isOmitResourceId, isSummaryMode, isSuppressNarratives, parseResource, parseResource, parseResource, parseResource, parseResource, parseResource, preProcessValues, setDontEncodeElements, setDontStripVersionsFromReferencesAtPaths, setDontStripVersionsFromReferencesAtPaths, setEncodeElements, setEncodeElementsAppliesToChildResourcesOnly, setEncodeForceResourceId, setOmitResourceId, setOverrideResourceIdWithBundleEntryFullUrl, setParserErrorHandler, setPreferTypes, setServerBaseUrl, setStripVersionsFromReferences, setSummaryMode, setSuppressNarratives, shouldAddSubsettedTag, shouldEncodePath, shouldEncodeResource, shouldEncodeResourceId, shouldEncodeResourceMeta, throwExceptionForUnknownChildTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencodeResourceToString, encodeResourceToWriter, getDontStripVersionsFromReferencesAtPaths, getEncodeForceResourceId, getOverrideResourceIdWithBundleEntryFullUrl, getPreferTypes, getStripVersionsFromReferences, isEncodeElementsAppliesToChildResourcesOnly, isOmitResourceId, isSummaryMode, parseResource, parseResource, parseResource, parseResource, parseResource, parseResource, setDontEncodeElements, setDontStripVersionsFromReferencesAtPaths, setDontStripVersionsFromReferencesAtPaths, setEncodeElements, setEncodeElementsAppliesToChildResourcesOnly, setEncodeForceResourceId, setOmitResourceId, setOverrideResourceIdWithBundleEntryFullUrl, setParserErrorHandler, setPreferTypes, setServerBaseUrl, setStripVersionsFromReferences, setSummaryMode, setSuppressNarrativespublic JsonParser(FhirContext theContext, IParserErrorHandler theParserErrorHandler)
FhirContext.newJsonParser().theParserErrorHandler - public void doEncodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theEventWriter, BaseParser.EncodeContext theEncodeContext) throws IOException
IOExceptionprotected void doEncodeResourceToWriter(IBaseResource theResource, Writer theWriter, BaseParser.EncodeContext theEncodeContext) throws IOException
doEncodeResourceToWriter in class BaseParserIOExceptionpublic <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 encodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException
encodeResourceToJsonLikeWriter in interface IJsonLikeParserIOExceptionDataFormatExceptionpublic EncodingEnum getEncoding()
IParsergetEncoding in interface IParserpublic <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 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–2019 University Health Network. All rights reserved.