@Test public void testClone() throws KettleException { AccessInputMeta meta = new AccessInputMeta(); meta.allocate( 3, 2 ); meta.setFileName( new String[] { "file1", "file2", "file3" } ); meta.setFileMask( new String[] { "mask1", "mask2", "mask3" } ); meta.setExcludeFileMask( new String[] { "exmask1", "exmask2", "exmask3" } ); meta.setFileRequired( new String[] { "false", "true", "false" } ); meta.setIncludeSubFolders( new String[] { "true", "false", "true" } ); AccessInputField f1 = new AccessInputField( "field1" ); AccessInputField f2 = new AccessInputField( "field2" ); meta.setInputFields( new AccessInputField[] { f1, f2 } ); meta.setFilenameField( "aFileNameField" ); AccessInputMeta aClone = (AccessInputMeta) meta.clone(); assertFalse( aClone == meta ); assertTrue( Arrays.equals( aClone.getFileName(), meta.getFileName() ) ); assertTrue( Arrays.equals( aClone.getFileMask(), meta.getFileMask() ) ); assertTrue( Arrays.equals( aClone.getExcludeFileMask(), meta.getExcludeFileMask() ) ); assertTrue( Arrays.equals( aClone.getFileRequired(), meta.getFileRequired() ) ); assertTrue( Arrays.equals( aClone.getIncludeSubFolders(), meta.getIncludeSubFolders() ) ); AccessInputField[] clFields = aClone.getInputFields(); assertEquals( f1.getName(), clFields[0].getName() ); assertEquals( f2.getName(), clFields[1].getName() ); assertEquals( meta.getFilenameField(), aClone.getFilenameField() ); assertEquals( meta.getXML(), aClone.getXML() ); }
@Override public Object clone() { AccessInputMeta retval = (AccessInputMeta) super.clone(); int nrFiles = fileName.length; int nrFields = inputFields.length; retval.allocate( nrFiles, nrFields ); System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles ); System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles ); System.arraycopy( excludeFileMask, 0, retval.excludeFileMask, 0, nrFiles ); System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles ); System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles ); for ( int i = 0; i < nrFields; i++ ) { if ( inputFields[i] != null ) { retval.inputFields[i] = (AccessInputField) inputFields[i].clone(); } } return retval; }
AccessInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public Object clone() { AccessInputMeta retval = (AccessInputMeta) super.clone(); int nrFiles = fileName.length; int nrFields = inputFields.length; retval.allocate( nrFiles, nrFields ); System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles ); System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles ); System.arraycopy( excludeFileMask, 0, retval.excludeFileMask, 0, nrFiles ); System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles ); System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles ); for ( int i = 0; i < nrFields; i++ ) { if ( inputFields[i] != null ) { retval.inputFields[i] = (AccessInputField) inputFields[i].clone(); } } return retval; } }
AccessInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public Object clone() { AccessInputMeta retval = (AccessInputMeta) super.clone(); int nrFiles = fileName.length; int nrFields = inputFields.length; retval.allocate( nrFiles, nrFields ); System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles ); System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles ); System.arraycopy( excludeFileMask, 0, retval.excludeFileMask, 0, nrFiles ); System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles ); System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles ); for ( int i = 0; i < nrFields; i++ ) { if ( inputFields[i] != null ) { retval.inputFields[i] = (AccessInputField) inputFields[i].clone(); } } return retval; } AccessInputMeta(); }
AccessInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public Object clone() { AccessInputMeta retval = (AccessInputMeta) super.clone(); int nrFiles = fileName.length; int nrFields = inputFields.length; retval.allocate( nrFiles, nrFields ); System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles ); System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles ); System.arraycopy( excludeFileMask, 0, retval.excludeFileMask, 0, nrFiles ); System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles ); System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles ); for ( int i = 0; i < nrFields; i++ ) { if ( inputFields[i] != null ) { retval.inputFields[i] = (AccessInputField) inputFields[i].clone(); } } return retval; } AccessInputMeta(); String getExtensionField(); void setExtensionField( String field ); String getSizeField(); void setSizeField( String field ); String getShortFileNameField(); void setShortFileNameField( String field ); String getPathField(); void setPathField( String field ); String isHiddenField(); @Deprecated void setIsHiddenField( String field ); void setHiddenField( String field ); String getLastModificationDateField(); void setLastModificationDateField( String field ); String getUriField(); void setUriField( String field ); String getRootUriField(); void setRootUriField( String field ); AccessInputField[] getInputFields(); void setInputFields( AccessInputField[] inputFields ); String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); String[] getFileMask(); String[] getFileRequired(); String getRequiredFilesDesc( String tt ); void setFileMask( String[] fileMask ); void setFileRequired( String[] fileRequiredin ); String getRequiredFilesCode( String tt ); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String[] getFileName(); void setFileName( String[] fileName ); String getFilenameField(); String getDynamicFilenameField(); void setDynamicFilenameField( String dynamicFilenameField ); void setFilenameField( String filenameField ); @Deprecated boolean includeFilename(); boolean isIncludeFilename(); @Deprecated boolean includeTablename(); boolean isIncludeTablename(); void setIncludeFilename( boolean includeFilename ); void setIncludeTablename( boolean includeTablename ); @Deprecated boolean includeRowNumber(); boolean isIncludeRowNumber(); boolean isFileField(); void setFileField( boolean filefield ); @Deprecated boolean resetRowNumber(); boolean isResetRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); void setAddResultFile( boolean isaddresult ); boolean isAddResultFile(); void setResetRowNumber( boolean resetRowNumber ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); @Deprecated String gettablenameField(); String getTablenameField(); String getTableName(); void setRowNumberField( String rowNumberField ); void setTablenameField( String tablenameField ); void setTableName( String TableName ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); @Override String getXML(); void allocate( int nrfiles, int nrfields ); void allocateFiles( int nrfiles ); void allocateFields( int nrfields ); @Override void setDefault(); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); static final int getTrimTypeByCode( String tt ); @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 ); FileInputList getFiles( VariableSpace space ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); static String getFilename( FileObject fileObject ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
    Trans trans ); @Override StepDataInterface getStepData(); @Override boolean supportsErrorHandling(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); static ValueMetaInterface getValueMeta( Column c ); static ValueMetaAndData getValueMetaAndData( Column c, String name, Object data ); @Override StepMetaInjectionInterface getStepMetaInjectionInterface(); }
