All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opentext.ia.sdk.sip.PdiAssembler Maven / Gradle / Ivy

There is a newer version: 12.8.4
Show newest version
/*
 * 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