public class ParserOptions extends Object
parser instances
created by a given FhirContext. It is accessed using FhirContext.getParserOptions()
and FhirContext.setParserOptions(ParserOptions).
It is fine to share a ParserOptions instances across multiple context instances.
| Constructor and Description |
|---|
ParserOptions() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getDontStripVersionsFromReferencesAtPaths()
Returns the value supplied to
IParser.setDontStripVersionsFromReferencesAtPaths(String...) |
boolean |
isOverrideResourceIdWithBundleEntryFullUrl()
If set to
true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. |
boolean |
isStripVersionsFromReferences()
If set to
true |
ParserOptions |
setDontStripVersionsFromReferencesAtPaths(Collection<String> thePaths)
If supplied value(s), any resource references at the specified paths will have their
resource versions encoded instead of being automatically stripped during the encoding
process.
|
ParserOptions |
setDontStripVersionsFromReferencesAtPaths(String... thePaths)
If supplied value(s), any resource references at the specified paths will have their
resource versions encoded instead of being automatically stripped during the encoding
process.
|
ParserOptions |
setOverrideResourceIdWithBundleEntryFullUrl(boolean theOverrideResourceIdWithBundleEntryFullUrl)
If set to
true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. |
ParserOptions |
setStripVersionsFromReferences(boolean theStripVersionsFromReferences)
If set to
true |
public ParserOptions()
public ParserOptions setDontStripVersionsFromReferencesAtPaths(String... thePaths)
This method provides a finer-grained level of control than setStripVersionsFromReferences(boolean)
and any paths specified by this method will be encoded even if setStripVersionsFromReferences(boolean)
has been set to true (which is the default)
thePaths - A collection of paths for which the resource versions will not be removed automatically
when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that
only resource name and field names with dots separating is allowed here (no repetition
indicators, FluentPath expressions, etc.)this parser so that method calls can be chained togethersetStripVersionsFromReferences(boolean)public boolean isStripVersionsFromReferences()
true (which is the default), resource references containing a version
will have the version removed when the resource is encoded. This is generally good behaviour because
in most situations, references from one resource to another should be to the resource by ID, not
by ID and version. In some cases though, it may be desirable to preserve the version in resource
links. In that case, this value should be set to false.true.public ParserOptions setStripVersionsFromReferences(boolean theStripVersionsFromReferences)
true (which is the default), resource references containing a version
will have the version removed when the resource is encoded. This is generally good behaviour because
in most situations, references from one resource to another should be to the resource by ID, not
by ID and version. In some cases though, it may be desirable to preserve the version in resource
links. In that case, this value should be set to false.
This method provides the ability to globally disable reference encoding. If finer-grained
control is needed, use setDontStripVersionsFromReferencesAtPaths(String...)
theStripVersionsFromReferences - Set this to false to prevent the parser from removing
resource versions from references.this parser so that method calls can be chained togethersetDontStripVersionsFromReferencesAtPaths(String...)public Set<String> getDontStripVersionsFromReferencesAtPaths()
IParser.setDontStripVersionsFromReferencesAtPaths(String...)public ParserOptions setDontStripVersionsFromReferencesAtPaths(Collection<String> thePaths)
This method provides a finer-grained level of control than setStripVersionsFromReferences(boolean)
and any paths specified by this method will be encoded even if setStripVersionsFromReferences(boolean)
has been set to true (which is the default)
thePaths - A collection of paths for which the resource versions will not be removed automatically
when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that
only resource name and field names with dots separating is allowed here (no repetition
indicators, FluentPath expressions, etc.)this parser so that method calls can be chained togethersetStripVersionsFromReferences(boolean)public boolean isOverrideResourceIdWithBundleEntryFullUrl()
true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. This behavior happens when parsing the source data into a Bundle object. Set this
to false if this is not the desired behavior (e.g. the client code wishes to perform additional
validation checks between the fullUrl and the resource id).true.public ParserOptions setOverrideResourceIdWithBundleEntryFullUrl(boolean theOverrideResourceIdWithBundleEntryFullUrl)
true (which is the default), the Bundle.entry.fullUrl will override the Bundle.entry.resource's
resource id if the fullUrl is defined. This behavior happens when parsing the source data into a Bundle object. Set this
to false if this is not the desired behavior (e.g. the client code wishes to perform additional
validation checks between the fullUrl and the resource id).theOverrideResourceIdWithBundleEntryFullUrl - Set this to false to prevent the parser from overriding resource ids with the
Bundle.entry.fullUrlthis parser so that method calls can be chained togetherCopyright © 2014–2019 University Health Network. All rights reserved.