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

org.eobjects.analyzer.beans.api.Transformer Maven / Gradle / Ivy

/**
 * eobjects.org AnalyzerBeans
 * Copyright (C) 2010 eobjects.org
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.eobjects.analyzer.beans.api;

import org.eobjects.analyzer.data.InputRow;

/**
 * Interface for components that transform data before analysis. Transformers
 * work pretty much the same way as row processing analyzers, except that their
 * output is not a finished result, but rather a new, enhanced, row with more
 * values than the incoming row.
 * 
 * The transform(InputRow) method will be invoked on the transformer for each
 * row in a configured datastore. To retrieve the values from the row
 * InputColumn instances must be used as qualifiers. These InputColumns needs to
 * be injected (either a single instance or an array) using the @Configured
 * annotation. If no @Configured InputColumns are found in the class, the
 * transformer will not be able to execute.
 * 
 * Use of the @TransformerBean annotation is required for transformers in order
 * to be automatically discovered.
 * 
 * While the above description covers most common usage of the transformer
 * interface, there are however a few ways to build even more advanced
 * transformations:
 * 
    *
  • Transformers can inject an {@link OutputRowCollector} in order to output * multiple records.
  • *
  • Transformers can specify that their output type is Object and specify * more specific types in the {@link #getOutputColumns()} method.
  • * * @see TransformerBean * @see Configured * @see OutputRowCollector * @see OutputColumns * * @param * the type of the new/transformed values */ public interface Transformer { /** * Gets the output columns (given the current configuration) of this * transformer. * * @return an object with the information needed to create the output * columns */ public OutputColumns getOutputColumns(); /** * Transforms a row of input values to the corresponding transformed values * * @param inputRow * @return an array of transformed values. */ public E[] transform(InputRow inputRow); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy