当前位置: 首页>>代码示例>>Java>>正文


Java TextFileInputField.getType方法代码示例

本文整理汇总了Java中org.pentaho.di.trans.steps.textfileinput.TextFileInputField.getType方法的典型用法代码示例。如果您正苦于以下问题:Java TextFileInputField.getType方法的具体用法?Java TextFileInputField.getType怎么用?Java TextFileInputField.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.trans.steps.textfileinput.TextFileInputField的用法示例。


在下文中一共展示了TextFileInputField.getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFields

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入方法依赖的package包/类
public void getFields(RowMetaInterface rowMeta, String origin, RowMetaInterface[] info,
    StepMeta nextStep, VariableSpace space) throws KettleStepException {
  rowMeta.clear(); // Start with a clean slate, eats the input

  for (int i = 0; i < inputFields.length; i++) {
    TextFileInputField field = inputFields[i];

    ValueMetaInterface valueMeta = new ValueMeta(field.getName(), field.getType());
    valueMeta.setConversionMask(field.getFormat());
    valueMeta.setLength(field.getLength());
    valueMeta.setPrecision(field.getPrecision());
    valueMeta.setConversionMask(field.getFormat());
    valueMeta.setDecimalSymbol(field.getDecimalSymbol());
    valueMeta.setGroupingSymbol(field.getGroupSymbol());
    valueMeta.setCurrencySymbol(field.getCurrencySymbol());
    valueMeta.setTrimType(field.getTrimType());
    if (lazyConversionActive) {
      valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
    }
    valueMeta.setStringEncoding(space.environmentSubstitute(encoding));

    // In case we want to convert Strings...
    // Using a copy of the valueMeta object means that the inner and outer representation
    // format is the same.
    // Preview will show the data the same way as we read it.
    // This layout is then taken further down the road by the metadata through the transformation.
    //
    ValueMetaInterface storageMetadata = valueMeta.clone();
    storageMetadata.setType(ValueMetaInterface.TYPE_STRING);
    storageMetadata.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
    storageMetadata
        .setLength(-1, -1); // we don't really know the lengths of the strings read in advance.
    valueMeta.setStorageMetadata(storageMetadata);

    valueMeta.setOrigin(origin);

    rowMeta.addValueMeta(valueMeta);
  }

  if (!Const.isEmpty(filenameField) && includingFilename) {
    ValueMetaInterface filenameMeta =
        new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING);
    filenameMeta.setOrigin(origin);
    if (lazyConversionActive) {
      filenameMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
      filenameMeta
          .setStorageMetadata(new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING));
    }
    rowMeta.addValueMeta(filenameMeta);
  }

  if (!Const.isEmpty(rowNumField)) {
    ValueMetaInterface rowNumMeta = new ValueMeta(rowNumField, ValueMetaInterface.TYPE_INTEGER);
    rowNumMeta.setLength(10);
    rowNumMeta.setOrigin(origin);
    rowMeta.addValueMeta(rowNumMeta);
  }

}
 
开发者ID:carbondata,项目名称:carbondata,代码行数:60,代码来源:CsvInputMeta.java

示例2: getFields

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入方法依赖的package包/类
public void getFields(RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
	rowMeta.clear(); // Start with a clean slate, eats the input
	
	for (int i=0;i<inputFields.length;i++) {
		TextFileInputField field = inputFields[i];
		
		ValueMetaInterface valueMeta = new ValueMeta(field.getName(), field.getType());
		valueMeta.setConversionMask( field.getFormat() );
		valueMeta.setLength( field.getLength() );
		valueMeta.setPrecision( field.getPrecision() );
		valueMeta.setConversionMask( field.getFormat() );
		valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
		valueMeta.setGroupingSymbol( field.getGroupSymbol() );
		valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
		valueMeta.setTrimType( field.getTrimType() );
		if (lazyConversionActive) valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
		valueMeta.setStringEncoding(space.environmentSubstitute(encoding));
		
		// In case we want to convert Strings...
		// Using a copy of the valueMeta object means that the inner and outer representation format is the same.
		// Preview will show the data the same way as we read it.
		// This layout is then taken further down the road by the metadata through the transformation.
		//
		ValueMetaInterface storageMetadata = valueMeta.clone();
		storageMetadata.setType(ValueMetaInterface.TYPE_STRING);
		storageMetadata.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
		storageMetadata.setLength(-1,-1); // we don't really know the lengths of the strings read in advance.
		valueMeta.setStorageMetadata(storageMetadata);
		
		valueMeta.setOrigin(origin);
		
		rowMeta.addValueMeta(valueMeta);
	}
	
	if (!Const.isEmpty(filenameField) && includingFilename) {
		ValueMetaInterface filenameMeta = new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING);
		filenameMeta.setOrigin(origin);
		if (lazyConversionActive) {
			filenameMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
			filenameMeta.setStorageMetadata(new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING));
		}
		rowMeta.addValueMeta(filenameMeta);
	}
	
	if (!Const.isEmpty(rowNumField)) {
		ValueMetaInterface rowNumMeta = new ValueMeta(rowNumField, ValueMetaInterface.TYPE_INTEGER);
		rowNumMeta.setLength(10);
		rowNumMeta.setOrigin(origin);
		rowMeta.addValueMeta(rowNumMeta);
	}
	
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:54,代码来源:ParGzipCsvInputMeta.java

示例3: getFields

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入方法依赖的package包/类
public void getFields(RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
  try {
	rowMeta.clear(); // Start with a clean slate, eats the input
	
	for (int i=0;i<inputFields.length;i++) {
		TextFileInputField field = inputFields[i];
		
		ValueMetaInterface valueMeta = new ValueMeta(field.getName(), field.getType());
		valueMeta.setConversionMask( field.getFormat() );
		valueMeta.setLength( field.getLength() );
		valueMeta.setPrecision( field.getPrecision() );
		valueMeta.setConversionMask( field.getFormat() );
		valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
		valueMeta.setGroupingSymbol( field.getGroupSymbol() );
		valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
		valueMeta.setTrimType( field.getTrimType() );
		if (lazyConversionActive) valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
		valueMeta.setStringEncoding(space.environmentSubstitute(encoding));
		
		// In case we want to convert Strings...
		// Using a copy of the valueMeta object means that the inner and outer representation format is the same.
		// Preview will show the data the same way as we read it.
		// This layout is then taken further down the road by the metadata through the transformation.
		//
		ValueMetaInterface storageMetadata = ValueMetaFactory.cloneValueMeta(valueMeta, ValueMetaInterface.TYPE_STRING);
		storageMetadata.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
		storageMetadata.setLength(-1,-1); // we don't really know the lengths of the strings read in advance.
		valueMeta.setStorageMetadata(storageMetadata);
		
		valueMeta.setOrigin(origin);
		
		rowMeta.addValueMeta(valueMeta);
	}
	
	if (!Const.isEmpty(filenameField) && includingFilename) {
		ValueMetaInterface filenameMeta = new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING);
		filenameMeta.setOrigin(origin);
		if (lazyConversionActive) {
			filenameMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
			filenameMeta.setStorageMetadata(new ValueMeta(filenameField, ValueMetaInterface.TYPE_STRING));
		}
		rowMeta.addValueMeta(filenameMeta);
	}
	
	if (!Const.isEmpty(rowNumField)) {
		ValueMetaInterface rowNumMeta = new ValueMeta(rowNumField, ValueMetaInterface.TYPE_INTEGER);
		rowNumMeta.setLength(10);
		rowNumMeta.setOrigin(origin);
		rowMeta.addValueMeta(rowNumMeta);
	}
  } catch(Exception e) {
    throw new KettleStepException(e);
  }
	
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:57,代码来源:ParGzipCsvInputMeta.java

示例4: getFields

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入方法依赖的package包/类
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  rowMeta.clear(); // Start with a clean slate, eats the input

  for ( int i = 0; i < inputFields.length; i++ ) {
    TextFileInputField field = inputFields[i];

    ValueMetaInterface valueMeta = new ValueMeta( field.getName(), field.getType() );
    valueMeta.setConversionMask( field.getFormat() );
    valueMeta.setLength( field.getLength() );
    valueMeta.setPrecision( field.getPrecision() );
    valueMeta.setConversionMask( field.getFormat() );
    valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
    valueMeta.setGroupingSymbol( field.getGroupSymbol() );
    valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
    valueMeta.setTrimType( field.getTrimType() );
    if ( lazyConversionActive ) {
      valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
    }

    // In case we want to convert Strings...
    // Using a copy of the valueMeta object means that the inner and outer representation format is the same.
    // Preview will show the data the same way as we read it.
    // This layout is then taken further down the road by the metadata through the transformation.
    //
    ValueMetaInterface storageMetadata = valueMeta.clone();
    storageMetadata.setType( ValueMetaInterface.TYPE_STRING );
    storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
    storageMetadata.setLength( -1, -1 ); // we don't really know the lengths of the strings read in advance.
    valueMeta.setStorageMetadata( storageMetadata );

    valueMeta.setOrigin( origin );

    rowMeta.addValueMeta( valueMeta );
  }

  if ( !Utils.isEmpty( filenameField ) && includingFilename ) {
    ValueMetaInterface filenameMeta = new ValueMetaString( filenameField );
    filenameMeta.setOrigin( origin );
    if ( lazyConversionActive ) {
      filenameMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
      filenameMeta.setStorageMetadata( new ValueMetaString( filenameField ) );
    }
    rowMeta.addValueMeta( filenameMeta );
  }

  if ( !Utils.isEmpty( rowNumField ) ) {
    ValueMetaInterface rowNumMeta = new ValueMetaInteger( rowNumField );
    rowNumMeta.setLength( 10 );
    rowNumMeta.setOrigin( origin );
    rowMeta.addValueMeta( rowNumMeta );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:55,代码来源:S3CsvInputMeta.java


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