@Test public void convertToMap() { MetaInjectMapping metaInjectMapping = new MetaInjectMapping(); metaInjectMapping.setSourceStep( SOURCE_STEP_NAME ); metaInjectMapping.setSourceField( SOURCE_FIELD_NAME ); metaInjectMapping.setTargetStep( TARGET_STEP_NAME ); metaInjectMapping.setTargetField( TARGET_FIELD_NAME ); Map<TargetStepAttribute, SourceStepField> actualResult = MetaInjectMeta.convertToMap( Collections.singletonList( metaInjectMapping ) ); assertEquals( 1, actualResult.size() ); TargetStepAttribute targetStepAttribute = actualResult.keySet().iterator().next(); assertEquals( TARGET_STEP_NAME, targetStepAttribute.getStepname() ); assertEquals( TARGET_FIELD_NAME, targetStepAttribute.getAttributeKey() ); SourceStepField sourceStepField = actualResult.values().iterator().next(); assertEquals( SOURCE_STEP_NAME, sourceStepField.getStepname() ); assertEquals( SOURCE_FIELD_NAME, sourceStepField.getField() ); }
static Map<TargetStepAttribute, SourceStepField> convertToMap( List<MetaInjectMapping> metaInjectMapping ) { Map<TargetStepAttribute, SourceStepField> targetToSourceMap = new HashMap<TargetStepAttribute, SourceStepField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetStepAttribute targetStepAttribute = createTargetStepAttribute( mappingEntry ); SourceStepField sourceStepField = createSourceStepField( mappingEntry ); targetToSourceMap.put( targetStepAttribute, sourceStepField ); } return targetToSourceMap; }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { static Map<TargetStepAttribute, SourceStepField> convertToMap( List<MetaInjectMapping> metaInjectMapping ) { Map<TargetStepAttribute, SourceStepField> targetToSourceMap = new HashMap<TargetStepAttribute, SourceStepField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetStepAttribute targetStepAttribute = createTargetStepAttribute( mappingEntry ); SourceStepField sourceStepField = createSourceStepField( mappingEntry ); targetToSourceMap.put( targetStepAttribute, sourceStepField ); } return targetToSourceMap; } }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { static Map<TargetStepAttribute, SourceStepField> convertToMap( List<MetaInjectMapping> metaInjectMapping ) { Map<TargetStepAttribute, SourceStepField> targetToSourceMap = new HashMap<TargetStepAttribute, SourceStepField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetStepAttribute targetStepAttribute = createTargetStepAttribute( mappingEntry ); SourceStepField sourceStepField = createSourceStepField( mappingEntry ); targetToSourceMap.put( targetStepAttribute, sourceStepField ); } return targetToSourceMap; } MetaInjectMeta(); }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { static Map<TargetStepAttribute, SourceStepField> convertToMap( List<MetaInjectMapping> metaInjectMapping ) { Map<TargetStepAttribute, SourceStepField> targetToSourceMap = new HashMap<TargetStepAttribute, SourceStepField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetStepAttribute targetStepAttribute = createTargetStepAttribute( mappingEntry ); SourceStepField sourceStepField = createSourceStepField( mappingEntry ); targetToSourceMap.put( targetStepAttribute, sourceStepField ); } return targetToSourceMap; } MetaInjectMeta(); @Override Object clone(); @Override void setDefault(); @Override String getXML(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @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 getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); Map<TargetStepAttribute, SourceStepField> getTargetSourceMapping(); void setTargetSourceMapping( Map<TargetStepAttribute, SourceStepField> targetSourceMapping ); String getTransName(); void setTransName( String transName ); String getFileName(); void setFileName( String fileName ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId ); @Injection( name = "TRANS_OBJECT_ID" ) void setTransStringObjectId( String transStringObjectId ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); @Deprecated static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta mappingMeta, Repository rep,
                                                                     VariableSpace space ); static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta injectMeta, Repository rep,
                                                                     IMetaStore metaStore, VariableSpace space ); @Override List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); @Override boolean excludeFromCopyDistributeVerification(); @Override boolean excludeFromRowLayoutVerification(); String getSourceStepName(); void setSourceStepName( String sourceStepName ); String getTargetFile(); void setTargetFile( String targetFile ); boolean isNoExecution(); void setNoExecution( boolean noExecution ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override String getActiveReferencedObjectDescription(); @Override @Deprecated Object loadReferencedObject( int index, Repository rep, VariableSpace space ); @Override Object loadReferencedObject( int index, Repository rep, IMetaStore metaStore, VariableSpace space ); String getStreamSourceStepname(); void setStreamSourceStepname( String streamSourceStepname ); StepMeta getStreamSourceStep(); void setStreamSourceStep( StepMeta streamSourceStep ); String getStreamTargetStepname(); void setStreamTargetStepname( String streamTargetStepname ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); List<MetaInjectOutputField> getSourceOutputFields(); void setSourceOutputFields( List<MetaInjectOutputField> sourceOutputFields ); List<MetaInjectMapping> getMetaInjectMapping(); void setMetaInjectMapping( List<MetaInjectMapping> metaInjectMapping ); void actualizeMetaInjectMapping(); @Override void onStepChange( TransMeta transMeta, StepMeta oldMeta, StepMeta newMeta ); }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { static Map<TargetStepAttribute, SourceStepField> convertToMap( List<MetaInjectMapping> metaInjectMapping ) { Map<TargetStepAttribute, SourceStepField> targetToSourceMap = new HashMap<TargetStepAttribute, SourceStepField>(); for ( MetaInjectMapping mappingEntry : metaInjectMapping ) { if ( !isMappingEntryFilled( mappingEntry ) ) { continue; } TargetStepAttribute targetStepAttribute = createTargetStepAttribute( mappingEntry ); SourceStepField sourceStepField = createSourceStepField( mappingEntry ); targetToSourceMap.put( targetStepAttribute, sourceStepField ); } return targetToSourceMap; } MetaInjectMeta(); @Override Object clone(); @Override void setDefault(); @Override String getXML(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @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 getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); Map<TargetStepAttribute, SourceStepField> getTargetSourceMapping(); void setTargetSourceMapping( Map<TargetStepAttribute, SourceStepField> targetSourceMapping ); String getTransName(); void setTransName( String transName ); String getFileName(); void setFileName( String fileName ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId ); @Injection( name = "TRANS_OBJECT_ID" ) void setTransStringObjectId( String transStringObjectId ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); @Deprecated static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta mappingMeta, Repository rep,
                                                                     VariableSpace space ); static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta injectMeta, Repository rep,
                                                                     IMetaStore metaStore, VariableSpace space ); @Override List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); @Override boolean excludeFromCopyDistributeVerification(); @Override boolean excludeFromRowLayoutVerification(); String getSourceStepName(); void setSourceStepName( String sourceStepName ); String getTargetFile(); void setTargetFile( String targetFile ); boolean isNoExecution(); void setNoExecution( boolean noExecution ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override String getActiveReferencedObjectDescription(); @Override @Deprecated Object loadReferencedObject( int index, Repository rep, VariableSpace space ); @Override Object loadReferencedObject( int index, Repository rep, IMetaStore metaStore, VariableSpace space ); String getStreamSourceStepname(); void setStreamSourceStepname( String streamSourceStepname ); StepMeta getStreamSourceStep(); void setStreamSourceStep( StepMeta streamSourceStep ); String getStreamTargetStepname(); void setStreamTargetStepname( String streamTargetStepname ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); List<MetaInjectOutputField> getSourceOutputFields(); void setSourceOutputFields( List<MetaInjectOutputField> sourceOutputFields ); List<MetaInjectMapping> getMetaInjectMapping(); void setMetaInjectMapping( List<MetaInjectMapping> metaInjectMapping ); void actualizeMetaInjectMapping(); @Override void onStepChange( TransMeta transMeta, StepMeta oldMeta, StepMeta newMeta );  }