• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RowGeneratorMeta类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta的典型用法代码示例。如果您正苦于以下问题:Java RowGeneratorMeta类的具体用法?Java RowGeneratorMeta怎么用?Java RowGeneratorMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RowGeneratorMeta类属于org.pentaho.di.trans.steps.rowgenerator包,在下文中一共展示了RowGeneratorMeta类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ok

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok()
{
	if (Const.isEmpty(wStepname.getText())) return;

	stepname = wStepname.getText(); // return value
       try
       {
           getInfo(new RowGeneratorMeta()); // to see if there is an exception
           getInfo(input);                  // to put the content on the input structure for real if all is well.
           dispose();
       }
       catch(KettleException e)
       {
           new ErrorDialog(shell, Messages.getString("RowGeneratorDialog.Illegal.Dialog.Settings.Title"), Messages.getString("RowGeneratorDialog.Illegal.Dialog.Settings.Message"), e);
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:RowGeneratorDialog.java


示例2: ok

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok()
{
	if (Const.isEmpty(wStepname.getText())) return;

	stepname = wStepname.getText(); // return value
       try
       {
           getInfo(new RowGeneratorMeta()); // to see if there is an exception
           getInfo(input);                  // to put the content on the input structure for real if all is well.
           dispose();
       }
       catch(KettleException e)
       {
           new ErrorDialog(shell, BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Title"), BaseMessages.getString(PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Message"), e);
       }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:17,代码来源:RowGeneratorDialog.java


示例3: createRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Creates a row generator step for this class..
 * 
 * @param name
 * @param registry
 * @return
 */
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
      
      // Default the name if it is empty
      String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
      
      //  create the RowGenerator and Step Meta
      RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
      String rowGeneratorPid = registry.getPluginId(StepPluginType.class,  rowGeneratorMeta);
      StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName,  rowGeneratorMeta);
 
      //  Set the field names, types and values
      rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
      rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
      rowGeneratorMeta.setValue(new String[]{"1", "Florida", "Orlando"});
      rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
      rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
      rowGeneratorMeta.setGroup(new String[]{"", "", ""});
      rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
      rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
      rowGeneratorMeta.setRowLimit("10");
      
      //  return the step meta
      return generateRowsStep;
  }
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:32,代码来源:JsonOutputTest.java


示例4: createRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Creates a row generator step for this class..
 * 
 * @param name
 * @param registry
 * @return
 */
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
    
    // Default the name if it is empty
    String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
    
    //  create the RowGenerator and Step Meta
    RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
    String rowGeneratorPid = registry.getPluginId(StepPluginType.class,  rowGeneratorMeta);
    StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName,  rowGeneratorMeta);
   
    //  Set the field names, types and values
    rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
    rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
    rowGeneratorMeta.setValue(new String[]{"1", "Orlando", "Florida"});
    rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
    rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
    rowGeneratorMeta.setGroup(new String[]{"", "", ""});
    rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
    rowGeneratorMeta.setCurrency(new String[]{"", "", ""});
    rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
    rowGeneratorMeta.setRowLimit("10");
    
    //  return the step meta
    return generateRowsStep;
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:33,代码来源:TextFileOutputTests.java


示例5: createRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Creates a row generator step for this class..
 * 
 * @param name
 * @param registry
 * @return
 */
private StepMeta createRowGeneratorStep(String name, PluginRegistry registry) {
      
      // Default the name if it is empty
      String testFileOutputName = (Const.isEmpty(name)?"generate rows":name);
      
      //  create the RowGenerator and Step Meta
      RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
      String rowGeneratorPid = registry.getPluginId(StepPluginType.class,  rowGeneratorMeta);
      StepMeta generateRowsStep = new StepMeta(rowGeneratorPid, testFileOutputName,  rowGeneratorMeta);
 
      //  Set the field names, types and values
      rowGeneratorMeta.setFieldName(new String[]{"Id", "State", "City"});
      rowGeneratorMeta.setFieldType(new String[]{"Integer", "String", "String"});
      rowGeneratorMeta.setValue(new String[]{"1", "Florida", "Orlando"});
      rowGeneratorMeta.setFieldLength(new int[]{-1, -1, -1});
      rowGeneratorMeta.setFieldPrecision(new int[]{-1, -1, -1});
      rowGeneratorMeta.setGroup(new String[]{"", "", ""});
      rowGeneratorMeta.setDecimal(new String[]{"", "", ""});
      rowGeneratorMeta.setCurrency(new String[]{"", "", ""});
      rowGeneratorMeta.setFieldFormat(new String[]{"", "", ""});
      rowGeneratorMeta.setRowLimit("10");
      
      //  return the step meta
      return generateRowsStep;
  }
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:33,代码来源:JsonOutputTest.java


示例6: createPDI14676Transformation

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private String createPDI14676Transformation() throws IOException, KettleException {
  // Setup Transformation
  String rowGenStepName = "Generate Rows";
  RowGeneratorMeta rowGenMeta = new RowGeneratorMeta();
  rowGenMeta.setRowLimit( String.valueOf( Integer.MAX_VALUE ) );
  rowGenMeta.setNeverEnding( true );
  rowGenMeta.setIntervalInMs( "0" );
  rowGenMeta.allocate( 0 );

  TransMeta tMeta = TransTestFactory.generateTestTransformation( new Variables(), rowGenMeta, rowGenStepName );
  
  // Remove the Injector step, as it's not needed for this transformation
  TransHopMeta hopToRemove = tMeta.findTransHop( tMeta.findStep( TransTestFactory.INJECTOR_STEPNAME ), tMeta.findStep( rowGenStepName ) );
  tMeta.removeTransHop( tMeta.indexOfTransHop( hopToRemove ) );
  tMeta.removeStep( tMeta.indexOfStep( tMeta.findStep( TransTestFactory.INJECTOR_STEPNAME ) ) );

  // Write transformation to temp file, for use within a job
  String transFilename = TestUtilities.createEmptyTempFile( this.getClass().getSimpleName() + "_PDI14676_", ".ktr" );
  FileObject transFile = TestUtils.getFileObject( transFilename );
  OutputStream outStream = transFile.getContent().getOutputStream();
  PrintWriter pw = new PrintWriter( outStream );
  pw.write( tMeta.getXML() );
  pw.close();
  outStream.close();
  return transFilename;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:JobEntryTransIntIT.java


示例7: createRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Creates a row generator step for this class..
 *
 * @param name
 * @param registry
 * @return
 */
private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) {

  // Default the name if it is empty
  String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name );

  // create the RowGenerator and Step Meta
  RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
  String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta );
  StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta );

  // Set the field names, types and values
  rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } );
  rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } );
  rowGeneratorMeta.setValue( new String[] { "1", "Orlando", "Florida" } );
  rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } );
  rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } );
  rowGeneratorMeta.setGroup( new String[] { "", "", "" } );
  rowGeneratorMeta.setDecimal( new String[] { "", "", "" } );
  rowGeneratorMeta.setCurrency( new String[] { "", "", "" } );
  rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } );
  rowGeneratorMeta.setRowLimit( "10" );

  // return the step meta
  return generateRowsStep;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:33,代码来源:TextFileOutputIT.java


