gpt4 book ai didi

org.pentaho.di.trans.steps.yamlinput.YamlInputMeta类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 21:41:31 26 4
gpt4 key购买 nike

本文整理了Java中org.pentaho.di.trans.steps.yamlinput.YamlInputMeta类的一些代码示例,展示了YamlInputMeta类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlInputMeta类的具体详情如下:
包路径:org.pentaho.di.trans.steps.yamlinput.YamlInputMeta
类名称:YamlInputMeta

YamlInputMeta介绍

[英]Store run-time data on the YamlInput step.
[中]在YamlInput步骤上存储运行时数据。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

in.setRowLimit( Const.toLong( wLimit.getText(), 0L ) );
in.setFilenameField( wInclFilenameField.getText() );
in.setRowNumberField( wInclRownumField.getText() );
in.setAddResultFile( wAddResult.getSelection() );
in.setIncludeFilename( wInclFilename.getSelection() );
in.setIncludeRowNumber( wInclRownum.getSelection() );
in.setIgnoreEmptyFile( wIgnoreEmptyFile.getSelection() );
in.setdoNotFailIfNoFile( wdoNotFailIfNoFile.getSelection() );
in.setInFields( wYAMLStreamField.getSelection() );
in.setIsAFile( wYAMLIsAFile.getSelection() );
in.setYamlField( wYAMLLField.getText() );
in.allocate( nrFiles, nrFields );
in.setFileName( wFilenameList.getItems( 0 ) );
in.setFileMask( wFilenameList.getItems( 1 ) );
in.setFileRequired( wFilenameList.getItems( 2 ) );
in.setIncludeSubFolders( wFilenameList.getItems( 3 ) );
 in.getInputFields()[i] = field;

代码示例来源:origin: pentaho/pentaho-kettle

