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


Java RowMetaInterface.mergeRowMeta方法代碼示例

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


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

示例1: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
   public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {   	
   	if (info!=null && isPassingThruFields() && isFileNameInField){
           boolean found=false;
           for (int i=0;i<info.length && !found;i++){
               if (info[i]!=null){
                   row.mergeRowMeta(info[i]);
                   found=true;
               }
           }
       }
   	if (!isFileNameInField()){
       	FileInputList fileList = getFileList(space);
           if (fileList.nrOfFiles()==0)           
               throw new KettleStepException(Messages.getString("KMLFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$ 
           
           row.clear();
           row.addRowMeta( getOutputFields(fileList, name));
       }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:21,代碼來源:KMLFileInputMeta.java

示例2: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
    // We don't have any input fields here in "r" as they are all info fields.
    // So we just merge in the info fields.
    //
    if (info!=null)
    {
        boolean found=false;
        for (int i=0;i<info.length && !found;i++) 
        {
            if (info[i]!=null)
            {
                r.mergeRowMeta(info[i]);
                found=true;
            }
        }
    }
    
    if (Const.isEmpty(flagField)) throw new KettleStepException(Messages.getString("MergeRowsMeta.Exception.FlagFieldNotSpecified"));
    ValueMetaInterface flagFieldValue = new ValueMeta(flagField, ValueMetaInterface.TYPE_STRING);
    flagFieldValue.setOrigin(name);
    r.addValueMeta(flagFieldValue);

}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:25,代碼來源:MergeRowsMeta.java

示例3: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException{                     
  	if (info!=null){
          for (int i=0;i<info.length;i++){
              if (info[i]!=null){              	
              	r.mergeRowMeta(info[i]);    
              }                            
          }
      }
  	
  	// Output field (Geometry)
if (!Const.isEmpty(resultfieldName)) {
	ValueMetaInterface v = new ValueMeta(space.environmentSubstitute(resultfieldName),
				ValueMeta.TYPE_GEOMETRY);			
	v.setOrigin(name);
	r.addValueMeta(v);
}
  }
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:18,代碼來源:SpatialAnalysisMeta.java

示例4: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
    // We don't have any input fields here in "r" as they are all info fields.
    // So we just merge in the info fields.
    //
    if (info!=null)
    {
        for (int i=0;i<info.length;i++) 
        {
            if (info[i]!=null)
            {
                r.mergeRowMeta(info[i]);
            }
        }
    }
		
    for (int i=0;i<r.size();i++) r.getValueMeta(i).setOrigin(name);
    return;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:20,代碼來源:MergeJoinMeta.java

示例5: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
   public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {   	             
   	if (info!=null && isPassingThruFields() && isFileNameInField){
           boolean found=false;
           for (int i=0;i<info.length && !found;i++){
               if (info[i]!=null){
                   row.mergeRowMeta(info[i]);
                   found=true;
               }
           }
       }
   	if (!isFileNameInField()){
       	FileInputList fileList = getFileList(space);
           if (fileList.nrOfFiles()==0)           
               throw new KettleStepException(Messages.getString("GISFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$ 
           
           row.clear();
           row.addRowMeta( getOutputFields(fileList, name));
       }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:21,代碼來源:GISFileInputMeta.java

示例6: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的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

示例7: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
   public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {   	
   	if (info!=null && isPassingThruFields() && isFileNameInField){
           boolean found=false;
           for (int i=0;i<info.length && !found;i++){
               if (info[i]!=null){
                   row.mergeRowMeta(info[i]);
                   found=true;
               }
           }
       }
   	if (!isFileNameInField()){
       	FileInputList fileList = getFileList(space);
           if (fileList.nrOfFiles()==0)           
               throw new KettleStepException(Messages.getString("GMLFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$ 
           
           row.clear();
           row.addRowMeta( getOutputFields(fileList, name));
       }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:21,代碼來源:GMLFileInputMeta.java

示例8: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException {
	if (info!=null && isPassingThruFields() && (isSourceInField || isLayerNameInField)){
           boolean found=false;
           for (int i=0;i<info.length && !found;i++){
               if (info[i]!=null){
                   row.mergeRowMeta(info[i]);
                   found=true;
               }
           }
       }
   	if (!isSourceInField() && !isLayerNameInField()){
   		FileInputList fileList = null;
   		List<String> cnxStrings = null;
   		if(isFileSource){
   			fileList = getFileList(space);
               if (fileList.nrOfFiles()==0)           
                   throw new KettleStepException(Messages.getString("OGRFileInputMeta.Exception.NoFilesFoundToProcess")); //$NON-NLS-1$ 
   		}else
   			cnxStrings = Arrays.asList(source);
   		
   		List<String> layernames = Arrays.asList(layerName);
           row.clear();
           row.addRowMeta( getOutputFields(fileList, cnxStrings,  layernames, name));
       }  
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:27,代碼來源:OGRFileInputMeta.java

示例9: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
    // We don't have any input fields here in "r" as they are all info fields.
    // So we just merge in the info fields.
    //
    if (info!=null)
    {
        boolean found=false;
        for (int i=0;i<info.length && !found;i++) 
        {
            if (info[i]!=null)
            {
                r.mergeRowMeta(info[i]);
                found=true;
            }
        }
    }
    
    if (Const.isEmpty(flagField)) throw new KettleStepException(BaseMessages.getString(PKG, "MergeRowsMeta.Exception.FlagFieldNotSpecified"));
    ValueMetaInterface flagFieldValue = new ValueMeta(flagField, ValueMetaInterface.TYPE_STRING);
    flagFieldValue.setOrigin(name);
    r.addValueMeta(flagFieldValue);

}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:25,代碼來源:MergeRowsMeta.java

示例10: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
                       VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  // determine the maximum length
  int length = -1;
  for ( int i = 0; i < fieldName.length; i++ ) {
    if ( variableName[ i ] != null ) {
      String string = space.environmentSubstitute( variableName[ i ] );
      if ( string.length() > length ) {
        length = string.length();
      }
    }
  }

  RowMetaInterface row = new RowMeta();
  for ( int i = 0; i < fieldName.length; i++ ) {
    ValueMetaInterface valueMeta = new ValueMeta( fieldName[ i ], fieldType[ i ] );
    if ( fieldLength[ i ] < 0 ) {
      valueMeta.setLength( length );
    } else {
      valueMeta.setLength( fieldLength[ i ] );
    }
    if ( fieldPrecision[ i ] >= 0 ) {
      valueMeta.setPrecision( fieldPrecision[ i ] );
    }
    valueMeta.setConversionMask( fieldFormat[ i ] );
    valueMeta.setGroupingSymbol( group[ i ] );
    valueMeta.setDecimalSymbol( decimal[ i ] );
    valueMeta.setCurrencySymbol( currency[ i ] );
    valueMeta.setTrimType( trimType[ i ] );
    valueMeta.setOrigin( name );
    row.addValueMeta( valueMeta );
  }
  inputRowMeta.mergeRowMeta( row );
}
 
開發者ID:pentaho,項目名稱:pdi-platform-utils-plugin,代碼行數:35,代碼來源:GetSessionVariableMeta.java

示例11: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
	RowMetaAndData add = ExecSQL.getResultRow(new Result(), getUpdateField(), getInsertField(), getDeleteField(),
			getReadField());
	
	r.mergeRowMeta(add.getRowMeta());
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:8,代碼來源:ExecSQLRowMeta.java

示例12: createOutputRowMeta

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
private RowMetaInterface createOutputRowMeta(RowMetaInterface[] fileRowMeta)
{
    RowMetaInterface outputRowMeta = new RowMeta();
    for (int i=0;i<data.fileRowMeta.length;i++)
    {
        outputRowMeta.mergeRowMeta(data.fileRowMeta[i]);
    }
    return outputRowMeta;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:10,代碼來源:JoinRows.java

示例13: getStepFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public RowMetaInterface getStepFields(StepMeta[] stepMeta) throws KettleStepException
{
    RowMetaInterface fields = new RowMeta();

    for (int i = 0; i < stepMeta.length; i++)
    {
        RowMetaInterface flds = getStepFields(stepMeta[i]);
        if (flds != null) fields.mergeRowMeta(flds);
    }
    return fields;
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:12,代碼來源:TransMeta.java

示例14: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
	throws KettleStepException
{
	GZIPInputStream fis = null;
	DataInputStream dis = null;
	try
	{
		InputStream is = KettleVFS.getInputStream(space.environmentSubstitute(filename), space);
		fis = new GZIPInputStream(is);
		dis = new DataInputStream(fis);

		RowMetaInterface add = new RowMeta(dis);		
		for (int i=0;i<add.size();i++)
		{
			add.getValueMeta(i).setOrigin(name);
		}
		r.mergeRowMeta(add);
	}
	catch(KettleFileException kfe)
	{
		throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.UnableToReadMetaData"), kfe); //$NON-NLS-1$
	}
	catch(IOException e)
	{
		throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.ErrorOpeningOrReadingCubeFile"), e); //$NON-NLS-1$
	}
	finally
	{
		try
		{
			if (fis!=null) fis.close();
			if (dis!=null) dis.close();
		}
		catch(IOException ioe)
		{
			throw new KettleStepException(BaseMessages.getString(PKG, "CubeInputMeta.Exception.UnableToCloseCubeFile"), ioe); //$NON-NLS-1$
		}
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:40,代碼來源:CubeInputMeta.java

示例15: getFields

import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface info[], StepMeta nextStep, VariableSpace space) throws KettleStepException
{
    // We don't have any input fields here in "r" as they are all info fields.
    // So we just take the info fields.
    //
    if (info!=null)
    {
    	if ( info.length > 0 && info[0]!=null) {            
            r.mergeRowMeta(info[0]);
    	}
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:13,代碼來源:AppendMeta.java


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