@Test public void testGetXML() { StreamLookupMeta streamLookupMeta = new StreamLookupMeta(); streamLookupMeta.setKeystream( new String[] { "testKeyStreamValue" } ); streamLookupMeta.setKeylookup( new String[] { "testKeyLookupValue" } ); streamLookupMeta.setValue( new String[] { "testValue" } ); streamLookupMeta.setValueName( new String[] {} ); streamLookupMeta.setValueDefault( new String[] {} ); streamLookupMeta.setValueDefaultType( new int[] {} ); streamLookupMeta.afterInjectionSynchronization(); streamLookupMeta.getXML(); Assert.assertEquals( streamLookupMeta.getKeystream().length, streamLookupMeta.getValueName().length ); Assert.assertEquals( streamLookupMeta.getKeystream().length, streamLookupMeta.getValueDefault().length ); Assert.assertEquals( streamLookupMeta.getKeystream().length, streamLookupMeta.getValueDefaultType().length ); }
@Override public String getXML() { StringBuilder retval = new StringBuilder(); StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 ); retval.append( " " ).append( XMLHandler.addTagValue( "from", infoStream.getStepname() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "input_sorted", isInputSorted() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "preserve_memory", isMemoryPreservationActive() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sorted_list", isUsingSortedList() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "integer_pair", isUsingIntegerPair() ) ); retval.append( " <lookup>" ).append( Const.CR ); for ( int i = 0; i < getKeystream().length; i++ ) { retval.append( " <key>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getKeystream()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "field", getKeylookup()[i] ) ); retval.append( " </key>" ).append( Const.CR ); } for ( int i = 0; i < getValue().length; i++ ) { retval.append( " <value>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getValue()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rename", getValueName()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "default", getValueDefault()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( getValueDefaultType()[i] ) ) ); retval.append( " </value>" ).append( Const.CR ); } retval.append( " </lookup>" ).append( Const.CR ); return retval.toString(); }
StreamLookupMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 ); retval.append( " " ).append( XMLHandler.addTagValue( "from", infoStream.getStepname() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "input_sorted", isInputSorted() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "preserve_memory", isMemoryPreservationActive() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sorted_list", isUsingSortedList() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "integer_pair", isUsingIntegerPair() ) ); retval.append( " <lookup>" ).append( Const.CR ); for ( int i = 0; i < getKeystream().length; i++ ) { retval.append( " <key>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getKeystream()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "field", getKeylookup()[i] ) ); retval.append( " </key>" ).append( Const.CR ); } for ( int i = 0; i < getValue().length; i++ ) { retval.append( " <value>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getValue()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rename", getValueName()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "default", getValueDefault()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( getValueDefaultType()[i] ) ) ); retval.append( " </value>" ).append( Const.CR ); } retval.append( " </lookup>" ).append( Const.CR ); return retval.toString(); } }
StreamLookupMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 ); retval.append( " " ).append( XMLHandler.addTagValue( "from", infoStream.getStepname() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "input_sorted", isInputSorted() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "preserve_memory", isMemoryPreservationActive() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sorted_list", isUsingSortedList() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "integer_pair", isUsingIntegerPair() ) ); retval.append( " <lookup>" ).append( Const.CR ); for ( int i = 0; i < getKeystream().length; i++ ) { retval.append( " <key>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getKeystream()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "field", getKeylookup()[i] ) ); retval.append( " </key>" ).append( Const.CR ); } for ( int i = 0; i < getValue().length; i++ ) { retval.append( " <value>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getValue()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rename", getValueName()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "default", getValueDefault()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( getValueDefaultType()[i] ) ) ); retval.append( " </value>" ).append( Const.CR ); } retval.append( " </lookup>" ).append( Const.CR ); return retval.toString(); } StreamLookupMeta(); }
StreamLookupMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 ); retval.append( " " ).append( XMLHandler.addTagValue( "from", infoStream.getStepname() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "input_sorted", isInputSorted() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "preserve_memory", isMemoryPreservationActive() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sorted_list", isUsingSortedList() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "integer_pair", isUsingIntegerPair() ) ); retval.append( " <lookup>" ).append( Const.CR ); for ( int i = 0; i < getKeystream().length; i++ ) { retval.append( " <key>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getKeystream()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "field", getKeylookup()[i] ) ); retval.append( " </key>" ).append( Const.CR ); } for ( int i = 0; i < getValue().length; i++ ) { retval.append( " <value>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getValue()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rename", getValueName()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "default", getValueDefault()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( getValueDefaultType()[i] ) ) ); retval.append( " </value>" ).append( Const.CR ); } retval.append( " </lookup>" ).append( Const.CR ); return retval.toString(); } StreamLookupMeta(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void allocate( int nrkeys, int nrvalues ); @Override Object clone(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); @Override StepDataInterface getStepData(); @Override boolean excludeFromRowLayoutVerification(); @Override StepIOMetaInterface getStepIOMeta(); @Override void resetStepIoMeta(); boolean isInputSorted(); void setInputSorted( boolean inputSorted ); String[] getKeylookup(); void setKeylookup( String[] keylookup ); String[] getKeystream(); void setKeystream( String[] keystream ); String[] getValue(); void setValue( String[] value ); String[] getValueDefault(); void setValueDefault( String[] valueDefault ); int[] getValueDefaultType(); void setValueDefaultType( int[] valueDefaultType ); String[] getValueName(); void setValueName( String[] valueName ); boolean isMemoryPreservationActive(); void setMemoryPreservationActive( boolean memoryPreservationActive ); boolean isUsingSortedList(); void setUsingSortedList( boolean usingSortedList ); boolean isUsingIntegerPair(); void setUsingIntegerPair( boolean usingIntegerPair ); @AfterInjection void afterInjectionSynchronization(); }
StreamLookupMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 ); retval.append( " " ).append( XMLHandler.addTagValue( "from", infoStream.getStepname() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "input_sorted", isInputSorted() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "preserve_memory", isMemoryPreservationActive() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "sorted_list", isUsingSortedList() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "integer_pair", isUsingIntegerPair() ) ); retval.append( " <lookup>" ).append( Const.CR ); for ( int i = 0; i < getKeystream().length; i++ ) { retval.append( " <key>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getKeystream()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "field", getKeylookup()[i] ) ); retval.append( " </key>" ).append( Const.CR ); } for ( int i = 0; i < getValue().length; i++ ) { retval.append( " <value>" ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "name", getValue()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "rename", getValueName()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "default", getValueDefault()[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( "type", ValueMetaFactory.getValueMetaName( getValueDefaultType()[i] ) ) ); retval.append( " </value>" ).append( Const.CR ); } retval.append( " </lookup>" ).append( Const.CR ); return retval.toString(); } StreamLookupMeta(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); void allocate( int nrkeys, int nrvalues ); @Override Object clone(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
    TransMeta transMeta, Trans trans ); @Override StepDataInterface getStepData(); @Override boolean excludeFromRowLayoutVerification(); @Override StepIOMetaInterface getStepIOMeta(); @Override void resetStepIoMeta(); boolean isInputSorted(); void setInputSorted( boolean inputSorted ); String[] getKeylookup(); void setKeylookup( String[] keylookup ); String[] getKeystream(); void setKeystream( String[] keystream ); String[] getValue(); void setValue( String[] value ); String[] getValueDefault(); void setValueDefault( String[] valueDefault ); int[] getValueDefaultType(); void setValueDefaultType( int[] valueDefaultType ); String[] getValueName(); void setValueName( String[] valueName ); boolean isMemoryPreservationActive(); void setMemoryPreservationActive( boolean memoryPreservationActive ); boolean isUsingSortedList(); void setUsingSortedList( boolean usingSortedList ); boolean isUsingIntegerPair(); void setUsingIntegerPair( boolean usingIntegerPair ); @AfterInjection void afterInjectionSynchronization();  }