當前位置: 首頁>>代碼示例>>Java>>正文


Java RowMetaInterface.setValueMeta方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.setValueMeta方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.setValueMeta方法的具體用法?Java RowMetaInterface.setValueMeta怎麽用?Java RowMetaInterface.setValueMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.row.RowMetaInterface的用法示例。


在下文中一共展示了RowMetaInterface.setValueMeta方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( !Const.isEmpty( this.valueFieldName ) ) {

    // Add value field meta if not found, else set it
    ValueMetaInterface v;
    try {
      v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
    } catch ( KettlePluginException e ) {
      throw new KettleStepException( BaseMessages.getString( PKG,
          "HazelcastInputMeta.Exception.ValueTypeNameNotFound" ), e );
    }
    v.setOrigin( origin );
    int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
    if ( valueFieldIndex < 0 ) {
      inputRowMeta.addValueMeta( v );
    } else {
      inputRowMeta.setValueMeta( valueFieldIndex, v );
    }
  } else {
    throw new KettleStepException( BaseMessages
        .getString( PKG, "HazelcastInputMeta.Exception.ValueFieldNameNotFound" ) );
  }
}
 
開發者ID:mattyb149,項目名稱:pdi-hazelcast-plugin,代碼行數:25,代碼來源:HazelcastInputMeta.java

示例2: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( !Const.isEmpty( this.valueFieldName ) ) {

    // Add value field meta if not found, else set it
    ValueMetaInterface v;
    try {
      v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
    } catch ( KettlePluginException e ) {
      throw new KettleStepException( BaseMessages.getString( PKG,
          "MemcachedInputMeta.Exception.ValueTypeNameNotFound" ), e );
    }
    v.setOrigin( origin );
    int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
    if ( valueFieldIndex < 0 ) {
      inputRowMeta.addValueMeta( v );
    } else {
      inputRowMeta.setValueMeta( valueFieldIndex, v );
    }
  } else {
    throw new KettleStepException( BaseMessages
        .getString( PKG, "MemcachedInputMeta.Exception.ValueFieldNameNotFound" ) );
  }
}
 
開發者ID:mattyb149,項目名稱:pdi-memcached-plugin,代碼行數:25,代碼來源:MemcachedInputMeta.java

示例3: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface info[], StepMeta nextStep,
            VariableSpace space) throws KettleStepException
  {
	for(int i=0;i<fieldOutStream.length;i++) {
		ValueMetaInterface valueMeta = new ValueMeta(space.environmentSubstitute(fieldOutStream[i]), ValueMeta.TYPE_STRING);
		valueMeta.setLength(100, -1);
		valueMeta.setOrigin(name);
		
		if (!Const.isEmpty(fieldOutStream[i])){
			inputRowMeta.addValueMeta(valueMeta);
		} else {
			int index = inputRowMeta.indexOfValue(fieldInStream[i]);
			if (index>=0) {
				valueMeta.setName(fieldInStream[i]);
				inputRowMeta.setValueMeta(index, valueMeta);
			}
		}
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:20,代碼來源:ReplaceStringMeta.java

示例4: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    String outputField = space.environmentSubstitute(getOutputIDFieldName());
    ValueMetaInterface outputInterface = null;
    try {
        outputInterface = ValueMetaFactory.createValueMeta(outputField, ValueMetaInterface.TYPE_STRING);
    } catch (KettlePluginException e) {
        throw new KettleStepException(e);
    }
    boolean fieldFound = false;
    for (int i = 0; i < inputRowMeta.size(); i++) {
        ValueMetaInterface valueMetaInterface = inputRowMeta.getValueMeta(i);
        String interfaceName = valueMetaInterface.getName();
        if (outputField.equals(interfaceName)) {
            fieldFound = true;
            inputRowMeta.setValueMeta(i, outputInterface);
            break;
        }
    }
    if (!fieldFound) {
        inputRowMeta.addValueMeta(outputInterface);
    }
}
 
開發者ID:brosander,項目名稱:kettle-plugins,代碼行數:24,代碼來源:FTLMeta.java

示例5: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
    // Remove the field to split
    int idx = r.indexOfValue(splitField);
    if (idx<0) //not found
    {
        throw new RuntimeException(Messages.getString("FieldSplitter.Log.CouldNotFindFieldToSplit",splitField)); //$NON-NLS-1$ //$NON-NLS-2$
    }

    // Add the new fields at the place of the index --> replace!
    for (int i = 0; i < fieldName.length; i++)
    {
        final ValueMetaInterface v = new ValueMeta(fieldName[i], fieldType[i]);
        v.setLength(fieldLength[i], fieldPrecision[i]);
        v.setOrigin(name);
        v.setConversionMask(fieldFormat[i]);
        v.setDecimalSymbol(fieldDecimal[i]);
        v.setGroupingSymbol(fieldGroup[i]);
        v.setCurrencySymbol(fieldCurrency[i]);
        v.setTrimType(fieldTrimType[i]);
        // TODO when implemented in UI
        // v.setDateFormatLenient(dateFormatLenient);
        // TODO when implemented in UI
        // v.setDateFormatLocale(dateFormatLocale);
        if(i==0 && idx>=0)
        {
            //the first valueMeta (splitField) will be replaced
            r.setValueMeta(idx, v);
        }
        else
        {
            //other valueMeta will be added
            if (idx>=r.size()) r.addValueMeta(v);
            r.addValueMeta(idx+i, v);
        }
    }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:38,代碼來源:FieldSplitterMeta.java

示例6: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
    // Remove the field to split
    int idx = r.indexOfValue(splitField);
    if (idx<0) //not found
    {
        throw new RuntimeException(BaseMessages.getString(PKG, "FieldSplitter.Log.CouldNotFindFieldToSplit",splitField)); //$NON-NLS-1$ //$NON-NLS-2$
    }

    // Add the new fields at the place of the index --> replace!
    for (int i = 0; i < fieldName.length; i++)
    {
        final ValueMetaInterface v = new ValueMeta(fieldName[i], fieldType[i]);
        v.setLength(fieldLength[i], fieldPrecision[i]);
        v.setOrigin(name);
        v.setConversionMask(fieldFormat[i]);
        v.setDecimalSymbol(fieldDecimal[i]);
        v.setGroupingSymbol(fieldGroup[i]);
        v.setCurrencySymbol(fieldCurrency[i]);
        v.setTrimType(fieldTrimType[i]);
        // TODO when implemented in UI
        // v.setDateFormatLenient(dateFormatLenient);
        // TODO when implemented in UI
        // v.setDateFormatLocale(dateFormatLocale);
        if(i==0 && idx>=0)
        {
            //the first valueMeta (splitField) will be replaced
            r.setValueMeta(idx, v);
        }
        else
        {
            //other valueMeta will be added
            if (idx>=r.size()) r.addValueMeta(v);
            r.addValueMeta(idx+i, v);
        }
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:38,代碼來源:FieldSplitterMeta.java


注:本文中的org.pentaho.di.core.row.RowMetaInterface.setValueMeta方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。