Package ca.uhn.fhir.parser
Class RDFParser
- java.lang.Object
-
- ca.uhn.fhir.parser.BaseParser
-
- ca.uhn.fhir.parser.RDFParser
-
- All Implemented Interfaces:
IParser
public class RDFParser extends BaseParser
This class is the FHIR RDF parser/encoder. Users should not interact with this class directly, but should useFhirContext.newRDFParser()to get an instance.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ca.uhn.fhir.parser.BaseParser
BaseParser.CompositeChildElement, BaseParser.ElementsPath, BaseParser.EncodeContext, BaseParser.EncodeContextPath, BaseParser.EncodeContextPathElement
-
-
Constructor Summary
Constructors Constructor Description RDFParser(FhirContext context, IParserErrorHandler parserErrorHandler, org.apache.jena.riot.Lang lang)Do not use this constructor, the recommended way to obtain a new instance of the RDF parser is to invokeFhirContext.newRDFParser().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoEncodeResourceToWriter(IBaseResource resource, Writer writer, BaseParser.EncodeContext encodeContext)protected <T extends IBaseResource>
TdoParseResource(Class<T> resourceType, Reader reader)EncodingEnumgetEncoding()Which encoding does this parser instance produce?IParsersetPrettyPrint(boolean prettyPrint)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, containResourcesForEncoding, encodeResourceToString, encodeResourceToWriter, encodeResourceToWriter, extractMetadataListNotNull, findBaseReferences, fixContainedResourceId, getAllBaseReferences, getCompositeElementId, getDontStripVersionsFromReferencesAtPaths, getEncodeForceResourceId, getErrorHandler, getExtensionMetadataKeys, getExtensionUrl, getMetaTagsForEncoding, 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, throwExceptionForUnknownChildType
-
-
-
-
Constructor Detail
-
RDFParser
public RDFParser(FhirContext context, IParserErrorHandler parserErrorHandler, org.apache.jena.riot.Lang lang)
Do not use this constructor, the recommended way to obtain a new instance of the RDF parser is to invokeFhirContext.newRDFParser().- Parameters:
parserErrorHandler- the Parser Error Handler
-
-
Method Detail
-
doEncodeResourceToWriter
protected void doEncodeResourceToWriter(IBaseResource resource, Writer writer, BaseParser.EncodeContext encodeContext)
- Specified by:
doEncodeResourceToWriterin classBaseParser
-
doParseResource
protected <T extends IBaseResource> T doParseResource(Class<T> resourceType, Reader reader) throws DataFormatException
- Specified by:
doParseResourcein classBaseParser- Throws:
DataFormatException
-
getEncoding
public EncodingEnum getEncoding()
Description copied from interface:IParserWhich encoding does this parser instance produce?
-
setPrettyPrint
public IParser setPrettyPrint(boolean prettyPrint)
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:
prettyPrint- The flag- Returns:
- Returns an instance of
thisparser so that method calls can be chained together
-
-