@Test public void testGetXML() throws Exception { LoadFileInputMeta testMeta = createMeta(); String xml = testMeta.getXML(); assertEquals( xmlOrig.replaceAll( "\n", "" ).replaceAll( "\r", "" ), xml.replaceAll( "\n", "" ).replaceAll( "\r", "" ) ); }
public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( INCLUDE, includeFilename ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_FIELD, filenameField ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM, includeRowNumber ) ); retval.append( " " + XMLHandler.addTagValue( ADDRESULTFILE, addresultfile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_EMPTY_FILE, IsIgnoreEmptyFile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_MISSING_PATH, IsIgnoreMissingPath ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM_FIELD, rowNumberField ) ); retval.append( " " + XMLHandler.addTagValue( ENCODING, encoding ) ); retval.append( " <" + FILE + ">" + Const.CR ); for ( int i = 0; i < fileName.length; i++ ) { retval.append( " " + XMLHandler.addTagValue( NAME, fileName[i] ) ); retval.append( " " + XMLHandler.addTagValue( FILEMASK, fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXCLUDE_FILEMASK, excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( FILE_REQUIRED, fileRequired[i] ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_SUBFOLDERS, includeSubFolders[i] ) ); } retval.append( " </" + FILE + ">" + Const.CR ); retval.append( " <" + FIELDS + ">" + Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { LoadFileInputField field = inputFields[i]; retval.append( field.getXML() ); } retval.append( " </" + FIELDS + ">" + Const.CR ); retval.append( " " + XMLHandler.addTagValue( LIMIT, rowLimit ) ); retval.append( " " + XMLHandler.addTagValue( IS_IN_FIELDS, fileinfield ) ); retval.append( " " + XMLHandler.addTagValue( DYNAMIC_FILENAME_FIELD, DynamicFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( SHORT_FILE_FIELD_NAME, shortFileFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( PATH_FIELD_NAME, pathFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( HIDDEN_FIELD_NAME, hiddenFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( URI_NAME_FIELD_NAME, uriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXTENSION_FIELD_NAME, extensionFieldName ) ); return retval.toString(); }
LoadFileInputMeta extends BaseStepMeta implements StepMetaInterface { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( INCLUDE, includeFilename ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_FIELD, filenameField ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM, includeRowNumber ) ); retval.append( " " + XMLHandler.addTagValue( ADDRESULTFILE, addresultfile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_EMPTY_FILE, IsIgnoreEmptyFile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_MISSING_PATH, IsIgnoreMissingPath ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM_FIELD, rowNumberField ) ); retval.append( " " + XMLHandler.addTagValue( ENCODING, encoding ) ); retval.append( " <" + FILE + ">" + Const.CR ); for ( int i = 0; i < fileName.length; i++ ) { retval.append( " " + XMLHandler.addTagValue( NAME, fileName[i] ) ); retval.append( " " + XMLHandler.addTagValue( FILEMASK, fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXCLUDE_FILEMASK, excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( FILE_REQUIRED, fileRequired[i] ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_SUBFOLDERS, includeSubFolders[i] ) ); } retval.append( " </" + FILE + ">" + Const.CR ); retval.append( " <" + FIELDS + ">" + Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { LoadFileInputField field = inputFields[i]; retval.append( field.getXML() ); } retval.append( " </" + FIELDS + ">" + Const.CR ); retval.append( " " + XMLHandler.addTagValue( LIMIT, rowLimit ) ); retval.append( " " + XMLHandler.addTagValue( IS_IN_FIELDS, fileinfield ) ); retval.append( " " + XMLHandler.addTagValue( DYNAMIC_FILENAME_FIELD, DynamicFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( SHORT_FILE_FIELD_NAME, shortFileFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( PATH_FIELD_NAME, pathFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( HIDDEN_FIELD_NAME, hiddenFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( URI_NAME_FIELD_NAME, uriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXTENSION_FIELD_NAME, extensionFieldName ) ); return retval.toString(); } }
LoadFileInputMeta extends BaseStepMeta implements StepMetaInterface { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( INCLUDE, includeFilename ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_FIELD, filenameField ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM, includeRowNumber ) ); retval.append( " " + XMLHandler.addTagValue( ADDRESULTFILE, addresultfile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_EMPTY_FILE, IsIgnoreEmptyFile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_MISSING_PATH, IsIgnoreMissingPath ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM_FIELD, rowNumberField ) ); retval.append( " " + XMLHandler.addTagValue( ENCODING, encoding ) ); retval.append( " <" + FILE + ">" + Const.CR ); for ( int i = 0; i < fileName.length; i++ ) { retval.append( " " + XMLHandler.addTagValue( NAME, fileName[i] ) ); retval.append( " " + XMLHandler.addTagValue( FILEMASK, fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXCLUDE_FILEMASK, excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( FILE_REQUIRED, fileRequired[i] ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_SUBFOLDERS, includeSubFolders[i] ) ); } retval.append( " </" + FILE + ">" + Const.CR ); retval.append( " <" + FIELDS + ">" + Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { LoadFileInputField field = inputFields[i]; retval.append( field.getXML() ); } retval.append( " </" + FIELDS + ">" + Const.CR ); retval.append( " " + XMLHandler.addTagValue( LIMIT, rowLimit ) ); retval.append( " " + XMLHandler.addTagValue( IS_IN_FIELDS, fileinfield ) ); retval.append( " " + XMLHandler.addTagValue( DYNAMIC_FILENAME_FIELD, DynamicFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( SHORT_FILE_FIELD_NAME, shortFileFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( PATH_FIELD_NAME, pathFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( HIDDEN_FIELD_NAME, hiddenFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( URI_NAME_FIELD_NAME, uriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXTENSION_FIELD_NAME, extensionFieldName ) ); return retval.toString(); } LoadFileInputMeta(); }
LoadFileInputMeta extends BaseStepMeta implements StepMetaInterface { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( INCLUDE, includeFilename ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_FIELD, filenameField ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM, includeRowNumber ) ); retval.append( " " + XMLHandler.addTagValue( ADDRESULTFILE, addresultfile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_EMPTY_FILE, IsIgnoreEmptyFile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_MISSING_PATH, IsIgnoreMissingPath ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM_FIELD, rowNumberField ) ); retval.append( " " + XMLHandler.addTagValue( ENCODING, encoding ) ); retval.append( " <" + FILE + ">" + Const.CR ); for ( int i = 0; i < fileName.length; i++ ) { retval.append( " " + XMLHandler.addTagValue( NAME, fileName[i] ) ); retval.append( " " + XMLHandler.addTagValue( FILEMASK, fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXCLUDE_FILEMASK, excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( FILE_REQUIRED, fileRequired[i] ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_SUBFOLDERS, includeSubFolders[i] ) ); } retval.append( " </" + FILE + ">" + Const.CR ); retval.append( " <" + FIELDS + ">" + Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { LoadFileInputField field = inputFields[i]; retval.append( field.getXML() ); } retval.append( " </" + FIELDS + ">" + Const.CR ); retval.append( " " + XMLHandler.addTagValue( LIMIT, rowLimit ) ); retval.append( " " + XMLHandler.addTagValue( IS_IN_FIELDS, fileinfield ) ); retval.append( " " + XMLHandler.addTagValue( DYNAMIC_FILENAME_FIELD, DynamicFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( SHORT_FILE_FIELD_NAME, shortFileFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( PATH_FIELD_NAME, pathFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( HIDDEN_FIELD_NAME, hiddenFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( URI_NAME_FIELD_NAME, uriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXTENSION_FIELD_NAME, extensionFieldName ) ); return retval.toString(); } LoadFileInputMeta(); 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[] getFileRequired(); void setFileRequired( String[] fileRequired ); @Deprecated String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); @Deprecated boolean addResultFile(); boolean getAddResultFile(); boolean isIgnoreEmptyFile(); void setIgnoreEmptyFile( boolean IsIgnoreEmptyFile ); boolean isIgnoreMissingPath(); void setIgnoreMissingPath( boolean IsIgnoreMissingPath ); void setAddResultFile( boolean addresultfile ); LoadFileInputField[] getInputFields(); void setInputFields( LoadFileInputField[] inputFields ); String getDynamicFilenameField(); void setDynamicFilenameField( String DynamicFilenameField ); boolean getFileInFields(); @Deprecated boolean getIsInFields(); @Deprecated void setIsInFields( boolean IsInFields ); void setFileInFields( boolean IsInFields ); String[] getFileMask(); void setFileMask( String[] fileMask ); String[] getFileName(); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String getRequiredFilesCode( String tt ); String getRequiredFilesDesc( String tt ); void setFileName( String[] fileName ); String getFilenameField(); void setFilenameField( String filenameField ); @Deprecated boolean includeFilename(); boolean getIncludeFilename(); void setIncludeFilename( boolean includeFilename ); @Deprecated boolean includeRowNumber(); boolean getIncludeRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); void setRowNumberField( String rowNumberField ); String getEncoding(); void setEncoding( String encoding ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); String getXML(); void allocate( int nrfiles, int nrfields ); void setDefault(); void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); FileInputList getFiles( VariableSpace space ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
      Trans trans ); StepDataInterface getStepData(); boolean supportsErrorHandling(); @Override boolean equals( Object o ); @Override int hashCode(); }
LoadFileInputMeta extends BaseStepMeta implements StepMetaInterface { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( INCLUDE, includeFilename ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_FIELD, filenameField ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM, includeRowNumber ) ); retval.append( " " + XMLHandler.addTagValue( ADDRESULTFILE, addresultfile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_EMPTY_FILE, IsIgnoreEmptyFile ) ); retval.append( " " + XMLHandler.addTagValue( IS_IGNORE_MISSING_PATH, IsIgnoreMissingPath ) ); retval.append( " " + XMLHandler.addTagValue( ROWNUM_FIELD, rowNumberField ) ); retval.append( " " + XMLHandler.addTagValue( ENCODING, encoding ) ); retval.append( " <" + FILE + ">" + Const.CR ); for ( int i = 0; i < fileName.length; i++ ) { retval.append( " " + XMLHandler.addTagValue( NAME, fileName[i] ) ); retval.append( " " + XMLHandler.addTagValue( FILEMASK, fileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXCLUDE_FILEMASK, excludeFileMask[i] ) ); retval.append( " " ).append( XMLHandler.addTagValue( FILE_REQUIRED, fileRequired[i] ) ); retval.append( " " + XMLHandler.addTagValue( INCLUDE_SUBFOLDERS, includeSubFolders[i] ) ); } retval.append( " </" + FILE + ">" + Const.CR ); retval.append( " <" + FIELDS + ">" + Const.CR ); for ( int i = 0; i < inputFields.length; i++ ) { LoadFileInputField field = inputFields[i]; retval.append( field.getXML() ); } retval.append( " </" + FIELDS + ">" + Const.CR ); retval.append( " " + XMLHandler.addTagValue( LIMIT, rowLimit ) ); retval.append( " " + XMLHandler.addTagValue( IS_IN_FIELDS, fileinfield ) ); retval.append( " " + XMLHandler.addTagValue( DYNAMIC_FILENAME_FIELD, DynamicFilenameField ) ); retval.append( " " ).append( XMLHandler.addTagValue( SHORT_FILE_FIELD_NAME, shortFileFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( PATH_FIELD_NAME, pathFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( HIDDEN_FIELD_NAME, hiddenFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( LAST_MODIFICATION_TIME_FIELD_NAME, lastModificationTimeFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( URI_NAME_FIELD_NAME, uriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( ROOT_URI_NAME_FIELD_NAME, rootUriNameFieldName ) ); retval.append( " " ).append( XMLHandler.addTagValue( EXTENSION_FIELD_NAME, extensionFieldName ) ); return retval.toString(); } LoadFileInputMeta(); 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[] getFileRequired(); void setFileRequired( String[] fileRequired ); @Deprecated String[] getExludeFileMask(); String[] getExcludeFileMask(); void setExcludeFileMask( String[] excludeFileMask ); @Deprecated boolean addResultFile(); boolean getAddResultFile(); boolean isIgnoreEmptyFile(); void setIgnoreEmptyFile( boolean IsIgnoreEmptyFile ); boolean isIgnoreMissingPath(); void setIgnoreMissingPath( boolean IsIgnoreMissingPath ); void setAddResultFile( boolean addresultfile ); LoadFileInputField[] getInputFields(); void setInputFields( LoadFileInputField[] inputFields ); String getDynamicFilenameField(); void setDynamicFilenameField( String DynamicFilenameField ); boolean getFileInFields(); @Deprecated boolean getIsInFields(); @Deprecated void setIsInFields( boolean IsInFields ); void setFileInFields( boolean IsInFields ); String[] getFileMask(); void setFileMask( String[] fileMask ); String[] getFileName(); String[] getIncludeSubFolders(); void setIncludeSubFolders( String[] includeSubFoldersin ); String getRequiredFilesCode( String tt ); String getRequiredFilesDesc( String tt ); void setFileName( String[] fileName ); String getFilenameField(); void setFilenameField( String filenameField ); @Deprecated boolean includeFilename(); boolean getIncludeFilename(); void setIncludeFilename( boolean includeFilename ); @Deprecated boolean includeRowNumber(); boolean getIncludeRowNumber(); void setIncludeRowNumber( boolean includeRowNumber ); long getRowLimit(); void setRowLimit( long rowLimit ); String getRowNumberField(); void setRowNumberField( String rowNumberField ); String getEncoding(); void setEncoding( String encoding ); void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); Object clone(); String getXML(); void allocate( int nrfiles, int nrfields ); void setDefault(); void getFields( RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space, Repository repository, IMetaStore metaStore ); void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); FileInputList getFiles( VariableSpace space ); void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
      String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
      IMetaStore metaStore ); String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
      ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore ); StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta,
      Trans trans ); StepDataInterface getStepData(); boolean supportsErrorHandling(); @Override boolean equals( Object o ); @Override int hashCode(); static final String[] RequiredFilesDesc; static final String[] RequiredFilesCode; }