public class SchematronValidationService extends Object implements MetacardValidator, Describable, ReportingMetacardValidator
When this service is instantiated at deployment time to the OSGi container it goes through 3 different preprocessing stages on the Schematron schema file. (These steps are required by the ISO Schematron implementation)
When XML documents are ingested, this service will run the XSLT generated by stage 3 against the XML document, validating it against the "compiled" Schematron schema file.
This service is using the SVRL script, hence the output of the validation will be an SVRL-formatted XML document.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_THREAD_POOL_SIZE |
Constructor and Description |
---|
SchematronValidationService() |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Returns a description of the describable item.
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getVersion()
Retrieve the version.
|
void |
init() |
void |
setId(String id) |
void |
setNamespace(String namespace) |
void |
setPriority(int priority) |
void |
setSchematronFileNames(List<String> schematronFileNames) |
void |
setSuppressWarnings(boolean suppressWarnings) |
void |
validate(Metacard metacard)
Validates a
Metacard |
Optional<MetacardValidationReport> |
validateMetacard(Metacard metacard)
Validates a
Metacard . |
public static final String DEFAULT_THREAD_POOL_SIZE
public void init() throws SchematronInitializationException
public void setSuppressWarnings(boolean suppressWarnings)
public void setSchematronFileNames(List<String> schematronFileNames) throws SchematronInitializationException
public void setNamespace(String namespace)
public void setPriority(int priority)
public void validate(Metacard metacard) throws ValidationException
MetacardValidator
Metacard
validate
in interface MetacardValidator
metacard
- Metacard
to validateValidationException
- if any validation error occurspublic String getVersion()
Describable
getVersion
in interface Describable
public String getId()
Describable
html for a MetacardTransformer
that transforms Metacard
s to HTML
getId
in interface Describable
public void setId(String id)
public String getTitle()
Describable
getTitle
in interface Describable
public String getDescription()
Describable
getDescription
in interface Describable
public String getOrganization()
Describable
getOrganization
in interface Describable
public Optional<MetacardValidationReport> validateMetacard(Metacard metacard)
ReportingMetacardValidator
Metacard
.validateMetacard
in interface ReportingMetacardValidator
metacard
- the Metacard
to validate, cannot be nullOptional
containing a MetacardValidationReport
if there are
violations, or an empty Optional
if there are no violationsThis work is licensed under a Creative Commons Attribution 4.0 International License.