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


Java ValueMetaInterface.setOrigin方法代码示例

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


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

示例1: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * This method is called to determine the changes the step is making to the row-stream.
 * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
 * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
 * row-stream.
 * 
 * @param inputRowMeta		the row structure coming in to the step
 * @param name 				the name of the step making the changes
 * @param info				row structures of any info steps coming in
 * @param nextStep			the description of a step this step is passing rows to
 * @param space				the variable space for resolving variables
 * @param repository		the repository instance optionally read from
 * @param metaStore			the metaStore to optionally read from
 */
 @Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{

   for ( int i = 0; i < fields.length; i++ ) {
     int type = fields[i].getType();
     if ( type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;

     try {
       ValueMetaInterface v = ValueMetaFactory.createValueMeta( fields[i].getName(), type );
       v.setConversionMask( fields[i].getFormat() );
       v.setLength( fields[i].getLength() );
       v.setPrecision( fields[i].getPrecision() );
       v.setCurrencySymbol( fields[i].getCurrencySymbol() );
       v.setDecimalSymbol( fields[i].getDecimalSymbol() );
       v.setGroupingSymbol( fields[i].getGroupSymbol() );
       v.setTrimType( fields[i].getTrimType() );

       v.setOrigin( name );

       inputRowMeta.addValueMeta( v );
     } catch (KettlePluginException e) {
       throw new KettleStepException( e );
     }
   }
}
 
开发者ID:andtorg,项目名称:sdmx-kettle,代码行数:40,代码来源:SdmxStepMeta.java

示例2: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
  
  // Optionally add a fields...
  //
  if (StringUtils.isNotEmpty(responseCodeField)) {
    ValueMetaInterface codeValue = new ValueMetaInteger(responseCodeField);
    codeValue.setLength(3);
    codeValue.setOrigin(name);
    inputRowMeta.addValueMeta(codeValue);
  }
  
  if (StringUtils.isNotEmpty(responseTimeField)) {
    ValueMetaInterface timeValue = new ValueMetaInteger(responseTimeField);
    timeValue.setLength(7);
    timeValue.setOrigin(name);
    inputRowMeta.addValueMeta(timeValue);
  }
}
 
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:21,代码来源:HCPDeleteMeta.java

示例3: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@SuppressWarnings( "deprecation" )
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
      VariableSpace space ) throws KettleStepException {
   try {
	if ( m_fields == null || m_fields.size() == 0 ){
	   // TODO: get the name "json" from dialog
		
	   ValueMetaInterface jsonValueMeta = ValueMetaFactory.createValueMeta("JSON", ValueMetaInterface.TYPE_STRING);
	   jsonValueMeta.setOrigin( origin );
	   rowMeta.addValueMeta( jsonValueMeta );
	}else{
	   // get the selected fields
	   for ( SequoiaDBInputField f : m_fields ){
	      ValueMetaInterface vm = ValueMetaFactory.createValueMeta(f.m_fieldName, ValueMetaFactory.getIdForValueMeta( f.m_kettleType ));
	      vm.setOrigin( origin );
	      rowMeta.addValueMeta( vm );
	   }
	}
} catch (KettlePluginException e) {
	throw new KettleStepException(e);
}
}
 
开发者ID:SequoiaDB,项目名称:pentaho-sequoiadb-plugin,代码行数:24,代码来源:SequoiaDBInputMeta.java

示例4: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@Override
public void getFields(RowMetaInterface row, String name,
    RowMetaInterface[] info, StepMeta nextStep, VariableSpace space,
    Repository repository, IMetaStore metaStore)
    throws KettleStepException {

  // Check Target Field Name
  if (Const.isEmpty(targetFieldName)) {
    throw new KettleStepException(BaseMessages.getString(PKG,
        "ConcatFieldsMeta.CheckResult.TargetFieldNameMissing"));
  }
  // add targetFieldName
  ValueMetaInterface vValue = new ValueMetaDom(targetFieldName,
      ValueMetaDom.TYPE_DOM, targetFieldLength, 0);
  vValue.setOrigin(name);

  row.addValueMeta(vValue);
}
 
开发者ID:griddynamics,项目名称:xml-dom-kettle-etl-plugin,代码行数:19,代码来源:DOMConcatFieldsMeta.java

