mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
23 lines
917 B
Java
23 lines
917 B
Java
package de.kosit.validationtool.impl;
|
|
|
|
import de.kosit.validationtool.impl.tasks.CheckAction;
|
|
import de.kosit.validationtool.model.reportInput.DocumentIdentificationType;
|
|
|
|
/**
|
|
* Creates a document identification element for the report by using the generates hash.
|
|
*
|
|
* @author Andreas Penski
|
|
*/
|
|
class CreateDocumentIdentificationAction implements CheckAction {
|
|
|
|
@Override
|
|
public void check(final Bag transporter) {
|
|
final DocumentIdentificationType i = new DocumentIdentificationType();
|
|
final DocumentIdentificationType.DocumentHash h = new DocumentIdentificationType.DocumentHash();
|
|
h.setHashAlgorithm(transporter.getInput().getDigestAlgorithm());
|
|
h.setHashValue(transporter.getInput().getHashCode());
|
|
i.setDocumentHash(h);
|
|
i.setDocumentReference(transporter.getInput().getName());
|
|
transporter.getReportInput().setDocumentIdentification(i);
|
|
}
|
|
}
|