public class FhirValidator extends Object
To obtain a resource validator, call FhirContext.newValidator()
Thread safety note: This class is thread safe, so you may register or unregister validator modules at any time. Individual modules are not guaranteed to be thread safe however. Reconfigure them with caution.
| Constructor and Description |
|---|
FhirValidator(FhirContext theFhirContext)
Constructor (this should not be called directly, but rather
FhirContext.newValidator() should be called to obtain an instance of FhirValidator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isValidateAgainstStandardSchema()
Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself)
|
boolean |
isValidateAgainstStandardSchematron()
Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself)
|
void |
registerValidatorModule(IValidatorModule theValidator)
Add a new validator module to this validator.
|
FhirValidator |
setValidateAgainstStandardSchema(boolean theValidateAgainstStandardSchema)
Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself)
|
FhirValidator |
setValidateAgainstStandardSchematron(boolean theValidateAgainstStandardSchematron)
Should the validator validate the resource against the base schematron (the schematron provided with the FHIR distribution itself)
|
void |
unregisterValidatorModule(IValidatorModule theValidator)
Removes a validator module from this validator.
|
ValidationResult |
validateWithResult(IBaseResource theResource)
Validates a resource instance returning a
ValidationResult which contains the results. |
ValidationResult |
validateWithResult(IBaseResource theResource,
ValidationOptions theOptions)
Validates a resource instance returning a
ValidationResult which contains the results. |
ValidationResult |
validateWithResult(String theResource)
Validates a resource instance returning a
ValidationResult which contains the results. |
ValidationResult |
validateWithResult(String theResource,
ValidationOptions theOptions)
Validates a resource instance returning a
ValidationResult which contains the results. |
public FhirValidator(FhirContext theFhirContext)
FhirContext.newValidator() should be called to obtain an instance of FhirValidator)public boolean isValidateAgainstStandardSchema()
public boolean isValidateAgainstStandardSchematron()
public void registerValidatorModule(IValidatorModule theValidator)
theValidator - The validator module. Must not be null.public FhirValidator setValidateAgainstStandardSchema(boolean theValidateAgainstStandardSchema)
this for method chainingpublic FhirValidator setValidateAgainstStandardSchematron(boolean theValidateAgainstStandardSchematron)
this for method chainingpublic void unregisterValidatorModule(IValidatorModule theValidator)
theValidator - The validator module. Must not be null.public ValidationResult validateWithResult(IBaseResource theResource)
ValidationResult which contains the results.theResource - the resource to validatepublic ValidationResult validateWithResult(String theResource)
ValidationResult which contains the results.theResource - the resource to validatepublic ValidationResult validateWithResult(IBaseResource theResource, ValidationOptions theOptions)
ValidationResult which contains the results.theResource - the resource to validatetheOptions - Optionally provides options to the validatorpublic ValidationResult validateWithResult(String theResource, ValidationOptions theOptions)
ValidationResult which contains the results.theResource - the resource to validatetheOptions - Optionally provides options to the validatorCopyright © 2014–2019 University Health Network. All rights reserved.