@Test public void setEntryValue_string() throws KettleValueException { StepInjectionMetaEntry entry = mock( StepInjectionMetaEntry.class ); doReturn( ValueMetaInterface.TYPE_STRING ).when( entry ).getValueType(); RowMetaAndData row = createRowMetaAndData( new ValueMetaString( TEST_FIELD ), TEST_VALUE ); SourceStepField sourceField = new SourceStepField( TEST_SOURCE_STEP_NAME, TEST_FIELD ); MetaInject.setEntryValue( entry, row, sourceField ); verify( entry ).setValue( TEST_VALUE ); }
static void setEntryValue( StepInjectionMetaEntry entry, RowMetaAndData row, SourceStepField source ) throws KettleValueException { Object value = null; switch ( entry.getValueType() ) { case ValueMetaInterface.TYPE_STRING: value = row.getString( source.getField(), null ); break; case ValueMetaInterface.TYPE_BOOLEAN: value = row.getBoolean( source.getField(), false ); break; case ValueMetaInterface.TYPE_INTEGER: value = row.getInteger( source.getField(), 0L ); break; case ValueMetaInterface.TYPE_NUMBER: value = row.getNumber( source.getField(), 0.0D ); break; case ValueMetaInterface.TYPE_DATE: value = row.getDate( source.getField(), null ); break; case ValueMetaInterface.TYPE_BIGNUMBER: value = row.getBigNumber( source.getField(), null ); break; default: break; } entry.setValue( value ); }
MetaInject extends BaseStep implements StepInterface { static void setEntryValue( StepInjectionMetaEntry entry, RowMetaAndData row, SourceStepField source ) throws KettleValueException { Object value = null; switch ( entry.getValueType() ) { case ValueMetaInterface.TYPE_STRING: value = row.getString( source.getField(), null ); break; case ValueMetaInterface.TYPE_BOOLEAN: value = row.getBoolean( source.getField(), false ); break; case ValueMetaInterface.TYPE_INTEGER: value = row.getInteger( source.getField(), 0L ); break; case ValueMetaInterface.TYPE_NUMBER: value = row.getNumber( source.getField(), 0.0D ); break; case ValueMetaInterface.TYPE_DATE: value = row.getDate( source.getField(), null ); break; case ValueMetaInterface.TYPE_BIGNUMBER: value = row.getBigNumber( source.getField(), null ); break; default: break; } entry.setValue( value ); } }
MetaInject extends BaseStep implements StepInterface { static void setEntryValue( StepInjectionMetaEntry entry, RowMetaAndData row, SourceStepField source ) throws KettleValueException { Object value = null; switch ( entry.getValueType() ) { case ValueMetaInterface.TYPE_STRING: value = row.getString( source.getField(), null ); break; case ValueMetaInterface.TYPE_BOOLEAN: value = row.getBoolean( source.getField(), false ); break; case ValueMetaInterface.TYPE_INTEGER: value = row.getInteger( source.getField(), 0L ); break; case ValueMetaInterface.TYPE_NUMBER: value = row.getNumber( source.getField(), 0.0D ); break; case ValueMetaInterface.TYPE_DATE: value = row.getDate( source.getField(), null ); break; case ValueMetaInterface.TYPE_BIGNUMBER: value = row.getBigNumber( source.getField(), null ); break; default: break; } entry.setValue( value ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); }
MetaInject extends BaseStep implements StepInterface { static void setEntryValue( StepInjectionMetaEntry entry, RowMetaAndData row, SourceStepField source ) throws KettleValueException { Object value = null; switch ( entry.getValueType() ) { case ValueMetaInterface.TYPE_STRING: value = row.getString( source.getField(), null ); break; case ValueMetaInterface.TYPE_BOOLEAN: value = row.getBoolean( source.getField(), false ); break; case ValueMetaInterface.TYPE_INTEGER: value = row.getInteger( source.getField(), 0L ); break; case ValueMetaInterface.TYPE_NUMBER: value = row.getNumber( source.getField(), 0.0D ); break; case ValueMetaInterface.TYPE_DATE: value = row.getDate( source.getField(), null ); break; case ValueMetaInterface.TYPE_BIGNUMBER: value = row.getBigNumber( source.getField(), null ); break; default: break; } entry.setValue( value ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); static void removeUnavailableStepsFromMapping( Map<TargetStepAttribute, SourceStepField> targetMap,
      Set<SourceStepField> unavailableSourceSteps, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<TargetStepAttribute> getUnavailableTargetSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta ); static Set<TargetStepAttribute> getUnavailableTargetKeys( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta sourceTransMeta, StepMeta stepMeta ); }
MetaInject extends BaseStep implements StepInterface { static void setEntryValue( StepInjectionMetaEntry entry, RowMetaAndData row, SourceStepField source ) throws KettleValueException { Object value = null; switch ( entry.getValueType() ) { case ValueMetaInterface.TYPE_STRING: value = row.getString( source.getField(), null ); break; case ValueMetaInterface.TYPE_BOOLEAN: value = row.getBoolean( source.getField(), false ); break; case ValueMetaInterface.TYPE_INTEGER: value = row.getInteger( source.getField(), 0L ); break; case ValueMetaInterface.TYPE_NUMBER: value = row.getNumber( source.getField(), 0.0D ); break; case ValueMetaInterface.TYPE_DATE: value = row.getDate( source.getField(), null ); break; case ValueMetaInterface.TYPE_BIGNUMBER: value = row.getBigNumber( source.getField(), null ); break; default: break; } entry.setValue( value ); } MetaInject( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); static void removeUnavailableStepsFromMapping( Map<TargetStepAttribute, SourceStepField> targetMap,
      Set<SourceStepField> unavailableSourceSteps, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<TargetStepAttribute> getUnavailableTargetSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta ); static Set<TargetStepAttribute> getUnavailableTargetKeys( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta injectedTransMeta, Set<TargetStepAttribute> unavailableTargetSteps ); static Set<SourceStepField> getUnavailableSourceSteps( Map<TargetStepAttribute, SourceStepField> targetMap,
      TransMeta sourceTransMeta, StepMeta stepMeta );  }