示例5: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException 
   {
	
	RowMetaInterface add=null;
	
	try
	{
		initData(space);
		
		add = data.outputRowMeta;
	}
	catch(Exception dbe)
	{
		throw new KettleStepException("Unable to get query result for MDX query: "+Const.CR+mdx, dbe);
	}

	// Set the origin
	//
	for (int i=0;i<add.size();i++)
	{
		ValueMetaInterface v=add.getValueMeta(i);
		v.setOrigin(origin);
	}
	
	row.addRowMeta( add );
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:OlapInputMeta.java

示例6: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的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:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:ReplaceStringMeta.java

示例7: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface info[], StepMeta nextStep, VariableSpace space) throws KettleStepException
{ 

	// Add new field?
	for(int i=0;i<fieldOutStream.length;i++) {
		if (!Const.isEmpty(fieldOutStream[i])){
			int index=inputRowMeta.indexOfValue(fieldInStream[i]);
			if(index>=0)
			{
				ValueMetaInterface in=inputRowMeta.getValueMeta(index);
				ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(fieldOutStream[i]), in.getType());
				v.setName(space.environmentSubstitute(fieldOutStream[i]));
				v.setLength(in.getLength());
	            v.setPrecision(in.getPrecision());
	            v.setConversionMask(in.getConversionMask());
				v.setOrigin(name);
				inputRowMeta.addValueMeta(v);
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:GetPreviousRowFieldMeta.java

示例8: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
       // change the case insensitive flag too
       for (int i=0;i<compareFields.length;i++)
       {
           int idx = row.indexOfValue(compareFields[i]);
           if (idx>=0)
           {
               row.getValueMeta(idx).setCaseInsensitive(caseInsensitive[i]);
           }
       }
	if (countRows)
	{
		ValueMetaInterface v = new ValueMeta(countField, ValueMetaInterface.TYPE_INTEGER);
		v.setLength(ValueMetaInterface.DEFAULT_INTEGER_LENGTH, 0);
		v.setOrigin(name);
		row.addValueMeta(v);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:UniqueRowsMeta.java

示例9: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
	List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
	RowMetaAndData rowMetaAndData = RowGenerator.buildRow(this, remarks, origin);
	if (!remarks.isEmpty()) {
		StringBuffer stringRemarks = new StringBuffer();
		for (CheckResultInterface remark : remarks) {
			stringRemarks.append(remark.toString()).append(Const.CR);
		}
		throw new KettleStepException(stringRemarks.toString());
	}
	
	for (ValueMetaInterface valueMeta : rowMetaAndData.getRowMeta().getValueMetaList()) {
		valueMeta.setOrigin(origin);
	}
	
	row.mergeRowMeta(rowMetaAndData.getRowMeta());
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:RowGeneratorMeta.java

示例10: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@Override
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException 
{
    // Input rows and output rows are different in the webservice step
	//
    if (!isPassingInputData()) 
    {
    	r.clear();
    }

    // Add the output fields...
    //
    for (WebServiceField field : getFieldsOut())
    {
        ValueMetaInterface vValue = new ValueMeta(field.getName(), field.getType());
        
        // If the type is unrecognized we give back the XML as a String...
        //
        if (field.getType()==ValueMetaInterface.TYPE_NONE) {
        	vValue.setType(ValueMetaInterface.TYPE_STRING);
        }
        vValue.setOrigin(name);
        r.addValueMeta(vValue);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:26,代码来源:WebServiceMeta.java

示例11: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info,
    StepMeta nextStep, VariableSpace space) throws KettleStepException {
    for (int i = 0; i < odpsFields.size(); i++) {
        ValueMetaInterface v = new ValueMeta(odpsFields.get(i).getName().toLowerCase(),
            ValueMetaInterface.TYPE_STRING);
        v.setOrigin(name);
        inputRowMeta.addValueMeta(v);
    }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:11,代码来源:OdpsInputMeta.java

示例12: addField

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
* 添加字段 <br/>
* @author jingma
* @param r 行
* @param name 字段名称
* @param type 类型
* @param trimType 去除空白规则
* @param origin 宿主
* @param comments 描述
* @param length 长度
*/
@SuppressWarnings("deprecation")
protected void addField(RowMetaInterface r, String name, int type,
        int trimType, String origin, String comments, int length) {
    ValueMetaInterface v = new ValueMeta();
    v.setName(name.toUpperCase());
    v.setType(type);
    v.setTrimType(trimType);
    v.setOrigin(origin);
    v.setComments(comments);
    if(length>0){
        v.setLength(length);
    }
    r.addValueMeta(v);
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:26,代码来源:EasyExpandRunBase.java

示例13: addFieldToRow

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
protected void addFieldToRow( RowMetaInterface row, String fieldName, int type ) throws KettleStepException {
  if ( !Const.isEmpty( fieldName ) ) {
    try {
      ValueMetaInterface value = ValueMetaFactory.createValueMeta( fieldName, type );
      value.setOrigin( getName() );
      row.addValueMeta( value );
    } catch ( KettlePluginException e ) {
      throw new KettleStepException( BaseMessages.getString( PKG,
        "TransExecutorMeta.ValueMetaInterfaceCreation", fieldName ), e );
    }
  }
}
 
开发者ID:matthewtckr,项目名称:pdi-zendesk-plugin,代码行数:13,代码来源:ZendeskInputMeta.java

示例14: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields(RowMetaInterface inputRowMeta, String name,
    RowMetaInterface[] info, StepMeta nextStep, VariableSpace space,
    Repository repository, IMetaStore metaStore) throws KettleStepException {
  // Output field (String)
  ValueMetaInterface v = new ValueMetaDom(
      space.environmentSubstitute(getResultfieldname()),
      ValueMetaDom.TYPE_DOM);
  v.setOrigin(name);
  inputRowMeta.addValueMeta(v);
}
 
开发者ID:griddynamics,项目名称:xml-dom-kettle-etl-plugin,代码行数:11,代码来源:DOMXsltMeta.java

示例15: getFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {

  ValueMetaInterface v = new ValueMetaDom( this.getValueName(), ValueMetaDom.TYPE_DOM );
  v.setOrigin( name );
  row.addValueMeta( v );
}
 
开发者ID:griddynamics,项目名称:xml-dom-kettle-etl-plugin,代码行数:8,代码来源:AddDOMXMLMeta.java


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