class ReplaceString extends BaseTransform<ReplaceStringMeta, ReplaceStringData> implements ITransform<ReplaceStringMeta, ReplaceStringData> {

  synchronized Object[] getOneRow( IRowMeta rowMeta, Object[] row ) throws HopException {

    Object[] rowData = RowDataUtil.resizeArray( row, data.outputRowMeta.size() );
    int index = 0;
    Set<Integer> numFieldsAlreadyBeenTransformed = new HashSet<Integer>();
    for ( int i = 0; i < data.numFields; i++ ) {

      IRowMeta currentRowMeta =
        ( numFieldsAlreadyBeenTransformed.contains( data.inStreamNrs[ i ] ) ) ? data.outputRowMeta : getInputRowMeta();
      String value =
        replaceString( currentRowMeta.getString( rowData, data.inStreamNrs[ i ] ), data.patterns[ i ],
          getResolvedReplaceByString( i, row ) );

      if ( Utils.isEmpty( data.outStreamNrs[ i ] ) ) {
        // update field value
        rowData[ data.inStreamNrs[ i ] ] = value;
        numFieldsAlreadyBeenTransformed.add( data.inStreamNrs[ i ] );
      } else {
        // add new field value
        rowData[ data.inputFieldsNr + index++ ] = value;
      }
    }
    return rowData;
  }

  public  ReplaceString( TransformMeta transformMeta, ReplaceStringMeta meta, ReplaceStringData data, int copyNr, PipelineMeta pipelineMeta,
                        Pipeline pipeline );

}