001// SPDX-License-Identifier: GPL-3.0-or-later 002 003package es.uvigo.esei.sing.textproc.step; 004 005import java.util.Set; 006 007import es.uvigo.esei.sing.textproc.entity.ProcessedDocument; 008import es.uvigo.esei.sing.textproc.step.xml.definition.AbstractProcessingStepParameter; 009 010/** 011 * Specifies the contract of any processing step service, which allows it to 012 * integrate with the application in an extensible manner. 013 * 014 * @author Alejandro González García 015 * @see AbstractProcessingStep 016 */ 017public interface ProcessingStepService { 018 /** 019 * Returns a new instance of the processing step contained by this service, 020 * which implements {@code AbstractProcessingStep}. No unchecked exceptions can 021 * be thrown by this method. 022 * 023 * @return The described instance. It must not be {@code null}. 024 */ 025 public AbstractProcessingStep create(); 026 027 /** 028 * Returns the unique name of the processing step represented by this service. 029 * No unchecked exceptions can be thrown by this method. 030 * 031 * @return The described name. It must not be {@code null}. 032 */ 033 public String getName(); 034 035 /** 036 * Returns a set with every additional processing step parameter used by the 037 * processing step contained in this service. No unchecked exceptions can be 038 * thrown by this method. 039 * 040 * @return The described set. It can be empty and unmodifiable, but it must not 041 * be {@code null}, and not contain {@code null} elements. 042 */ 043 public Set<Class<? extends AbstractProcessingStepParameter>> getAdditionalParameters(); 044 045 /** 046 * Returns a set with every additional processed document types that the 047 * processing step contained in this service creates in the database. No 048 * unchecked exceptions can be thrown by this method. 049 * 050 * @return The described set. It can be empty and unmodifiable, but it must not 051 * be {@code null}, and not contain {@code null} elements. 052 */ 053 public Set<Class<? extends ProcessedDocument>> getProcessedDocumentTypes(); 054}