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


Java ValueMeta類代碼示例

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


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

示例1: getFields

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) {
    
    JSONArray transInfo = configInfo.getJSONArray(TRANS_INFO);
    for(JSONObject ti:transInfo.toArray(new JSONObject[]{})){
        //將轉換結果賦予新字段的,添加新字段
        if(ti.containsKey(RESULT_LATER)&&StringUtils.isNotBlank(ti.getString(RESULT_LATER))){
            addField(r,ti.getString(TRANS_FIELD)+ti.getString(RESULT_LATER),
                    ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD)+"名稱");
        }
        if(RULE_TOJSON.equals(ti.getString(TRANS_RULE))){
            //轉換為JSON串
            addField(r,ti.getString(TRANS_FIELD),
                    ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD));
        }
        if(RULE_TOTXT.equals(ti.getString(TRANS_RULE))){
            //轉換為JSON串
            addField(r,ti.getString(TRANS_FIELD),
                    ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD));
        }
    }
    if(isHbjl()){
        addField(r,"GROUP_KEY",ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,"分組字段拚接出的key");
    }
}
 
開發者ID:majinju,項目名稱:KettleEasyExpand,代碼行數:25,代碼來源:DataTransform.java

示例2: setStepOutputInterface

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
/**
 * This method will be used for setting the output interface.
 * Output interface is how this step will process the row to next step
 */
