gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-19 16:55:31 27 4
gpt4 key购买 nike

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

YamlReader介绍

[英]Read YAML files, parse them and convert them to rows and writes these to one or more output streams.
[中]读取YAML文件,解析它们并将其转换为行,然后将它们写入一个或多个输出流。

代码示例

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

public void loadFile( FileObject file ) throws Exception {
 this.file = file;
 this.filename = KettleVFS.getFilename( file );
 loadFile( filename );
}

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

@SuppressWarnings( "unchecked" )
private void getNextDocument() {
 // See if we have another document
 if ( this.documenti.hasNext() ) {
  // We have another document
  this.document = this.documenti.next();
  if ( !isMapUsed() ) {
   List<Object> list = (List<Object>) getDocument();
   dataListi = list.iterator();
  }
 }
}

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

public void loadFile( String filename ) throws Exception {
 this.filename = filename;
 this.file = KettleVFS.getFileObject( filename );
 InputStream is = null;
 try {
  is = KettleVFS.getInputStream( getFile() );
  for ( Object data : getYaml().loadAll( is ) ) {
   documents.add( data );
   this.useMap = ( data instanceof Map );
  }
  this.documenti = documents.iterator();
 } finally {
  if ( is != null ) {
   is.close();
  }
 }
}

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

public void loadString( String string ) throws Exception {
 this.string = string;
 for ( Object data : getYaml().loadAll( getStringValue() ) ) {
  documents.add( data );
  this.useMap = ( data instanceof Map );
 }
 this.documenti = documents.iterator();
}

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

if ( getDocument() != null ) {
 if ( isMapUsed() ) {
  Map<Object, Object> map = (Map<Object, Object>) getDocument();
  retval = new Object[rowMeta.size()];
  for ( int i = 0; i < rowMeta.size(); i++ ) {
   Object o = null;
   if ( Utils.isEmpty( valueMeta.getName() ) ) {
    o = getDocument().toString();
   } else {
    o = map.get( valueMeta.getName() );
   retval[i] = getValue( o, valueMeta );
  finishDocument();
 } else {
  if ( dataList != null ) {
   List<Object> list = (List<Object>) getDocument();
   if ( list.size() == 1 ) {
    Iterator<Object> it = list.iterator();
     Object o = null;
     if ( Utils.isEmpty( valueMeta.getName() ) ) {
      o = getDocument().toString();
     } else {
      o = map.get( valueMeta.getName() );
     retval[i] = getValue( o, valueMeta );

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

wFields.removeAll();
 yaml = new YamlReader();
 yaml.loadFile( inputList.getFile( 0 ) );
 RowMeta row = yaml.getFields();
if ( yaml != null ) {
 try {
  yaml.close();
 } catch ( Exception e ) { /* Ignore */

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

data.yaml = new YamlReader();
data.yaml.loadFile( KettleVFS.getFileObject( Fieldvalue, getTransMeta() ) );
addFileToResultFilesname( data.yaml.getFile() );
data.yaml = new YamlReader();
data.yaml.loadString( Fieldvalue );

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

data.yaml = new YamlReader();
data.yaml.loadFile( data.file );

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

public void dispose( StepMetaInterface smi, StepDataInterface sdi ) {
 meta = (YamlInputMeta) smi;
 data = (YamlInputData) sdi;
 if ( data.yaml != null ) {
  try {
   data.yaml.close();
  } catch ( Exception e ) {
   // Ignore
  }
 }
 if ( data.file != null ) {
  try {
   data.file.close();
  } catch ( Exception e ) {
   // Ignore
  }
 }
 super.dispose( smi, sdi );
}

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

outputRowData = data.yaml.getRow( data.rowMeta );
if ( outputRowData == null ) {
 return null;

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