if ( in.getFileName() != null ) {
 wFilenameList.removeAll();
 for ( int i = 0; i < in.getFileName().length; i++ ) {
  wFilenameList.add( new String[] {
   in.getFileName()[i], in.getFileMask()[i], in.getRequiredFilesDesc( in.getFileRequired()[i] ),
   in.getRequiredFilesDesc( in.getIncludeSubFolders()[i] ) } );
wInclFilename.setSelection( in.includeFilename() );
wInclRownum.setSelection( in.includeRowNumber() );
wAddResult.setSelection( in.addResultFile() );
wIgnoreEmptyFile.setSelection( in.isIgnoreEmptyFile() );
wdoNotFailIfNoFile.setSelection( in.isdoNotFailIfNoFile() );
wYAMLStreamField.setSelection( in.isInFields() );
wYAMLIsAFile.setSelection( in.getIsAFile() );
if ( in.getYamlField() != null ) {
 wYAMLLField.setText( in.getYamlField() );
if ( in.getFilenameField() != null ) {
 wInclFilenameField.setText( in.getFilenameField() );
if ( in.getRowNumberField() != null ) {
 wInclRownumField.setText( in.getRowNumberField() );
wLimit.setText( "" + in.getRowLimit() );
for ( int i = 0; i < in.getInputFields().length; i++ ) {
 YamlInputField field = in.getInputFields()[i];

代码示例来源:origin: pentaho/pentaho-kettle

public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {
 if ( first && !meta.isInFields() ) {
  first = false;
  data.files = meta.getFiles( this );
  if ( !meta.isdoNotFailIfNoFile() && data.files.nrOfFiles() == 0 ) {
   throw new KettleException( BaseMessages.getString( PKG, "YamlInput.Log.NoFiles" ) );
  data.totalPreviousFields = 0;
  data.totalOutFields = data.totalPreviousFields + data.nrInputFields;
  meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );
  data.totalOutStreamFields = data.outputRowMeta.size();
 if ( meta.getRowLimit() > 0 && data.rownr > meta.getRowLimit() ) {

代码示例来源:origin: pentaho/pentaho-kettle

if ( !isInFields() ) {
 FileInputList fileList = getFiles( space );
 if ( fileList.getFiles().size() > 0 ) {
  for ( FileObject fileObject : fileList.getFiles() ) {

代码示例来源:origin: pentaho/pentaho-kettle

if ( getInputFields().length <= 0 ) {
 cr =
  new CheckResult( CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(
if ( isInFields() ) {
 if ( Utils.isEmpty( getYamlField() ) ) {
  cr =
   new CheckResult( CheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(
 FileInputList fileInputList = getFiles( transMeta );

代码示例来源:origin: pentaho/pentaho-kettle

if ( meta.includeFilename() && !Utils.isEmpty( meta.getFilenameField() ) ) {
 outputRowData[rowIndex++] = KettleVFS.getFilename( data.file );
if ( meta.includeRowNumber() && !Utils.isEmpty( meta.getRowNumberField() ) ) {
 outputRowData[rowIndex++] = new Long( data.rownr );

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void modify( StepMetaInterface someMeta ) {
 if ( someMeta instanceof YamlInputMeta ) {
  ( (YamlInputMeta) someMeta ).allocate( 5, 5 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

meta.getFields( data.outputRowMeta, getStepname(), null, null, this, repository, metaStore );
 if ( Utils.isEmpty( meta.getYamlField() ) ) {
  logError( BaseMessages.getString( PKG, "YamlInput.Log.NoField" ) );
  throw new KettleException( BaseMessages.getString( PKG, "YamlInput.Log.NoField" ) );
 data.indexOfYamlField = getInputRowMeta().indexOfValue( meta.getYamlField() );
 if ( data.indexOfYamlField < 0 ) {
  logError( BaseMessages.getString( PKG, "YamlInput.Log.ErrorFindingField", meta.getYamlField() ) );
  throw new KettleException( BaseMessages.getString( PKG, "YamlInput.Exception.CouldnotFindField", meta
   .getYamlField() ) );
 logDetailed( BaseMessages.getString( PKG, "YamlInput.Log.YAMLStream", meta.getYamlField(), Fieldvalue ) );
if ( meta.getIsAFile() ) {

代码示例来源:origin: pentaho/pentaho-kettle

changed = input.hasChanged();
wGet.setLayoutData( fdGet );
final int FieldsRows = input.getInputFields().length;
setIncludeFilename();
setIncludeRownum();
input.setChanged( changed );
wFields.optWidth( true );

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetSelected( SelectionEvent e ) {
  try {
   YamlInputMeta tfii = new YamlInputMeta();
   getInfo( tfii );
   FileInputList fileInputList = tfii.getFiles( transMeta );
   String[] files = fileInputList.getFileStrings();
   if ( files != null && files.length > 0 ) {
    EnterSelectionDialog esd = new EnterSelectionDialog( shell, files,
     BaseMessages.getString( PKG, "YamlInputDialog.FilesReadSelection.DialogTitle" ),
     BaseMessages.getString( PKG, "YamlInputDialog.FilesReadSelection.DialogMessage" ) );
    esd.setViewOnly();
    esd.open();
   } else {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    mb.setMessage( BaseMessages.getString( PKG, "YamlInputDialog.NoFileFound.DialogMessage" ) );
    mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
    mb.open();
   }
  } catch ( KettleException ex ) {
   new ErrorDialog(
    shell, BaseMessages.getString( PKG, "YamlInputDialog.ErrorParsingData.DialogTitle" ), BaseMessages
     .getString( PKG, "YamlInputDialog.ErrorParsingData.DialogMessage" ), ex );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

private void addFileToResultFilesname( FileObject file ) throws Exception {
 if ( meta.addResultFile() ) {
  // Add this to the result file names...
  ResultFile resultFile =
   new ResultFile( ResultFile.FILE_TYPE_GENERAL, file, getTransMeta().getName(), getStepname() );
  resultFile.setComment( BaseMessages.getString( PKG, "YamlInput.Log.FileAddedResult" ) );
  addResultFile( resultFile );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
 meta = (YamlInputMeta) smi;
 data = (YamlInputData) sdi;
 if ( super.init( smi, sdi ) ) {
  data.rownr = 1L;
  data.nrInputFields = meta.getInputFields().length;
  data.rowMeta = new RowMeta();
  for ( int i = 0; i < data.nrInputFields; i++ ) {
   YamlInputField field = meta.getInputFields()[i];
   String path = environmentSubstitute( field.getPath() );
   try {
    ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( path, field.getType() );
    valueMeta.setTrimType( field.getTrimType() );
    data.rowMeta.addValueMeta( valueMeta );
   } catch ( Exception e ) {
    log.logError( "Unable to create value meta", e );
    return false;
   }
  }
  return true;
 }
 return false;
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public Object clone() {
 YamlInputMeta retval = (YamlInputMeta) super.clone();
 int nrFiles = fileName.length;
 int nrFields = inputFields.length;
 retval.allocate( nrFiles, nrFields );
 System.arraycopy( fileName, 0, retval.fileName, 0, nrFiles );
 System.arraycopy( fileMask, 0, retval.fileMask, 0, nrFiles );
 System.arraycopy( fileRequired, 0, retval.fileRequired, 0, nrFiles );
 System.arraycopy( includeSubFolders, 0, retval.includeSubFolders, 0, nrFiles );
 for ( int i = 0; i < nrFields; i++ ) {
  if ( inputFields[i] != null ) {
   retval.inputFields[i] = (YamlInputField) inputFields[i].clone();
  }
 }
 return retval;
}

代码示例来源:origin: pentaho/pentaho-kettle

private void get() {
 YamlReader yaml = null;
 try {
  YamlInputMeta meta = new YamlInputMeta();
  getInfo( meta );
  FileInputList inputList = meta.getFiles( transMeta );

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void setDefault() {
 IsIgnoreEmptyFile = false;
 doNotFailIfNoFile = true;
 includeFilename = false;
 filenameField = "";
 includeRowNumber = false;
 rowNumberField = "";
 IsAFile = false;
 addResultFile = false;
 validating = false;
 int nrFiles = 0;
 int nrFields = 0;
 allocate( nrFiles, nrFields );
 for ( int i = 0; i < nrFiles; i++ ) {
  fileName[i] = "filename" + ( i + 1 );
  fileMask[i] = "";
  fileRequired[i] = RequiredFilesCode[0];
  includeSubFolders[i] = RequiredFilesCode[0];
 }
 for ( int i = 0; i < nrFields; i++ ) {
  inputFields[i] = new YamlInputField( "field" + ( i + 1 ) );
 }
 rowLimit = 0;
 inFields = false;
 yamlField = "";
}

代码示例来源:origin: pentaho/pentaho-kettle

int nrFields = XMLHandler.countNodes( fields, "field" );
allocate( nrFiles, nrFields );

代码示例来源:origin: pentaho/pentaho-kettle

int nrFields = rep.countNrStepAttributes( id_step, "field_name" );
allocate( nrFiles, nrFields );

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com