示例8: ok

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void ok() {
  if ( Utils.isEmpty( wStepname.getText() ) ) {
    return;
  }

  stepname = wStepname.getText(); // return value
  try {
    getInfo( new RowGeneratorMeta() ); // to see if there is an exception
    getInfo( input ); // to put the content on the input structure for real if all is well.
    dispose();
  } catch ( KettleException e ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Title" ), BaseMessages
        .getString( PKG, "RowGeneratorDialog.Illegal.Dialog.Settings.Message" ), e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:RowGeneratorDialog.java


示例9: createRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Creates a row generator step for this class..
 * 
 * @param name
 * @param registry
 * @return
 */
private StepMeta createRowGeneratorStep( String name, PluginRegistry registry ) {

  // Default the name if it is empty
  String testFileOutputName = ( Utils.isEmpty( name ) ? "generate rows" : name );

  // create the RowGenerator and Step Meta
  RowGeneratorMeta rowGeneratorMeta = new RowGeneratorMeta();
  String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rowGeneratorMeta );
  StepMeta generateRowsStep = new StepMeta( rowGeneratorPid, testFileOutputName, rowGeneratorMeta );

  // Set the field names, types and values
  rowGeneratorMeta.setFieldName( new String[] { "Id", "State", "City" } );
  rowGeneratorMeta.setFieldType( new String[] { "Integer", "String", "String" } );
  rowGeneratorMeta.setValue( new String[] { "1", "Florida", "Orlando" } );
  rowGeneratorMeta.setFieldLength( new int[] { -1, -1, -1 } );
  rowGeneratorMeta.setFieldPrecision( new int[] { -1, -1, -1 } );
  rowGeneratorMeta.setGroup( new String[] { "", "", "" } );
  rowGeneratorMeta.setDecimal( new String[] { "", "", "" } );
  rowGeneratorMeta.setCurrency( new String[] { "", "", "" } );
  rowGeneratorMeta.setFieldFormat( new String[] { "", "", "" } );
  rowGeneratorMeta.setRowLimit( "10" );

  // return the step meta
  return generateRowsStep;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:33,代码来源:JsonOutputTest.java


示例10: generateTestTransformation

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation()
{
    RowGeneratorMeta A = new RowGeneratorMeta();
    A.allocate(3);
    A.setRowLimit("100000000");

    A.getFieldName()[0]   = "ID"; 
    A.getFieldType()[0]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
    A.getFieldLength()[0] = 7; 
    A.getValue()[0]       = "1234"; 
    
    A.getFieldName()[1]   = "Name"; 
    A.getFieldType()[1]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
    A.getFieldLength()[1] = 35; 
    A.getValue()[1]       = "Some name"; 

    A.getFieldName()[2]   = "Last updated"; 
    A.getFieldType()[2]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
    A.getFieldFormat()[2] = "yyyy/MM/dd"; 
    A.getValue()[2]       = "2006/11/13"; 

    TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
    transMeta.setName("Row generator test");
    transMeta.setSizeRowset(2500);
    transMeta.setFeedbackSize(50000);
    transMeta.setUsingThreadPriorityManagment(false);

    return new Trans(transMeta);
    
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:31,代码来源:Carte.java


示例11: getInfo

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void getInfo(RowGeneratorMeta meta) throws KettleException
{
    meta.setRowLimit( wLimit.getText() );
    
    int nrfields = wFields.nrNonEmpty();

    meta.allocate(nrfields);

    for (int i=0;i<nrfields;i++)
    {
        TableItem item = wFields.getNonEmpty(i);
        
        meta.getFieldName()[i]   = item.getText(1);
        meta.getFieldType()[i]   = item.getText(2);
        meta.getFieldFormat()[i] = item.getText(3);
        String slength           = item.getText(4);
        String sprec             = item.getText(5);
        meta.getCurrency()[i]    = item.getText(6);
        meta.getDecimal()[i]     = item.getText(7);
        meta.getGroup()[i]       = item.getText(8);
        meta.getValue()[i]       = item.getText(9);
        
        meta.getFieldLength()[i]    = Const.toInt( slength, -1);
        meta.getFieldPrecision()[i] = Const.toInt( sprec  , -1);
    }
    
    // Performs checks...
    /*
     * Commented out verification : if variables are used, this check is a pain!
     * 
    long longLimit = Const.toLong(transMeta.environmentSubstitute( wLimit.getText()), -1L );
    if (longLimit<0)
    {
        throw new KettleException( Messages.getString("RowGeneratorDialog.Wrong.RowLimit.Number") );
    }
    */
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:RowGeneratorDialog.java


示例12: getInfo

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void getInfo(RowGeneratorMeta meta) throws KettleException
{
    meta.setRowLimit( wLimit.getText() );
    
    int nrfields = wFields.nrNonEmpty();

    meta.allocate(nrfields);

    for (int i=0;i<nrfields;i++)
    {
        TableItem item = wFields.getNonEmpty(i);
        
        meta.getFieldName()[i]   = item.getText(1);
        meta.getFieldType()[i]   = item.getText(2);
        meta.getFieldFormat()[i] = item.getText(3);
        String slength           = item.getText(4);
        String sprec             = item.getText(5);
        meta.getCurrency()[i]    = item.getText(6);
        meta.getDecimal()[i]     = item.getText(7);
        meta.getGroup()[i]       = item.getText(8);
        meta.getValue()[i]       = item.getText(9);
        
        meta.getFieldLength()[i]    = Const.toInt( slength, -1);
        meta.getFieldPrecision()[i] = Const.toInt( sprec  , -1);
    }
    
    // Performs checks...
    /*
     * Commented out verification : if variables are used, this check is a pain!
     * 
    long longLimit = Const.toLong(transMeta.environmentSubstitute( wLimit.getText()), -1L );
    if (longLimit<0)
    {
        throw new KettleException( BaseMessages.getString(PKG, "RowGeneratorDialog.Wrong.RowLimit.Number") );
    }
    */
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:RowGeneratorDialog.java


示例13: generateTestTransformation

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation() {
  RowGeneratorMeta A = new RowGeneratorMeta();
  A.allocate(3);
  A.setRowLimit("10000000");

  A.getFieldName()[0] = "ID";
  A.getFieldType()[0] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
  A.getFieldLength()[0] = 7;
  A.getValue()[0] = "1234";

  A.getFieldName()[1] = "Name";
  A.getFieldType()[1] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
  A.getFieldLength()[1] = 35;
  A.getValue()[1] = "Some name";

  A.getFieldName()[2] = "Last updated";
  A.getFieldType()[2] = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
  A.getFieldFormat()[2] = "yyyy/MM/dd";
  A.getValue()[2] = "2010/02/09";

  TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
  transMeta.setName("CarteUnitTest");
  transMeta.setSizeRowset(2500);
  transMeta.setFeedbackSize(50000);
  transMeta.setUsingThreadPriorityManagment(false);

  return new Trans(transMeta);
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:29,代码来源:CarteTest.java


示例14: buildRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Builds a {@link RowGenerator} Step with a single String field.
 * 
 * @param registry Plugin Registry.
 * @param stepName Name to use for step
 * @return {@link StepMeta} for a Row Generator step. 
 */
private StepMeta buildRowGeneratorStep(PluginRegistry registry, String stepName) {
  RowGeneratorMeta rm = new RowGeneratorMeta();

  // Set the information of the row generator.                
  String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rm);
  StepMeta rowGeneratorStep = new StepMeta(rowGeneratorPid, stepName, rm);

  String fieldName[] = { "string" }; //$NON-NLS-1$
  String type[] = { "String" }; //$NON-NLS-1$
  String value[] = { "string_value" }; //$NON-NLS-1$
  String fieldFormat[] = { "" }; //$NON-NLS-1$
  String group[] = { "" }; //$NON-NLS-1$
  String decimal[] = { "" }; //$NON-NLS-1$
  int intDummies[] = { -1, -1, -1 };

  rm.setDefault();
  rm.setFieldName(fieldName);
  rm.setFieldType(type);
  rm.setValue(value);
  rm.setFieldLength(intDummies);
  rm.setFieldPrecision(intDummies);
  rm.setRowLimit("1"); //$NON-NLS-1$
  rm.setFieldFormat(fieldFormat);
  rm.setGroup(group);
  rm.setDecimal(decimal);

  return rowGeneratorStep;
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:36,代码来源:MappingTest.java


示例15: generateTestTransformation

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation()
{
    RowGeneratorMeta A = new RowGeneratorMeta();
    A.allocate(3);
    A.setRowLimit("100000000");

    A.getFieldName()[0]   = "ID"; 
    A.getFieldType()[0]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_INTEGER);
    A.getFieldLength()[0] = 7; 
    A.getValue()[0]       = "1234"; 
    
    A.getFieldName()[1]   = "Name"; 
    A.getFieldType()[1]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_STRING);
    A.getFieldLength()[1] = 35; 
    A.getValue()[1]       = "Some name"; 

    A.getFieldName()[2]   = "Last updated"; 
    A.getFieldType()[2]   = ValueMeta.getTypeDesc(ValueMetaInterface.TYPE_DATE);
    A.getFieldFormat()[2] = "yyyy/MM/dd"; 
    A.getValue()[2]       = "2006/11/13"; 

    TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation(null, A, "A");
    transMeta.setName("Row generator test");
    transMeta.setSizeRowset(2500);
    transMeta.setFeedbackSize(50000);
    transMeta.setUsingThreadPriorityManagment(false);

    return new Trans(transMeta);
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:30,代码来源:Carte.java


示例16: generateEmptyRowStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private StepMeta generateEmptyRowStep() {
  RowGeneratorMeta meta = new RowGeneratorMeta();
  meta.allocate(0);
  meta.setRowLimit("1");
  
  StepMeta stepMeta = new StepMeta("dual", meta);
  stepMeta.setLocation(xLocation, 50);
  xLocation+=100;
  stepMeta.setDraw(true);
  return stepMeta;

}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:13,代码来源:SqlTransMeta.java


示例17: getInfo

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
private void getInfo(RowGeneratorMeta meta) throws KettleException
{
    meta.setRowLimit( wLimit.getText() );
    
    int nrfields = wFields.nrNonEmpty();

    meta.allocate(nrfields);

    for (int i=0;i<nrfields;i++)
    {
        TableItem item = wFields.getNonEmpty(i);
        
        meta.getFieldName()[i]   = item.getText(1);

        meta.getFieldFormat()[i] = item.getText(3);
        String slength           = item.getText(4);
        String sprec             = item.getText(5);
        meta.getCurrency()[i]    = item.getText(6);
        meta.getDecimal()[i]     = item.getText(7);
        meta.getGroup()[i]       = item.getText(8);
        meta.isSetEmptyString()[i] = BaseMessages.getString(PKG, "System.Combo.Yes").equalsIgnoreCase(item.getText(10));
			
        meta.getValue()[i]       = meta.isSetEmptyString()[i]?"":item.getText(9);
        meta.getFieldType()[i]   = meta.isSetEmptyString()[i]?"String": item.getText(2);
        meta.getFieldLength()[i]    = Const.toInt( slength, -1);
        meta.getFieldPrecision()[i] = Const.toInt( sprec  , -1);
    }
    
    // Performs checks...
    /*
     * Commented out verification : if variables are used, this check is a pain!
     * 
    long longLimit = Const.toLong(transMeta.environmentSubstitute( wLimit.getText()), -1L );
    if (longLimit<0)
    {
        throw new KettleException( BaseMessages.getString(PKG, "RowGeneratorDialog.Wrong.RowLimit.Number") );
    }
    */
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:40,代码来源:RowGeneratorDialog.java


示例18: buildRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Builds a {@link RowGenerator} Step with a single String field.
 * 
 * @param registry Plugin Registry.
 * @param stepName Name to use for step
 * @return {@link StepMeta} for a Row Generator step. 
 */
private StepMeta buildRowGeneratorStep(PluginRegistry registry, String stepName) {
  RowGeneratorMeta rm = new RowGeneratorMeta();

  // Set the information of the row generator.                
  String rowGeneratorPid = registry.getPluginId(StepPluginType.class, rm);
  StepMeta rowGeneratorStep = new StepMeta(rowGeneratorPid, stepName, rm);

  String fieldName[] = { "string" }; //$NON-NLS-1$
  String type[] = { "String" }; //$NON-NLS-1$
  String value[] = { "string_value" }; //$NON-NLS-1$
  String fieldFormat[] = { "" }; //$NON-NLS-1$
  String group[] = { "" }; //$NON-NLS-1$
  String decimal[] = { "" }; //$NON-NLS-1$
  String currency[]     = { "", };
  int intDummies[] = { -1, -1, -1 };
  boolean    setEmptystring[]  = { false, false, false};

  rm.setDefault();
  rm.setFieldName(fieldName);
  rm.setFieldType(type);
  rm.setValue(value);
  rm.setFieldLength(intDummies);
  rm.setFieldPrecision(intDummies);
  rm.setRowLimit("1"); //$NON-NLS-1$
  rm.setFieldFormat(fieldFormat);
  rm.setGroup(group);
  rm.setDecimal(decimal);
  rm.setCurrency(currency);
  rm.setEmptyString(setEmptystring);

  return rowGeneratorStep;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:40,代码来源:MappingTest.java


示例19: generateTestTransformation

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
public static Trans generateTestTransformation() {
  RowGeneratorMeta A = new RowGeneratorMeta();
  A.allocate( 3 );
  A.setRowLimit( "10000000" );

  A.getFieldName()[0] = "ID";
  A.getFieldType()[0] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_INTEGER );
  A.getFieldLength()[0] = 7;
  A.getValue()[0] = "1234";

  A.getFieldName()[1] = "Name";
  A.getFieldType()[1] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING );
  A.getFieldLength()[1] = 35;
  A.getValue()[1] = "Some name";

  A.getFieldName()[2] = "Last updated";
  A.getFieldType()[2] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_DATE );
  A.getFieldFormat()[2] = "yyyy/MM/dd";
  A.getValue()[2] = "2010/02/09";

  TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation( null, A, "A" );
  transMeta.setName( "CarteUnitTest" );
  transMeta.setSizeRowset( 2500 );
  transMeta.setFeedbackSize( 50000 );
  transMeta.setUsingThreadPriorityManagment( false );

  return new Trans( transMeta );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:CarteIT.java


示例20: buildRowGeneratorStep

import org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta; //导入依赖的package包/类
/**
 * Builds a {@link org.pentaho.di.trans.steps.rowgenerator.RowGenerator} Step 
 * with a single String field.
 *
 * @param registry
 *          Plugin Registry.
 * @param stepName
 *          Name to use for step
 * @return {@link StepMeta} for a Row Generator step.
 */
private StepMeta buildRowGeneratorStep( PluginRegistry registry, String stepName ) {
  RowGeneratorMeta rm = new RowGeneratorMeta();

  // Set the information of the row generator.
  String rowGeneratorPid = registry.getPluginId( StepPluginType.class, rm );
  StepMeta rowGeneratorStep = new StepMeta( rowGeneratorPid, stepName, rm );

  String[] fieldName = { "string" };
  String[] type = { "String" };
  String[] value = { "string_value" };
  String[] fieldFormat = { "" };
  String[] group = { "" };
  String[] decimal = { "" };
  String[] currency = { "", };
  int[] intDummies = { -1, -1, -1 };
  boolean[] setEmptystring = { false, false, false };

  rm.setDefault();
  rm.setFieldName( fieldName );
  rm.setFieldType( type );
  rm.setValue( value );
  rm.setFieldLength( intDummies );
  rm.setFieldPrecision( intDummies );
  rm.setRowLimit( "1" );
  rm.setFieldFormat( fieldFormat );
  rm.setGroup( group );
  rm.setDecimal( decimal );
  rm.setCurrency( currency );
  rm.setEmptyString( setEmptystring );

  return rowGeneratorStep;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:43,代码来源:MappingIT.java



注:本文中的org.pentaho.di.trans.steps.rowgenerator.RowGeneratorMeta类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Type类代码示例发布时间:2022-05-22
下一篇:
Java Document类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap