• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TextFileInputField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TextFileInputField类属于org.pentaho.di.trans.steps.textfileinput包,在下文中一共展示了TextFileInputField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTextInputFiles

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
/**
 * @param measuresInCSVFile
 * @throws DataLoadingException
 */
public static TextFileInputField[] getTextInputFiles(String header, StringBuilder builder,
    StringBuilder measuresInCSVFile, String delimiter) throws DataLoadingException {

  String[] columnNames = header.split(delimiter);
  TextFileInputField[] textFileInputFields = new TextFileInputField[columnNames.length];

  int i = 0;
  String tmpCol;
  for (String columnName : columnNames) {
    tmpCol = columnName.replaceAll("\"", "");
    builder.append(tmpCol);
    builder.append(";");
    textFileInputFields[i] = new TextFileInputField();
    textFileInputFields[i].setName(tmpCol.trim());
    textFileInputFields[i].setType(2);
    measuresInCSVFile.append(tmpCol);
    measuresInCSVFile.append(";");
    i++;
  }

  return textFileInputFields;

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


示例2: saveRep

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException {
    try {
        rep.saveStepAttribute(id_transformation, id_step, "serviceEmail", this.serviceEmail);
        rep.saveStepAttribute(id_transformation, id_step, "spreadsheetKey", this.spreadsheetKey);
        rep.saveStepAttribute(id_transformation, id_step, "worksheetId", this.worksheetId);
        rep.saveStepAttribute(id_transformation, id_step, "privateKeyStore", GoogleSpreadsheet.base64EncodePrivateKeyStore(this.privateKeyStore));

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

            rep.saveStepAttribute(id_transformation, id_step, i, "field_name", field.getName());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_type", ValueMeta.getTypeDesc(field.getType()));
            rep.saveStepAttribute(id_transformation, id_step, i, "field_format", field.getFormat());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_currency", field.getCurrencySymbol());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_group", field.getGroupSymbol());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_length", field.getLength());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_precision", field.getPrecision());
            rep.saveStepAttribute(id_transformation, id_step, i, "field_trim_type", ValueMeta.getTrimTypeCode(field.getTrimType()));
        }

    } catch (Exception e) {
        throw new KettleException("Unable to save step information to the repository for id_step=" + id_step, e);
    }
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:27,代码来源:GoogleSpreadsheetInputMeta.java


示例3: setUpLoadSave

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Before
public void setUpLoadSave() throws Exception {
  KettleEnvironment.init();
  PluginRegistry.init( true );
  List<String> attributes =
      Arrays.asList( "filename", "filenameField", "includingFilename", "rowNumField", "headerPresent", "delimiter",
          "enclosure", "bufferSize", "lazyConversionActive", "addResultFile", "runningInParallel", "encoding",
          "inputFields" );

  Map<String, String> getterMap = new HashMap<String, String>();
  Map<String, String> setterMap = new HashMap<String, String>();

  Map<String, FieldLoadSaveValidator<?>> attrValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();
  attrValidatorMap.put( "inputFields", new ArrayLoadSaveValidator<TextFileInputField>( new TextFileInputFieldValidator(), 5 ) );

  Map<String, FieldLoadSaveValidator<?>> typeValidatorMap = new HashMap<String, FieldLoadSaveValidator<?>>();

  loadSaveTester =
      new LoadSaveTester( testMetaClass, attributes, new ArrayList<String>(), new ArrayList<String>(), getterMap,
          setterMap, attrValidatorMap, typeValidatorMap, this );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:ParGzipCsvInputMetaTest.java


示例4: getTestObject

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public TextFileInputField getTestObject() {
  TextFileInputField rtn = new TextFileInputField();
  rtn.setCurrencySymbol( UUID.randomUUID().toString() );
  rtn.setDecimalSymbol( UUID.randomUUID().toString() );
  rtn.setFormat( UUID.randomUUID().toString() );
  rtn.setGroupSymbol( UUID.randomUUID().toString() );
  rtn.setName( UUID.randomUUID().toString() );
  rtn.setTrimType( rand.nextInt( 4 ) );
  rtn.setPrecision( rand.nextInt( 9 ) );
  rtn.setLength( rand.nextInt( 50 ) );
  rtn.setType( rand.nextInt( 7 ) );
  // Note - these fields aren't serialized by the meta class ... cannot test for them
  // rtn.setRepeated( rand.nextBoolean() );
  // rtn.setSamples( new String[] { UUID.randomUUID().toString(), UUID.randomUUID().toString(),
  // UUID.randomUUID().toString() } );
  // rtn.setNullString( UUID.randomUUID().toString() );
  // rtn.setIfNullValue( UUID.randomUUID().toString() );
  // rtn.setIgnored( rand.nextBoolean() );
  // rtn.setPosition( rand.nextInt( 10 ) );
  return rtn;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:ParGzipCsvInputMetaTest.java


示例5: validateTestObject

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public boolean validateTestObject( TextFileInputField testObject, Object actual ) {
  if ( !( actual instanceof TextFileInputField ) ) {
    return false;
  }

  TextFileInputField another = (TextFileInputField) actual;
  return new EqualsBuilder()
      .append( testObject.getCurrencySymbol(), another.getCurrencySymbol() )
      .append( testObject.getDecimalSymbol(), another.getDecimalSymbol() )
      .append( testObject.getFormat(), another.getFormat() )
      .append( testObject.getGroupSymbol(), another.getGroupSymbol() )
      .append( testObject.getName(), another.getName() )
      .append( testObject.getTrimType(), another.getTrimType() )
      .append( testObject.getPrecision(), another.getPrecision() )
      .append( testObject.getLength(), another.getLength() )
      .append( testObject.getType(), another.getType() )
      // Note - these fields aren't serialized by the meta class ... cannot test for them
      // .append( testObject.isRepeated(), another.isRepeated() )
      // .append( testObject.getSamples(), another.getSamples() )
      // .append( testObject.getNullString(), another.getNullString() )
      // .append( testObject.getIfNullValue(), another.getIfNullValue() )
      // .append( testObject.isIgnored(), another.isIgnored() )
      // .append( testObject.getPosition(), another.getPosition() )
      .isEquals();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:ParGzipCsvInputMetaTest.java


示例6: createMeta

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
private CsvInputMeta createMeta( File file, TextFileInputField[] fields, boolean headerPresent, String delimiter ) {
  CsvInputMeta meta = new CsvInputMeta();

  meta.setFilename( file.getAbsolutePath() );
  meta.setDelimiter( delimiter );
  meta.setEncoding( "utf-8" );
  meta.setEnclosure( "\"" );
  meta.setBufferSize( "1024" );

  if ( !headerPresent ) {
    meta.setInputFields( fields );
  }

  meta.setHeaderPresent( headerPresent );
  meta.setRunningInParallel( true );

  return meta;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:CsvProcessRowInParallelTest.java


示例7: setDefault

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public void setDefault() {
    this.serviceEmail = "";
    this.spreadsheetKey = "";
    this.worksheetId = "od6";
    this.privateKeyStore = null;

    TextFileInputField field = new TextFileInputField();
    field.setName("field");
    field.setType(ValueMetaInterface.TYPE_STRING);

    inputFields = new TextFileInputField[]{
            field,
    };
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:16,代码来源:GoogleSpreadsheetInputMeta.java


示例8: getXML

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public String getXML() throws KettleException {
    StringBuilder xml = new StringBuilder();
    try {
        xml.append(XMLHandler.addTagValue("serviceEmail", this.serviceEmail));
        xml.append(XMLHandler.addTagValue("spreadsheetKey", this.spreadsheetKey));
        xml.append(XMLHandler.addTagValue("worksheetId", this.worksheetId));
        xml.append(XMLHandler.openTag("privateKeyStore"));
        xml.append(XMLHandler.buildCDATA(GoogleSpreadsheet.base64EncodePrivateKeyStore(this.privateKeyStore)));
        xml.append(XMLHandler.closeTag("privateKeyStore"));

        xml.append(XMLHandler.openTag("fields"));
        for (TextFileInputField field : inputFields) {
            xml.append(XMLHandler.openTag("field"));
            xml.append(XMLHandler.addTagValue("field_name", field.getName()));
            xml.append(XMLHandler.addTagValue("field_type", ValueMeta.getTypeDesc(field.getType())));
            xml.append(XMLHandler.addTagValue("field_format", field.getFormat()));
            xml.append(XMLHandler.addTagValue("field_currency", field.getCurrencySymbol()));
            xml.append(XMLHandler.addTagValue("field_decimal", field.getDecimalSymbol()));
            xml.append(XMLHandler.addTagValue("field_group", field.getGroupSymbol()));
            xml.append(XMLHandler.addTagValue("field_length", field.getLength()));
            xml.append(XMLHandler.addTagValue("field_precision", field.getPrecision()));
            xml.append(XMLHandler.addTagValue("field_trim_type", ValueMeta.getTrimTypeCode(field.getTrimType())));
            xml.append(XMLHandler.closeTag("field"));
        }
        xml.append(XMLHandler.closeTag("fields"));

    } catch (Exception e) {
        throw new KettleValueException("Unable to write step to XML", e);
    }
    return xml.toString();
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:33,代码来源:GoogleSpreadsheetInputMeta.java


示例9: loadXML

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
    try {
        this.serviceEmail = XMLHandler.getTagValue(stepnode, "serviceEmail");
        this.spreadsheetKey = XMLHandler.getTagValue(stepnode, "spreadsheetKey");
        this.worksheetId = XMLHandler.getTagValue(stepnode, "worksheetId");
        this.privateKeyStore = GoogleSpreadsheet.base64DecodePrivateKeyStore(XMLHandler.getTagValue(stepnode, "privateKeyStore"));

        Node fields = XMLHandler.getSubNode(stepnode, "fields");
        int nrfields = XMLHandler.countNodes(fields, "field");

        allocate(nrfields);

        for (int i = 0; i < nrfields; i++) {
            inputFields[i] = new TextFileInputField();

            Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);

            inputFields[i].setName(XMLHandler.getTagValue(fnode, "field_name"));
            inputFields[i].setType(ValueMeta.getType(XMLHandler.getTagValue(fnode, "field_type")));
            inputFields[i].setFormat(XMLHandler.getTagValue(fnode, "field_format"));
            inputFields[i].setCurrencySymbol(XMLHandler.getTagValue(fnode, "field_currency"));
            inputFields[i].setDecimalSymbol(XMLHandler.getTagValue(fnode, "field_decimal"));
            inputFields[i].setGroupSymbol(XMLHandler.getTagValue(fnode, "field_group"));
            inputFields[i].setLength(Const.toInt(XMLHandler.getTagValue(fnode, "field_length"), -1));
            inputFields[i].setPrecision(Const.toInt(XMLHandler.getTagValue(fnode, "field_precision"), -1));
            inputFields[i].setTrimType(ValueMeta.getTrimTypeByCode(XMLHandler.getTagValue(fnode, "field_trim_type")));
        }

    } catch (Exception e) {
        throw new KettleXMLException("Unable to load step from XML", e);
    }
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:34,代码来源:GoogleSpreadsheetInputMeta.java


示例10: readRep

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases) throws KettleException {
    try {
        this.serviceEmail = rep.getStepAttributeString(id_step, "serviceEmail");
        this.spreadsheetKey = rep.getStepAttributeString(id_step, "spreadsheetKey");
        this.worksheetId = rep.getStepAttributeString(id_step, "worksheetId");
        this.privateKeyStore = GoogleSpreadsheet.base64DecodePrivateKeyStore(rep.getStepAttributeString(id_step, "privateKeyStore"));

        int nrfields = rep.countNrStepAttributes(id_step, "field_name");

        allocate(nrfields);

        for (int i = 0; i < nrfields; i++) {
            inputFields[i] = new TextFileInputField();

            inputFields[i].setName(rep.getStepAttributeString(id_step, i, "field_name"));
            inputFields[i].setType(ValueMeta.getType(rep.getStepAttributeString(id_step, i, "field_type")));
            inputFields[i].setFormat(rep.getStepAttributeString(id_step, i, "field_format"));
            inputFields[i].setCurrencySymbol(rep.getStepAttributeString(id_step, i, "field_currency"));
            inputFields[i].setDecimalSymbol(rep.getStepAttributeString(id_step, i, "field_decimal"));
            inputFields[i].setGroupSymbol(rep.getStepAttributeString(id_step, i, "field_group"));
            inputFields[i].setLength((int) rep.getStepAttributeInteger(id_step, i, "field_length"));
            inputFields[i].setPrecision((int) rep.getStepAttributeInteger(id_step, i, "field_precision"));
            inputFields[i].setTrimType(ValueMeta.getTrimTypeByCode(rep.getStepAttributeString(id_step, i, "field_trim_type")));
        }
    } catch (Exception e) {
        throw new KettleException("Unexpected error reading step information from the repository", e);
    }
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:30,代码来源:GoogleSpreadsheetInputMeta.java


示例11: getFields

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

        for (TextFileInputField field : inputFields) {
            ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta(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());
            valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
            valueMeta.setDateFormatLenient(true);
            valueMeta.setStringEncoding("UTF-8");

            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(name);

            inputRowMeta.addValueMeta(valueMeta);
        }
    } catch (Exception e) {

    }
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:33,代码来源:GoogleSpreadsheetInputMeta.java


示例12: getData

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
private void getData(GoogleSpreadsheetInputMeta meta) {
    this.wStepname.selectAll();

    this.serviceEmail.setText(meta.getServiceEmail());
    this.spreadsheetKey.setText(meta.getSpreadsheetKey());
    this.worksheetId.setText(meta.getWorksheetId());

    this.privateKeyStore = meta.getPrivateKeyStore();
    if (this.privateKeyStore != null) {
        this.privateKeyInfo.setText("Client ID: " + getPrivateKeyClientID(this.privateKeyStore));
    } else {
        this.privateKeyInfo.setText("Private key not loaded.");
    }

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

        TableItem item = new TableItem(wFields.table, SWT.NONE);
        int colnr = 1;
        item.setText(colnr++, Const.NVL(field.getName(), ""));
        item.setText(colnr++, ValueMeta.getTypeDesc(field.getType()));
        item.setText(colnr++, Const.NVL(field.getFormat(), ""));
        item.setText(colnr++, field.getLength() >= 0 ? Integer.toString(field.getLength()) : "");
        item.setText(colnr++, field.getPrecision() >= 0 ? Integer.toString(field.getPrecision()) : "");
        item.setText(colnr++, Const.NVL(field.getCurrencySymbol(), ""));
        item.setText(colnr++, Const.NVL(field.getDecimalSymbol(), ""));
        item.setText(colnr++, Const.NVL(field.getGroupSymbol(), ""));
        item.setText(colnr++, Const.NVL(field.getTrimTypeDesc(), ""));
    }

    wFields.removeEmptyRows();
    wFields.setRowNums();
    wFields.optWidth(true);
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:35,代码来源:GoogleSpreadsheetInputDialog.java


示例13: setData

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
private void setData(GoogleSpreadsheetInputMeta meta) {
    meta.setServiceEmail(this.serviceEmail.getText());
    meta.setPrivateKeyStore(this.privateKeyStore);
    meta.setSpreadsheetKey(this.spreadsheetKey.getText());
    meta.setWorksheetId(this.worksheetId.getText());

    int nrNonEmptyFields = wFields.nrNonEmpty();
    meta.allocate(nrNonEmptyFields);

    for (int i = 0; i < nrNonEmptyFields; i++) {
        TableItem item = wFields.getNonEmpty(i);
        meta.getInputFields()[i] = new TextFileInputField();

        int colnr = 1;
        meta.getInputFields()[i].setName(item.getText(colnr++));
        meta.getInputFields()[i].setType(ValueMeta.getType(item.getText(colnr++)));
        meta.getInputFields()[i].setFormat(item.getText(colnr++));
        meta.getInputFields()[i].setLength(Const.toInt(item.getText(colnr++), -1));
        meta.getInputFields()[i].setPrecision(Const.toInt(item.getText(colnr++), -1));
        meta.getInputFields()[i].setCurrencySymbol(item.getText(colnr++));
        meta.getInputFields()[i].setDecimalSymbol(item.getText(colnr++));
        meta.getInputFields()[i].setGroupSymbol(item.getText(colnr++));
        meta.getInputFields()[i].setTrimType(ValueMeta.getTrimTypeByDesc(item.getText(colnr++)));
    }
    wFields.removeEmptyRows();
    wFields.setRowNums();
    wFields.optWidth(true);

    meta.setChanged();
}
 
开发者ID:GlobalTechnology,项目名称:pdi-google-spreadsheet-plugin,代码行数:31,代码来源:GoogleSpreadsheetInputDialog.java


示例14: getXML

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
public String getXML()
{
	StringBuffer retval = new StringBuffer(500);

	retval.append("    ").append(XMLHandler.addTagValue("filename", filename));
	retval.append("    ").append(XMLHandler.addTagValue("filename_field", filenameField));
	retval.append("    ").append(XMLHandler.addTagValue("rownum_field", rowNumField));
	retval.append("    ").append(XMLHandler.addTagValue("include_filename", includingFilename));
	retval.append("    ").append(XMLHandler.addTagValue("separator", delimiter));
	retval.append("    ").append(XMLHandler.addTagValue("enclosure", enclosure));
	retval.append("    ").append(XMLHandler.addTagValue("header", headerPresent));
	retval.append("    ").append(XMLHandler.addTagValue("buffer_size", bufferSize));
	retval.append("    ").append(XMLHandler.addTagValue("lazy_conversion", lazyConversionActive));
	retval.append("    ").append(XMLHandler.addTagValue("add_filename_result", isaddresult));
	retval.append("    ").append(XMLHandler.addTagValue("parallel", runningInParallel));
	retval.append("    ").append(XMLHandler.addTagValue("encoding", encoding));

	retval.append("    <fields>").append(Const.CR);
	for (int i = 0; i < inputFields.length; i++)
	{
		TextFileInputField field = inputFields[i];
		
		retval.append("      <field>").append(Const.CR);
		retval.append("        ").append(XMLHandler.addTagValue("name", field.getName()));
		retval.append("        ").append(XMLHandler.addTagValue("type", ValueMeta.getTypeDesc(field.getType())));
		retval.append("        ").append(XMLHandler.addTagValue("format", field.getFormat()));
		retval.append("        ").append(XMLHandler.addTagValue("currency", field.getCurrencySymbol()));
		retval.append("        ").append(XMLHandler.addTagValue("decimal", field.getDecimalSymbol()));
		retval.append("        ").append(XMLHandler.addTagValue("group", field.getGroupSymbol()));
		retval.append("        ").append(XMLHandler.addTagValue("length", field.getLength()));
		retval.append("        ").append(XMLHandler.addTagValue("precision", field.getPrecision()));
		retval.append("        ").append(XMLHandler.addTagValue("trim_type", ValueMeta.getTrimTypeCode(field.getTrimType())));
		retval.append("      </field>").append(Const.CR);
	}
	retval.append("    </fields>").append(Const.CR);

	return retval.toString();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:39,代码来源:ParGzipCsvInputMeta.java


示例15: saveRep

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
public void saveRep(Repository rep, long id_transformation, long id_step) throws KettleException
{
	try
	{
		rep.saveStepAttribute(id_transformation, id_step, "filename", filename);
		rep.saveStepAttribute(id_transformation, id_step, "filename_field", filenameField);
		rep.saveStepAttribute(id_transformation, id_step, "rownum_field", rowNumField);
		rep.saveStepAttribute(id_transformation, id_step, "include_filename", includingFilename);
		rep.saveStepAttribute(id_transformation, id_step, "separator", delimiter);
		rep.saveStepAttribute(id_transformation, id_step, "enclosure", enclosure);
		rep.saveStepAttribute(id_transformation, id_step, "buffer_size", bufferSize);
		rep.saveStepAttribute(id_transformation, id_step, "header", headerPresent);
		rep.saveStepAttribute(id_transformation, id_step, "lazy_conversion", lazyConversionActive);
		rep.saveStepAttribute(id_transformation, id_step, "add_filename_result", isaddresult);
		rep.saveStepAttribute(id_transformation, id_step, "parallel", runningInParallel);
		rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding);

		for (int i = 0; i < inputFields.length; i++)
		{
			TextFileInputField field = inputFields[i];
			
			rep.saveStepAttribute(id_transformation, id_step, i, "field_name", field.getName());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_type", ValueMeta.getTypeDesc(field.getType()));
			rep.saveStepAttribute(id_transformation, id_step, i, "field_format", field.getFormat());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_currency", field.getCurrencySymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_group", field.getGroupSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_length", field.getLength());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_precision", field.getPrecision());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_trim_type", ValueMeta.getTrimTypeCode( field.getTrimType()));
		}
	}
	catch (Exception e)
	{
		throw new KettleException("Unable to save step information to the repository for id_step=" + id_step, e);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:ParGzipCsvInputMeta.java


示例16: refreshFields

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
private void refreshFields()
{
	wFields.removeAll();
	for (int i=0;i<fields.size();i++)
	{
		wFields.add( ((TextFileInputField)fields.get(i)).getName() );
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:9,代码来源:TextFileImportWizardPage2.java


示例17: saveRep

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
{
	try
	{
		rep.saveStepAttribute(id_transformation, id_step, "filename", filename);
		rep.saveStepAttribute(id_transformation, id_step, "filename_field", filenameField);
		rep.saveStepAttribute(id_transformation, id_step, "rownum_field", rowNumField);
		rep.saveStepAttribute(id_transformation, id_step, "include_filename", includingFilename);
		rep.saveStepAttribute(id_transformation, id_step, "separator", delimiter);
		rep.saveStepAttribute(id_transformation, id_step, "enclosure", enclosure);
		rep.saveStepAttribute(id_transformation, id_step, "buffer_size", bufferSize);
		rep.saveStepAttribute(id_transformation, id_step, "header", headerPresent);
		rep.saveStepAttribute(id_transformation, id_step, "lazy_conversion", lazyConversionActive);
		rep.saveStepAttribute(id_transformation, id_step, "add_filename_result", isaddresult);
		rep.saveStepAttribute(id_transformation, id_step, "parallel", runningInParallel);
		rep.saveStepAttribute(id_transformation, id_step, "encoding", encoding);

		for (int i = 0; i < inputFields.length; i++)
		{
			TextFileInputField field = inputFields[i];
			
			rep.saveStepAttribute(id_transformation, id_step, i, "field_name", field.getName());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_type", ValueMeta.getTypeDesc(field.getType()));
			rep.saveStepAttribute(id_transformation, id_step, i, "field_format", field.getFormat());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_currency", field.getCurrencySymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_group", field.getGroupSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_length", field.getLength());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_precision", field.getPrecision());
			rep.saveStepAttribute(id_transformation, id_step, i, "field_trim_type", ValueMeta.getTrimTypeCode( field.getTrimType()));
		}
	}
	catch (Exception e)
	{
		throw new KettleException("Unable to save step information to the repository for id_step=" + id_step, e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:ParGzipCsvInputMeta.java


示例18: getXML

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
public String getXML()
{
	StringBuffer retval = new StringBuffer(500);
	
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("FILENAME"), filename));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("FILENAME_FIELD"), filenameField));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("ROW_NUM_FIELD"), rowNumField));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("INCLUDE_FILENAME"), includingFilename));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("DELIMITER"), delimiter));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("ENCLOSURE"), enclosure));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("HEADER_PRESENT"), headerPresent));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("BUFFERSIZE"), bufferSize));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("LAZY_CONVERSION"), lazyConversionActive));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("ADD_FILENAME_RESULT"), isaddresult));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("PARALLEL"), runningInParallel));
   retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("NEWLINE_POSSIBLE"), newlinePossibleInFields));
	retval.append("    ").append(XMLHandler.addTagValue(getXmlCode("ENCODING"), encoding));

	retval.append("    ").append(XMLHandler.openTag(getXmlCode("FIELDS"))).append(Const.CR);
	for (int i = 0; i < inputFields.length; i++)
	{
		TextFileInputField field = inputFields[i];
		
        retval.append("      ").append(XMLHandler.openTag(getXmlCode("FIELD"))).append(Const.CR);
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_NAME"), field.getName()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_TYPE"), ValueMeta.getTypeDesc(field.getType())));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_FORMAT"), field.getFormat()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_CURRENCY"), field.getCurrencySymbol()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_DECIMAL"), field.getDecimalSymbol()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_GROUP"), field.getGroupSymbol()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_LENGTH"), field.getLength()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_PRECISION"), field.getPrecision()));
		retval.append("        ").append(XMLHandler.addTagValue(getXmlCode("FIELD_TRIM_TYPE"), ValueMeta.getTrimTypeCode(field.getTrimType())));
           retval.append("      ").append(XMLHandler.closeTag(getXmlCode("FIELD"))).append(Const.CR);
	}
       retval.append("    ").append(XMLHandler.closeTag(getXmlCode("FIELDS"))).append(Const.CR);

	return retval.toString();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:40,代码来源:CsvInputMeta.java


