
Package ca.uhn.fhir.parser
Class NDJsonParser
java.lang.Object
ca.uhn.fhir.parser.BaseParser
ca.uhn.fhir.parser.NDJsonParser
- All Implemented Interfaces:
IParser
This class is the FHIR NDJSON parser/encoder. Users should not interact with this class directly, but should use
FhirContext.newNDJsonParser() to get an instance.-
Nested Class Summary
Nested classes/interfaces inherited from class ca.uhn.fhir.parser.BaseParser
BaseParser.CompositeChildElement -
Field Summary
Fields inherited from class ca.uhn.fhir.parser.BaseParser
RESOURCE_CREATED_BY_PARSER -
Constructor Summary
ConstructorsConstructorDescriptionNDJsonParser(FhirContext theContext, IParserErrorHandler theParserErrorHandler) Do not use this constructor, the recommended way to obtain a new instance of the NDJSON parser is to invokeFhirContext.newNDJsonParser(). -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoEncodeResourceToWriter(IBaseResource theResource, Writer theWriter, ca.uhn.fhir.parser.BaseParser.EncodeContext theEncodeContext) <T extends IBaseResource>
TdoParseResource(Class<T> theResourceType, Reader theReader) Which encoding does this parser instance produce?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.Methods inherited from class ca.uhn.fhir.parser.BaseParser
compositeChildIterator, containResourcesInReferences, doEncodeToWriter, doParseIntoComplexStructure, encodeResourceToString, encodeResourceToWriter, encodeResourceToWriter, encodeToString, encodeToWriter, encodeToWriter, extractMetadataListNotNull, fixContainedResourceId, getCompositeElementId, getContext, getDontStripVersionsFromReferencesAtPaths, getEncodeForceResourceId, getErrorHandler, getExtensionMetadataKeys, getExtensionUrl, getMetaTagsForEncoding, getPreferTypes, getProfileTagsForEncoding, getServerBaseUrl, getStripVersionsFromReferences, getSuppressNarratives, isChildContained, isEncodeElementsAppliesToChildResourcesOnly, isOmitResourceId, isSummaryMode, isSuppressNarratives, parseInto, 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, throwExceptionForUnknownChildTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.parser.IParser
parseInto, setDontEncodeElements, setEncodeElements
-
Constructor Details
-
NDJsonParser
Do not use this constructor, the recommended way to obtain a new instance of the NDJSON parser is to invokeFhirContext.newNDJsonParser().- Parameters:
theParserErrorHandler-
-
-
Method Details
-
setPrettyPrint
Description copied from interface:IParserSets 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.- Parameters:
thePrettyPrint- The flag- Returns:
- Returns an instance of
thisparser so that method calls can be chained together
-
getEncoding
Description copied from interface:IParserWhich encoding does this parser instance produce? -
doEncodeResourceToWriter
protected void doEncodeResourceToWriter(IBaseResource theResource, Writer theWriter, ca.uhn.fhir.parser.BaseParser.EncodeContext theEncodeContext) throws IOException - Specified by:
doEncodeResourceToWriterin classBaseParser- Throws:
IOException
-
doParseResource
public <T extends IBaseResource> T doParseResource(Class<T> theResourceType, Reader theReader) throws DataFormatException - Specified by:
doParseResourcein classBaseParser- Throws:
DataFormatException
-