@Test public void testNormilizeAllocation() throws KettleException { Assert.assertEquals( 3, meta.getFileName().length ); Assert.assertEquals( 3, meta.getFileMask().length ); Assert.assertEquals( 3, meta.getExcludeFileMask().length ); Assert.assertEquals( 3, meta.getFileRequired().length ); Assert.assertEquals( 3, meta.getIncludeSubFolders().length ); Assert.assertEquals( 4, meta.getSheetName().length ); Assert.assertEquals( 4, meta.getStartRow().length ); Assert.assertEquals( 4, meta.getStartColumn().length ); Assert.assertArrayEquals( new String[] { "1", "2", "3" }, meta.getFileName() ); Assert.assertArrayEquals( new String[] { "1", "2", "3", "4" }, meta.getSheetName() ); for ( String str : meta.getFileMask() ) { Assert.assertEquals( null, str ); } for ( String str : meta.getExcludeFileMask() ) { Assert.assertEquals( null, str ); } for ( String str : meta.getFileRequired() ) { Assert.assertEquals( null, str ); } for ( String str : meta.getIncludeSubFolders() ) { Assert.assertEquals( null, str ); } for ( int itr : meta.getStartRow() ) { Assert.assertEquals( 0, itr ); } for ( int itr : meta.getStartColumn() ) { Assert.assertEquals( 0, itr ); } }
public void normilizeAllocation() { int nrfiles = 0; int nrsheets = 0; if ( fileName != null ) { nrfiles = fileName.length; } else { fileName = new String[ 0 ]; } if ( sheetName != null ) { nrsheets = sheetName.length; } else { sheetName = new String[ 0 ]; } if ( field == null ) { field = new ExcelInputField[ 0 ]; } fileMask = normilizeArray( fileMask, nrfiles ); excludeFileMask = normilizeArray( excludeFileMask, nrfiles ); fileRequired = normilizeArray( fileRequired, nrfiles ); includeSubFolders = normilizeArray( includeSubFolders, nrfiles ); startRow = normilizeArray( startRow, nrsheets ); startColumn = normilizeArray( startColumn, nrsheets ); }
ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { public void normilizeAllocation() { int nrfiles = 0; int nrsheets = 0; if ( fileName != null ) { nrfiles = fileName.length; } else { fileName = new String[ 0 ]; } if ( sheetName != null ) { nrsheets = sheetName.length; } else { sheetName = new String[ 0 ]; } if ( field == null ) { field = new ExcelInputField[ 0 ]; } fileMask = normilizeArray( fileMask, nrfiles ); excludeFileMask = normilizeArray( excludeFileMask, nrfiles ); fileRequired = normilizeArray( fileRequired, nrfiles ); includeSubFolders = normilizeArray( includeSubFolders, nrfiles ); startRow = normilizeArray( startRow, nrsheets ); startColumn = normilizeArray( startColumn, nrsheets ); } }
ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { public void normilizeAllocation() { int nrfiles = 0; int nrsheets = 0; if ( fileName != null ) { nrfiles = fileName.length; } else { fileName = new String[ 0 ]; } if ( sheetName != null ) { nrsheets = sheetName.length; } else { sheetName = new String[ 0 ]; } if ( field == null ) { field = new ExcelInputField[ 0 ]; } fileMask = normilizeArray( fileMask, nrfiles ); excludeFileMask = normilizeArray( excludeFileMask, nrfiles ); fileRequired = normilizeArray( fileRequired, nrfiles ); includeSubFolders = normilizeArray( includeSubFolders, nrfiles ); startRow = normilizeArray( startRow, nrsheets ); startColumn = normilizeArray( startColumn, nrsheets ); } ExcelInputMeta(); }
ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { public void normilizeAllocation() { int nrfiles = 0; int nrsheets = 0; if ( fileName != null ) { nrfiles = fileName.length; } else { fileName = new String[ 0 ]; } if ( sheetName != null ) { nrsheets = sheetName.length; } else { sheetName = new String[ 0 ]; } if ( field == null ) { field = new ExcelInputField[ 0 ]; } fileMask = normilizeArray( fileMask, nrfiles ); excludeFileMask = normilizeArray( excludeFileMask, nrfiles ); fileRequired = normilizeArray( fileRequired, nrfiles ); includeSubFolders = normilizeArray( includeSubFolders, nrfiles ); startRow = normilizeArray( startRow, nrsheets ); startColumn = normilizeArray( startColumn, nrsheets ); } ExcelInputMeta(); String getShortFileNameField(); void setShortFileNameField( String field ); String getPathField(); void setPathField( String field ); String isHiddenField(); void setIsHiddenField( String field ); String getLastModificationDateField(); void setLastModificationDateField( String field ); String getUriField(); void setUriField( String field ); String getRootUriField(); void setRootUriField( String field ); String getExtensionField(); void setExtensionField( String field ); String getSizeField(); void setSizeField( String field ); ExcelInputField[] getField(); void setField( ExcelInputField[] fields ); String getFileField(); void setFileField( String fileField ); String[] getFileMask(); void setFileMask( String[] fileMask ); @Deprecated String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String getRequiredFilesCode( String tt ); String getRequiredFilesDesc( String tt ); String[] getFileName(); void setFileName( String[] fileName ); boolean ignoreEmptyRows(); void setIgnoreEmptyRows( boolean ignoreEmptyRows ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); void setRowNumberField( String rowNumberField ); String getSheetRowNumberField(); void setSheetRowNumberField( String rowNumberField ); String getSheetField(); void setSheetField( String sheetField ); String[] getSheetName(); void setSheetName( String[] sheetName ); int[] getStartColumn(); void setStartColumn( int[] startColumn ); int[] getStartRow(); void setStartRow( int[] startRow ); boolean startsWithHeader(); void setStartsWithHeader( boolean startsWithHeader ); boolean stopOnEmpty(); void setStopOnEmpty( boolean stopOnEmpty ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); String[] normilizeArray( String[] array, int length ); int[] normilizeArray( int[] array, int length ); void normilizeAllocation(); void allocate( int nrfiles, int nrsheets, int nrfields ); void allocateFiles( int nrfiles ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String name, 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 ); static final int getTrimTypeByCode( String tt ); static final int getTrimTypeByDesc( String tt ); static final String getTrimTypeCode( int i ); static final String getTrimTypeDesc( int i ); String[] getFilePaths( VariableSpace space ); FileInputList getFileList( VariableSpace space ); String getLookupStepname(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); String[] getInfoSteps(); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
                     RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
                     Repository repository, IMetaStore metaStore ); RowMetaInterface getEmptyFields(); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
                                TransMeta transMeta, Trans trans ); @Override StepDataInterface getStepData(); String getWarningFilesDestinationDirectory(); void setWarningFilesDestinationDirectory( String badLineFilesDestinationDirectory ); String getBadLineFilesExtension(); void setBadLineFilesExtension( String badLineFilesExtension ); boolean isErrorIgnored(); void setErrorIgnored( boolean errorIgnored ); String getErrorFilesDestinationDirectory(); void setErrorFilesDestinationDirectory( String errorLineFilesDestinationDirectory ); String getErrorFilesExtension(); void setErrorFilesExtension( String errorLineFilesExtension ); String getLineNumberFilesDestinationDirectory(); void setLineNumberFilesDestinationDirectory( String lineNumberFilesDestinationDirectory ); String getLineNumberFilesExtension(); void setLineNumberFilesExtension( String lineNumberFilesExtension ); boolean isErrorLineSkipped(); void setErrorLineSkipped( boolean errorLineSkipped ); boolean isStrictTypes(); void setStrictTypes( boolean strictTypes ); String[] getFileRequired(); void setFileRequired( String[] fileRequiredin ); String getAcceptingField(); void setAcceptingField( String acceptingField ); boolean isAcceptingFilenames(); void setAcceptingFilenames( boolean acceptingFilenames ); StepMeta getAcceptingStep(); void setAcceptingStep( StepMeta acceptingStep ); String getAcceptingStepName(); void setAcceptingStepName( String acceptingStepName ); @Override String[] getUsedLibraries(); String getEncoding(); void setEncoding( String encoding ); void setAddResultFile( boolean isaddresult ); boolean isAddResultFile(); boolean readAllSheets(); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); SpreadSheetType getSpreadSheetType(); void setSpreadSheetType( SpreadSheetType spreadSheetType ); @AfterInjection void afterInjectionSynchronization(); }