示例19: saveRep

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
{
	try
	{
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("FILENAME"), filename);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("FILENAME_FIELD"), filenameField);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("ROW_NUM_FIELD"), rowNumField);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("INCLUDE_FILENAME"), includingFilename);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("DELIMITER"), delimiter);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("ENCLOSURE"), enclosure);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("BUFFERSIZE"), bufferSize);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("HEADER_PRESENT"), headerPresent);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("LAZY_CONVERSION"), lazyConversionActive);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("ADD_FILENAME_RESULT"), isaddresult);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("PARALLEL"), runningInParallel);
     rep.saveStepAttribute(id_transformation, id_step, getRepCode("NEWLINE_POSSIBLE"), newlinePossibleInFields);
		rep.saveStepAttribute(id_transformation, id_step, getRepCode("ENCODING"), encoding);

		for (int i = 0; i < inputFields.length; i++)
		{
			TextFileInputField field = inputFields[i];
			
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_NAME"), field.getName());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_TYPE"), ValueMeta.getTypeDesc(field.getType()));
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_FORMAT"), field.getFormat());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_CURRENCY"), field.getCurrencySymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_DECIMAL"), field.getDecimalSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_GROUP"), field.getGroupSymbol());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_LENGTH"), field.getLength());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_PRECISION"), field.getPrecision());
			rep.saveStepAttribute(id_transformation, id_step, i, getRepCode("FIELD_TRIM_TYPE"), ValueMeta.getTrimTypeCode( field.getTrimType()));
		}
	}
	catch (Exception e)
	{
		throw new KettleException("Unable to save step information to the repository for id_step=" + id_step, e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:39,代码来源:CsvInputMeta.java


示例20: testSerialization

import org.pentaho.di.trans.steps.textfileinput.TextFileInputField; //导入依赖的package包/类
@Test
public void testSerialization() throws KettleException {
  List<String> attributes = Arrays.asList( "AwsAccessKey", "AwsSecretKey", "Bucket", "Filename", "FilenameField",
    "RowNumField", "IncludingFilename", "Delimiter", "Enclosure", "HeaderPresent", "MaxLineSize",
    "LazyConversionActive", "RunningInParallel", "InputFields" );

  Map<String, FieldLoadSaveValidator<?>> typeMap = new HashMap<>();
  typeMap.put( TextFileInputField[].class.getCanonicalName(),
    new ArrayLoadSaveValidator<>( new TextFileInputFieldValidator() ) );
  Map<String, String> getterMap = new HashMap<>();
  Map<String, String> setterMap = new HashMap<>();
  LoadSaveTester<S3CsvInputMeta> tester = new LoadSaveTester<>( S3CsvInputMeta.class, attributes,
    getterMap, setterMap, new HashMap<String, FieldLoadSaveValidator<?>>(), typeMap );
  tester.testSerialization();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:16,代码来源:S3CsvInputMetaTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Attribute类代码示例发布时间:2022-05-22
下一篇:
Java SelectByExampleWithoutBLOBsElementGenerator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap