@Test public void testCleansePath() { assertEquals( "const.name", AvroInputData.cleansePath( "const.name" ) ); assertEquals( "const.${var_name}", AvroInputData.cleansePath( "const.${var.name}" ) ); assertEquals( "const.${var.name", AvroInputData.cleansePath( "const.${var.name" ) ); assertEquals( "const.${var_name}.${var_2_name}.const", AvroInputData.cleansePath( "const.${var.name}.${var.2.name}.const" ) ); }
public static String cleansePath( String path ) { int index = path.indexOf( "${" ); int endIndex = 0; String tempStr = path; while ( index >= 0 ) { index += 2; endIndex += tempStr.indexOf( "}" ); if ( endIndex > 0 && endIndex > index + 1 ) { String key = path.substring( index, endIndex ); String cleanKey = key.replace( '.', '_' ); path = path.replace( key, cleanKey ); } else { break; } if ( endIndex + 1 < path.length() ) { tempStr = path.substring( endIndex + 1, path.length() ); } else { break; } index = tempStr.indexOf( "${" ); if ( index > 0 ) { index += endIndex; } } return path; }
AvroInputData extends BaseStepData implements StepDataInterface { public static String cleansePath( String path ) { int index = path.indexOf( "${" ); int endIndex = 0; String tempStr = path; while ( index >= 0 ) { index += 2; endIndex += tempStr.indexOf( "}" ); if ( endIndex > 0 && endIndex > index + 1 ) { String key = path.substring( index, endIndex ); String cleanKey = key.replace( '.', '_' ); path = path.replace( key, cleanKey ); } else { break; } if ( endIndex + 1 < path.length() ) { tempStr = path.substring( endIndex + 1, path.length() ); } else { break; } index = tempStr.indexOf( "${" ); if ( index > 0 ) { index += endIndex; } } return path; } }
AvroInputData extends BaseStepData implements StepDataInterface { public static String cleansePath( String path ) { int index = path.indexOf( "${" ); int endIndex = 0; String tempStr = path; while ( index >= 0 ) { index += 2; endIndex += tempStr.indexOf( "}" ); if ( endIndex > 0 && endIndex > index + 1 ) { String key = path.substring( index, endIndex ); String cleanKey = key.replace( '.', '_' ); path = path.replace( key, cleanKey ); } else { break; } if ( endIndex + 1 < path.length() ) { tempStr = path.substring( endIndex + 1, path.length() ); } else { break; } index = tempStr.indexOf( "${" ); if ( index > 0 ) { index += endIndex; } } return path; }  }
AvroInputData extends BaseStepData implements StepDataInterface { public static String cleansePath( String path ) { int index = path.indexOf( "${" ); int endIndex = 0; String tempStr = path; while ( index >= 0 ) { index += 2; endIndex += tempStr.indexOf( "}" ); if ( endIndex > 0 && endIndex > index + 1 ) { String key = path.substring( index, endIndex ); String cleanKey = key.replace( '.', '_' ); path = path.replace( key, cleanKey ); } else { break; } if ( endIndex + 1 < path.length() ) { tempStr = path.substring( endIndex + 1, path.length() ); } else { break; } index = tempStr.indexOf( "${" ); if ( index > 0 ) { index += endIndex; } } return path; }  static String cleansePath( String path ); RowMetaInterface getOutputRowMeta(); void setOutputRowMeta( RowMetaInterface rmi ); void initializeFromFieldDecoding( String fieldNameToDecode, String readerSchemaFile,
      List<AvroInputMeta.AvroField> fields, boolean jsonEncoded, int newFieldOffset, boolean schemaInField,
      String schemaFieldName, boolean schemaFieldIsPath, boolean cacheSchemas, boolean ignoreMissing,
      LogChannelInterface log ); void establishFileType( FileObject avroFile, String readerSchemaFile, List<AvroInputMeta.AvroField> fields,
      boolean jsonEncoded, int newFieldOffset, boolean ignoreMissing, LogChannelInterface log ); Object[][] avroObjectToKettle( Object[] incoming, VariableSpace space ); void close(); }
AvroInputData extends BaseStepData implements StepDataInterface { public static String cleansePath( String path ) { int index = path.indexOf( "${" ); int endIndex = 0; String tempStr = path; while ( index >= 0 ) { index += 2; endIndex += tempStr.indexOf( "}" ); if ( endIndex > 0 && endIndex > index + 1 ) { String key = path.substring( index, endIndex ); String cleanKey = key.replace( '.', '_' ); path = path.replace( key, cleanKey ); } else { break; } if ( endIndex + 1 < path.length() ) { tempStr = path.substring( endIndex + 1, path.length() ); } else { break; } index = tempStr.indexOf( "${" ); if ( index > 0 ) { index += endIndex; } } return path; }  static String cleansePath( String path ); RowMetaInterface getOutputRowMeta(); void setOutputRowMeta( RowMetaInterface rmi ); void initializeFromFieldDecoding( String fieldNameToDecode, String readerSchemaFile,
      List<AvroInputMeta.AvroField> fields, boolean jsonEncoded, int newFieldOffset, boolean schemaInField,
      String schemaFieldName, boolean schemaFieldIsPath, boolean cacheSchemas, boolean ignoreMissing,
      LogChannelInterface log ); void establishFileType( FileObject avroFile, String readerSchemaFile, List<AvroInputMeta.AvroField> fields,
      boolean jsonEncoded, int newFieldOffset, boolean ignoreMissing, LogChannelInterface log ); Object[][] avroObjectToKettle( Object[] incoming, VariableSpace space ); void close();  }