private void setStepOutputInterface() {
  ValueMetaInterface[] out = new ValueMetaInterface[measureCount + 1];

  for (int i = 0; i < measureCount; i++) {
    out[i] = new ValueMeta("measure" + i, ValueMetaInterface.TYPE_NUMBER,
        ValueMetaInterface.STORAGE_TYPE_NORMAL);
    out[i].setStorageMetadata(new ValueMeta("measure" + i, ValueMetaInterface.TYPE_NUMBER,
        ValueMetaInterface.STORAGE_TYPE_NORMAL));
  }

  out[out.length - 1] = new ValueMeta("id", ValueMetaInterface.TYPE_BINARY,
      ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
  out[out.length - 1].setStorageMetadata(new ValueMeta("id", ValueMetaInterface.TYPE_STRING,
      ValueMetaInterface.STORAGE_TYPE_NORMAL));
  out[out.length - 1].setLength(256);
  out[out.length - 1].setStringEncoding(CarbonCommonConstants.BYTE_ENCODING);
  out[out.length - 1].getStorageMetadata().setStringEncoding(CarbonCommonConstants.BYTE_ENCODING);

  data.outputRowMeta.setValueMetaList(Arrays.asList(out));
}
 
開發者ID:carbondata,項目名稱:carbondata,代碼行數:25,代碼來源:MDKeyGenStep.java

示例3: FastJsonInputField

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public FastJsonInputField(Node fnode) throws KettleValueException {
	setName(XMLHandler.getTagValue(fnode, "name"));
	setPath(XMLHandler.getTagValue(fnode, "path"));
	setType(ValueMeta.getType(XMLHandler.getTagValue(fnode, "type")));
	setFormat(XMLHandler.getTagValue(fnode, "format"));
	setCurrencySymbol(XMLHandler.getTagValue(fnode, "currency"));
	setDecimalSymbol(XMLHandler.getTagValue(fnode, "decimal"));
	setGroupSymbol(XMLHandler.getTagValue(fnode, "group"));
	setLength(Const.toInt(XMLHandler.getTagValue(fnode, "length"), -1));
	setPrecision(Const
			.toInt(XMLHandler.getTagValue(fnode, "precision"), -1));
	setTrimType(getTrimTypeByCode(XMLHandler
			.getTagValue(fnode, "trim_type")));
	setRepeated(!"N".equalsIgnoreCase(XMLHandler.getTagValue(fnode,
			"repeat")));
}
 
開發者ID:etdube,項目名稱:pdi-fastjsoninput-plugin,代碼行數:17,代碼來源:FastJsonInputField.java

示例4: createExpectedResults

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
/**
 * Create result data for test case 1. Each list object should mirror the output of the parsed JSON
 *
 * @return list of metadata/data couples of how the result should look.
 */
private List<RowMetaAndData> createExpectedResults() {
    List<RowMetaAndData> list = new ArrayList<RowMetaAndData>();
    ValueMetaInterface[] valuesMeta =
            { new ValueMeta("id", ValueMeta.TYPE_INTEGER), new ValueMeta("first_name", ValueMeta.TYPE_STRING),
                    new ValueMeta("last_name", ValueMeta.TYPE_STRING), new ValueMeta("city", ValueMeta.TYPE_STRING)};
    RowMetaInterface rm = createRowMetaInterface(valuesMeta);

    Object[] r1 = new Object[] { "123", "Jesse", "Adametz", "Santa Barbara" };
    Object[] r2 = new Object[] { "456", "James", "Ebentier", "Santa Barbara" };

    list.add(new RowMetaAndData(rm, r1));
    list.add(new RowMetaAndData(rm, r2));

    return list;
}
 
開發者ID:etdube,項目名稱:pdi-fastjsoninput-plugin,代碼行數:21,代碼來源:FastJsonInputTest.java

示例5: getXML

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public String getXML()
{
    String xml="";
    
    xml+="<"+XML_TAG+">";
    
    xml+=XMLHandler.addTagValue("field_name",      fieldName);
    xml+=XMLHandler.addTagValue("formula_string",  formula);
    xml+=XMLHandler.addTagValue("value_type",      ValueMeta.getTypeDesc(valueType));
    xml+=XMLHandler.addTagValue("value_length",    valueLength);
    xml+=XMLHandler.addTagValue("value_precision", valuePrecision);
    xml+=XMLHandler.addTagValue("replace_field",   replaceField);
    
    
    xml+="</"+XML_TAG+">";
 
    return xml;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:19,代碼來源:JaninoMetaFunction.java

示例6: createRowMetaInterfaceResult1

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
/**
 * Create the meta data for the results (ltrim/rtrim/trim).
 */
public RowMetaInterface createRowMetaInterfaceResult1()
{
	RowMetaInterface rm = new RowMeta();

	ValueMetaInterface valuesMeta[] = {
		    new ValueMeta("string",   ValueMeta.TYPE_STRING),
		    new ValueMeta("bool",     ValueMeta.TYPE_BOOLEAN)
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}

	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:20,代碼來源:JavaScriptSpecialTest.java

示例7: createSourceRowMetaInterface1

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public RowMetaInterface createSourceRowMetaInterface1()
{
	RowMetaInterface rm = new RowMeta();

	ValueMetaInterface valuesMeta[] = {
		    new ValueMeta("ID",   ValueMeta.TYPE_INTEGER, 8, 0),
		    new ValueMeta("CODE", ValueMeta.TYPE_INTEGER, 8, 0),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:17,代碼來源:TableOutputTest.java

示例8: getFields

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public void getFields(RowMetaInterface rowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
	for (int i=0;i<fieldName.length;i++) {
		if (!Const.isEmpty(fieldName[i])) {
			int type=ValueMeta.getType(fieldType[i]);
			if (type==ValueMetaInterface.TYPE_NONE) type=ValueMetaInterface.TYPE_STRING;
			ValueMetaInterface v=new ValueMeta(fieldName[i], type);
			v.setLength(fieldLength[i]);
               v.setPrecision(fieldPrecision[i]);
			v.setOrigin(name);
			v.setConversionMask(fieldFormat[i]);
			v.setCurrencySymbol(currency[i]);
			v.setGroupingSymbol(group[i]);
			v.setDecimalSymbol(decimal[i]);
			
			rowMeta.addValueMeta(v);
		}
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:20,代碼來源:DataGridMeta.java

示例9: get

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
private void get() {
    try {
        RowMetaInterface r = transMeta.getPrevStepFields( stepname );
        if ( r != null ) {
            TableItemInsertListener listener = new TableItemInsertListener() {
                public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
                    if ( v.getType() == ValueMeta.TYPE_STRING ) {
                        // Only process strings

                        return true;
                    } else {
                        return false;
                    }
                }
            };

            BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, listener );

        }
    } catch ( KettleException ke ) {
        new ErrorDialog(
                shell, BaseMessages.getString( PKG, "StringOperationsDialog.FailedToGetFields.DialogTitle" ),
                BaseMessages.getString( PKG, "StringOperationsDialog.FailedToGetFields.DialogMessage" ), ke );
    }
}
 
開發者ID:OSBI,項目名稱:pdi-sentiment,代碼行數:26,代碼來源:NLPStepDialog.java

示例10: ok

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
private void ok()
{
	if (Const.isEmpty(textStepName.getText())) return;
	this.stepname = textStepName.getText();
	meta.setFieldToParse(comboFieldToParse.getText());
	int nbrFields = tableviewFields.nrNonEmpty();
	meta.allocate(nbrFields);
	for (int i = 0; i < meta.getFieldName().length; i++)
	{
		final TableItem item = tableviewFields.getNonEmpty(i);
		meta.getFieldName()[i] = item.getText(1);
		meta.getXPath()[i] = item.getText(2);
		meta.getFieldType()[i] = ValueMeta.getType(item.getText(3));
		meta.getFieldFormat()[i] = item.getText(4);
		meta.getFieldLength()[i] = Const.toInt(item.getText(5),-1);
		meta.getFieldPrecision()[i] = Const.toInt(item.getText(6),-1);
		meta.getFieldCurrency()[i] = item.getText(7);
		meta.getFieldDecimal()[i] = item.getText(8);
		meta.getFieldGroup()[i] = item.getText(9);
		meta.getFieldTrimType()[i] = ValueMeta.getTrimTypeByDesc(item.getText(10));
		meta.getFieldRepeat()[i] = "Y".equalsIgnoreCase(item.getText(11));
	}
	this.dispose();
}
 
開發者ID:instaclick,項目名稱:pdi-plugin-parsejsonstring,代碼行數:25,代碼來源:ParseJsonStringDialog.java

示例11: getFields

import org.pentaho.di.core.row.ValueMeta; //導入依賴的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:icholy,項目名稱:geokettle-2.0,代碼行數:20,代碼來源:UniqueRowsMeta.java

示例12: saveRep

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
 {
     try
     {
rep.saveDatabaseMetaStepAttribute(id_transformation, id_step, "id_connection", database);
         rep.saveStepAttribute(id_transformation, id_step, "procedure", procedure); //$NON-NLS-1$

         for (int i = 0; i < argument.length; i++)
         {
             rep.saveStepAttribute(id_transformation, id_step, i, "arg_name", argument[i]); //$NON-NLS-1$
             rep.saveStepAttribute(id_transformation, id_step, i, "arg_direction", argumentDirection[i]); //$NON-NLS-1$
             rep.saveStepAttribute(id_transformation, id_step, i, "arg_type", ValueMeta.getTypeDesc(argumentType[i])); //$NON-NLS-1$
         }

         rep.saveStepAttribute(id_transformation, id_step, "result_name", resultName); //$NON-NLS-1$
         rep.saveStepAttribute(id_transformation, id_step, "result_type", ValueMeta.getTypeDesc(resultType)); //$NON-NLS-1$
         rep.saveStepAttribute(id_transformation, id_step, "auto_commit", autoCommit); //$NON-NLS-1$

         // Also, save the step-database relationship!
         if (database != null) rep.insertStepDatabase(id_transformation, id_step, database.getObjectId());
     }
     catch (Exception e)
     {
         throw new KettleException(BaseMessages.getString(PKG, "DBProcMeta.Exception.UnableToSaveStepInfo") + id_step, e); //$NON-NLS-1$
     }
 }
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:27,代碼來源:DBProcMeta.java

示例13: createResultRowMetaInterface5

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public RowMetaInterface createResultRowMetaInterface5()
{
	RowMetaInterface rm = new RowMeta();
	
	ValueMetaInterface[] valuesMeta = {			    
		    new ValueMeta("PARAM1", ValueMeta.TYPE_STRING),
		    new ValueMeta("PARAM2", ValueMeta.TYPE_STRING),
    };

	for (int i=0; i < valuesMeta.length; i++ )
	{
		rm.addValueMeta(valuesMeta[i]);
	}
	
	return rm;
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:17,代碼來源:ParameterSimpleTransTest.java

示例14: showArguments

import org.pentaho.di.core.row.ValueMeta; //導入依賴的package包/類
public void showArguments() {

		RowMetaAndData allArgs = new RowMetaAndData();

		for (int ii = 0; ii < arguments.length; ++ii) {
			allArgs.addValue(new ValueMeta(Props.STRING_ARGUMENT_NAME_PREFIX + (1 + ii), ValueMetaInterface.TYPE_STRING), arguments[ii]);
		}

		// Now ask the use for more info on these!
		EnterStringsDialog esd = new EnterStringsDialog(shell, SWT.NONE, allArgs);
		esd.setTitle(Messages.getString("Spoon.Dialog.ShowArguments.Title"));
		esd.setMessage(Messages.getString("Spoon.Dialog.ShowArguments.Message"));
		esd.setReadOnly(true);
		esd.setShellImage(GUIResource.getInstance().getImageLogoSmall());
		esd.open();
	}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:17,代碼來源:Spoon.java

示例15: getFields

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


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