ExcelInputMeta extends BaseStepMeta implements StepMetaInterface { public void normilizeAllocation() { int nrfiles = 0; int nrsheets = 0; if ( fileName != null ) { nrfiles = fileName.length; } else { fileName = new String[ 0 ]; } if ( sheetName != null ) { nrsheets = sheetName.length; } else { sheetName = new String[ 0 ]; } if ( field == null ) { field = new ExcelInputField[ 0 ]; } fileMask = normilizeArray( fileMask, nrfiles ); excludeFileMask = normilizeArray( excludeFileMask, nrfiles ); fileRequired = normilizeArray( fileRequired, nrfiles ); includeSubFolders = normilizeArray( includeSubFolders, nrfiles ); startRow = normilizeArray( startRow, nrsheets ); startColumn = normilizeArray( startColumn, nrsheets ); } ExcelInputMeta(); String getShortFileNameField(); void setShortFileNameField( String field ); String getPathField(); void setPathField( String field ); String isHiddenField(); void setIsHiddenField( String field ); String getLastModificationDateField(); void setLastModificationDateField( String field ); String getUriField(); void setUriField( String field ); String getRootUriField(); void setRootUriField( String field ); String getExtensionField(); void setExtensionField( String field ); String getSizeField(); void setSizeField( String field ); ExcelInputField[] getField(); void setField( ExcelInputField[] fields ); String getFileField(); void setFileField( String fileField ); String[] getFileMask(); void setFileMask( String[] fileMask ); @Deprecated String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String getRequiredFilesCode( String tt ); String getRequiredFilesDesc( String tt ); String[] getFileName(); void setFileName( String[] fileName ); boolean ignoreEmptyRows(); void setIgnoreEmptyRows( boolean ignoreEmptyRows ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); void setRowNumberField( String rowNumberField ); String getSheetRowNumberField(); void setSheetRowNumberField( String rowNumberField ); String getSheetField(); void setSheetField( String sheetField ); String[] getSheetName(); void setSheetName( String[] sheetName ); int[] getStartColumn(); void setStartColumn( int[] startColumn ); int[] getStartRow(); void setStartRow( int[] startRow ); boolean startsWithHeader(); void setStartsWithHeader( boolean startsWithHeader ); boolean stopOnEmpty(); void setStopOnEmpty( boolean stopOnEmpty ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); String[] normilizeArray( String[] array, int length ); int[] normilizeArray( int[] array, int length ); void normilizeAllocation(); void allocate( int nrfiles, int nrsheets, int nrfields ); void allocateFiles( int nrfiles ); @Override void setDefault(); @Override void getFields( RowMetaInterface row, String name, 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 ); static final int getTrimTypeByCode( String tt ); static final int getTrimTypeByDesc( String tt ); static final String getTrimTypeCode( int i ); static final String getTrimTypeDesc( int i ); String[] getFilePaths( VariableSpace space ); FileInputList getFileList( VariableSpace space ); String getLookupStepname(); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); String[] getInfoSteps(); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
                     RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
                     Repository repository, IMetaStore metaStore ); RowMetaInterface getEmptyFields(); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr,
                                TransMeta transMeta, Trans trans ); @Override StepDataInterface getStepData(); String getWarningFilesDestinationDirectory(); void setWarningFilesDestinationDirectory( String badLineFilesDestinationDirectory ); String getBadLineFilesExtension(); void setBadLineFilesExtension( String badLineFilesExtension ); boolean isErrorIgnored(); void setErrorIgnored( boolean errorIgnored ); String getErrorFilesDestinationDirectory(); void setErrorFilesDestinationDirectory( String errorLineFilesDestinationDirectory ); String getErrorFilesExtension(); void setErrorFilesExtension( String errorLineFilesExtension ); String getLineNumberFilesDestinationDirectory(); void setLineNumberFilesDestinationDirectory( String lineNumberFilesDestinationDirectory ); String getLineNumberFilesExtension(); void setLineNumberFilesExtension( String lineNumberFilesExtension ); boolean isErrorLineSkipped(); void setErrorLineSkipped( boolean errorLineSkipped ); boolean isStrictTypes(); void setStrictTypes( boolean strictTypes ); String[] getFileRequired(); void setFileRequired( String[] fileRequiredin ); String getAcceptingField(); void setAcceptingField( String acceptingField ); boolean isAcceptingFilenames(); void setAcceptingFilenames( boolean acceptingFilenames ); StepMeta getAcceptingStep(); void setAcceptingStep( StepMeta acceptingStep ); String getAcceptingStepName(); void setAcceptingStepName( String acceptingStepName ); @Override String[] getUsedLibraries(); String getEncoding(); void setEncoding( String encoding ); void setAddResultFile( boolean isaddresult ); boolean isAddResultFile(); boolean readAllSheets(); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); SpreadSheetType getSpreadSheetType(); void setSpreadSheetType( SpreadSheetType spreadSheetType ); @AfterInjection void afterInjectionSynchronization(); static final String[] RequiredFilesDesc; static final String[] RequiredFilesCode; static final int TYPE_TRIM_NONE; static final int TYPE_TRIM_LEFT; static final int TYPE_TRIM_RIGHT; static final int TYPE_TRIM_BOTH; static final String[] type_trim_code; static final String[] type_trim_desc; static final String STRING_SEPARATOR; }