@Test public void testGetFields() throws KettleStepException { CreditCardValidatorMeta meta = new CreditCardValidatorMeta(); meta.setDefault(); meta.setResultFieldName( "The Result Field" ); meta.setCardType( "The Card Type Field" ); meta.setNotValidMsg( "Is Card Valid" ); RowMeta rowMeta = new RowMeta(); meta.getFields( rowMeta, "this step", null, null, new Variables(), null, null ); assertEquals( 3, rowMeta.size() ); assertEquals( "The Result Field", rowMeta.getValueMeta( 0 ).getName() ); assertEquals( ValueMetaInterface.TYPE_BOOLEAN, rowMeta.getValueMeta( 0 ).getType() ); assertEquals( "this step", rowMeta.getValueMeta( 0 ).getOrigin() ); assertEquals( "The Card Type Field", rowMeta.getValueMeta( 1 ).getName() ); assertEquals( ValueMetaInterface.TYPE_STRING, rowMeta.getValueMeta( 1 ).getType() ); assertEquals( "this step", rowMeta.getValueMeta( 1 ).getOrigin() ); assertEquals( "Is Card Valid", rowMeta.getValueMeta( 2 ).getName() ); assertEquals( ValueMetaInterface.TYPE_STRING, rowMeta.getValueMeta( 2 ).getType() ); assertEquals( "this step", rowMeta.getValueMeta( 2 ).getOrigin() ); }
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldname = space.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = space.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { ValueMetaInterface v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = space.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { ValueMetaInterface v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } }
CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldname = space.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = space.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { ValueMetaInterface v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = space.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { ValueMetaInterface v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } } }
CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldname = space.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = space.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { ValueMetaInterface v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = space.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { ValueMetaInterface v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } } CreditCardValidatorMeta(); }
CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldname = space.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = space.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { ValueMetaInterface v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = space.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { ValueMetaInterface v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } } CreditCardValidatorMeta(); String getDynamicField(); void setDynamicField( String fieldname ); String getResultFieldName(); void setOnlyDigits( boolean onlydigits ); boolean isOnlyDigits(); void setResultFieldName( String resultfieldname ); void setCardType( String cardtype ); String getCardType(); void setNotValidMsg( String notvalidmsg ); String getNotValidMsg(); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); void setDefault(); void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); boolean supportsErrorHandling(); }
CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldname = space.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { ValueMetaInterface v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = space.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { ValueMetaInterface v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = space.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { ValueMetaInterface v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } } CreditCardValidatorMeta(); String getDynamicField(); void setDynamicField( String fieldname ); String getResultFieldName(); void setOnlyDigits( boolean onlydigits ); boolean isOnlyDigits(); void setResultFieldName( String resultfieldname ); void setCardType( String cardtype ); String getCardType(); void setNotValidMsg( String notvalidmsg ); String getNotValidMsg(); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); void setDefault(); void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); String getXML(); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); StepDataInterface getStepData(); boolean supportsErrorHandling();  }