AccessInputMeta extends BaseStepMeta implements StepMetaInterface { @Override public Object clone() { AccessInputMeta retval = (AccessInputMeta) super.clone(); int nrFiles = fileName.length; int nrFields = inputFields.length; retval.allocate( nrFiles, nrFields ); System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles ); System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles ); System.arraycopy( excludeFileMask, 0, retval.excludeFileMask, 0, nrFiles ); System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles ); System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles ); for ( int i = 0; i < nrFields; i++ ) { if ( inputFields[i] != null ) { retval.inputFields[i] = (AccessInputField) inputFields[i].clone(); } } return retval; } AccessInputMeta(); String getExtensionField(); void setExtensionField( String field ); String getSizeField(); void setSizeField( String field ); String getShortFileNameField(); void setShortFileNameField( String field ); String getPathField(); void setPathField( String field ); String isHiddenField(); @Deprecated void setIsHiddenField( String field ); void setHiddenField( String field ); String getLastModificationDateField(); void setLastModificationDateField( String field ); String getUriField(); void setUriField( String field ); String getRootUriField(); void setRootUriField( String field ); AccessInputField[] getInputFields(); void setInputFields( AccessInputField[] inputFields ); String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); String[] getFileMask(); String[] getFileRequired(); String getRequiredFilesDesc( String tt ); void setFileMask( String[] fileMask ); void setFileRequired( String[] fileRequiredin ); String getRequiredFilesCode( String tt ); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String[] getFileName(); void setFileName( String[] fileName ); String getFilenameField(); String getDynamicFilenameField(); void setDynamicFilenameField( String dynamicFilenameField ); void setFilenameField( String filenameField ); @Deprecated boolean includeFilename(); boolean isIncludeFilename(); @Deprecated boolean includeTablename(); boolean isIncludeTablename(); void setIncludeFilename( boolean includeFilename ); void setIncludeTablename( boolean includeTablename ); @Deprecated boolean includeRowNumber(); boolean isIncludeRowNumber(); boolean isFileField(); void setFileField( boolean filefield ); @Deprecated boolean resetRowNumber(); boolean isResetRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); void setAddResultFile( boolean isaddresult ); boolean isAddResultFile(); void setResetRowNumber( boolean resetRowNumber ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); @Deprecated String gettablenameField(); String getTablenameField(); String getTableName(); void setRowNumberField( String rowNumberField ); void setTablenameField( String tablenameField ); void setTableName( String TableName ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override Object clone(); @Override String getXML(); void allocate( int nrfiles, int nrfields ); void allocateFiles( int nrfiles ); void allocateFields( int nrfields ); @Override void setDefault(); @Override void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ); static final int getTrimTypeByCode( String tt ); @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 ); FileInputList getFiles( VariableSpace space ); @Override void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ); static String getFilename( FileObject fileObject ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
    Trans trans ); @Override StepDataInterface getStepData(); @Override boolean supportsErrorHandling(); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
    ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); static ValueMetaInterface getValueMeta( Column c ); static ValueMetaAndData getValueMetaAndData( Column c, String name, Object data ); @Override StepMetaInjectionInterface getStepMetaInjectionInterface(); static final String[] RequiredFilesDesc; static final String[] RequiredFilesCode; static final String[] type_trim_code; static final String PREFIX_SYSTEM; }