com.opentext.ia.sdk.sip.PdiAssembler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infoarchive-sdk-core Show documentation
Show all versions of infoarchive-sdk-core Show documentation
A library that makes it quick and easy to create SIPs in InfoArchive
/*
* Copyright (c) 2016-2017 by OpenText Corporation. All Rights Reserved.
*/
package com.opentext.ia.sdk.sip;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
/**
* Assemble a PDI from domain objects.
* @param The type of domain objects to assemble the PDI from
*/
public abstract class PdiAssembler extends PrintWriterAssembler> {
/**
* Create an instance.
* @param validator Optional validator for checking whether the PDI meets expectations
*/
public PdiAssembler(Validator validator) {
super(validator);
}
@Override
protected final void add(HashedContents hashedContents, PrintWriter writer) throws IOException {
add(hashedContents.getSource(), hashedContents.getContentInfo(), writer);
}
/**
* Add a domain object.
* @param domainObject The domain object to add
* @param contentInfo The reference information and the encoded hashes of the content associated with the domain
* object
* @param writer The writer to print the PDI fragment to
* @throws IOException When an I/O error occures
*/
protected abstract void add(D domainObject, Map contentInfo, PrintWriter writer)
throws IOException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy