• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JsonInputMeta类的典型用法和代码示例

java 1次浏览

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

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

示例1: JsonInputDialog

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
public JsonInputDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
	super(parent, (BaseStepMeta)in, transMeta, sname);
	input=(JsonInputMeta)in;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:6,
代码来源:JsonInputDialog.java

示例2: getInfo

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
private void getInfo(JsonInputMeta in) throws KettleException
{
	stepname = wStepname.getText(); // return value

	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.setReadUrl(wreadUrl.getSelection() );
	in.setIgnoreEmptyFile(wIgnoreEmptyFile.getSelection() );
	in.setdoNotFailIfNoFile(wdoNotFailIfNoFile.getSelection());
	in.setIgnoreMissingPath(wIgnoreMissingPath.getSelection());
	in.setInFields(wSourceStreamField.getSelection());
	in.setIsAFile(wSourceIsAFile.getSelection());
	in.setFieldValue(wFieldValue.getText());
	
	int nrFiles     = wFilenameList.getItemCount();
	int nrFields    = wFields.nrNonEmpty();
       
	in.allocate(nrFiles, nrFields);
	in.setFileName( wFilenameList.getItems(0) );
	in.setFileMask( wFilenameList.getItems(1) );
	in.setExcludeFileMask(wFilenameList.getItems(2) );
	in.setFileRequired(wFilenameList.getItems(3));
	in.setIncludeSubFolders(wFilenameList.getItems(4));

	for (int i=0;i<nrFields;i++)
	{
	    JsonInputField field = new JsonInputField();
	    
		TableItem item  = wFields.getNonEmpty(i);
           
		field.setName( item.getText(1) );
		field.setPath( item.getText(2) );
		field.setType( ValueMeta.getType(item.getText(3)) );
		field.setFormat( item.getText(4) );
		field.setLength( Const.toInt(item.getText(5), -1) );
		field.setPrecision( Const.toInt(item.getText(6), -1) );
		field.setCurrencySymbol( item.getText(7) );
		field.setDecimalSymbol( item.getText(8) );
		field.setGroupSymbol( item.getText(9) );
		field.setTrimType( JsonInputField.getTrimTypeByDesc(item.getText(10)) );
		field.setRepeated( BaseMessages.getString(PKG, "System.Combo.Yes").equalsIgnoreCase(item.getText(11)) );		
           
		in.getInputFields()[i] = field;
	}		
       in.setShortFileNameField(wShortFileFieldName.getText());
       in.setPathField(wPathFieldName.getText());
       in.setIsHiddenField(wIsHiddenName.getText());
       in.setLastModificationDateField(wLastModificationTimeName.getText());
       in.setUriField(wUriName.getText());
       in.setRootUriField(wRootUriName.getText());
       in.setExtensionField(wExtensionFieldName.getText());
       in.setSizeField(wSizeFieldName.getText());
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:58,
代码来源:JsonInputDialog.java

示例3: preview

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
private void preview()
{
       try
       {
           JsonInputMeta oneMeta = new JsonInputMeta();
           getInfo(oneMeta);
           
   		TransMeta previewMeta = TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());
           
           EnterNumberDialog numberDialog = new EnterNumberDialog(shell, props.getDefaultPreviewSize(), BaseMessages.getString(PKG, "JsonInputDialog.NumberRows.DialogTitle"), BaseMessages.getString(PKG, "JsonInputDialog.NumberRows.DialogMessage"));
           
           int previewSize = numberDialog.open();
           if (previewSize>0)
           {
               TransPreviewProgressDialog progressDialog = new TransPreviewProgressDialog(shell, previewMeta, new String[] { wStepname.getText() }, new int[] { previewSize } );
               progressDialog.open();
               
               if (!progressDialog.isCancelled())
               {
                   Trans trans = progressDialog.getTrans();
                   String loggingText = progressDialog.getLoggingText();
                   
                   if (trans.getResult()!=null && trans.getResult().getNrErrors()>0)
                   {
                   	EnterTextDialog etd = new EnterTextDialog(shell, BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"),  
                   			BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"), loggingText, true );
                   	etd.setReadOnly();
                   	etd.open();
                   }      
                   PreviewRowsDialog prd = new PreviewRowsDialog(shell, transMeta, SWT.NONE, wStepname.getText(),
						progressDialog.getPreviewRowsMeta(wStepname.getText()), progressDialog
								.getPreviewRows(wStepname.getText()), loggingText);
				prd.open();
               }
           }
       }
       catch(KettleException e)
       {
           new ErrorDialog(shell, BaseMessages.getString(PKG, "JsonInputDialog.ErrorPreviewingData.DialogTitle"), BaseMessages.getString(PKG, "JsonInputDialog.ErrorPreviewingData.DialogMessage"), e);
       }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:42,
代码来源:JsonInputDialog.java

示例4: InputsReader

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
public InputsReader( JsonInput step, JsonInputMeta meta, JsonInputData data, ErrorHandler errorHandler ) {
  this.step = step;
  this.meta = meta;
  this.data = data;
  this.errorHandler = errorHandler;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:7,
代码来源:InputsReader.java

示例5: JsonInputDialog

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
public JsonInputDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
  super( parent, (BaseStepMeta) in, transMeta, sname );
  input = (JsonInputMeta) in;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:5,
代码来源:JsonInputDialog.java

示例6: getInfo

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
/**
 * dialog -&gt; meta
 */
private void getInfo( JsonInputMeta in ) throws KettleException {
  stepname = wStepname.getText(); // return value

  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.setReadUrl( wreadUrl.getSelection() );
  in.setIgnoreEmptyFile( wIgnoreEmptyFile.getSelection() );
  in.setDoNotFailIfNoFile( wdoNotFailIfNoFile.getSelection() );
  in.setIgnoreMissingPath( wIgnoreMissingPath.getSelection() );
  in.setRemoveSourceField( wremoveSourceField.getSelection() );
  in.setInFields( wSourceStreamField.getSelection() );
  in.setIsAFile( wSourceIsAFile.getSelection() );
  in.setFieldValue( wFieldValue.getText() );

  int nrFiles = wFilenameList.getItemCount();
  int nrFields = wFields.nrNonEmpty();

  in.allocate( nrFiles, nrFields );
  in.setFileName( wFilenameList.getItems( 0 ) );
  in.setFileMask( wFilenameList.getItems( 1 ) );
  in.setExcludeFileMask( wFilenameList.getItems( 2 ) );
  in.setFileRequired( wFilenameList.getItems( 3 ) );
  in.setIncludeSubFolders( wFilenameList.getItems( 4 ) );

  for ( int i = 0; i < nrFields; i++ ) {
    JsonInputField field = new JsonInputField();

    TableItem item = wFields.getNonEmpty( i );

    field.setName( item.getText( 1 ) );
    field.setPath( item.getText( 2 ) );
    field.setType( ValueMetaFactory.getIdForValueMeta( item.getText( 3 ) ) );
    field.setFormat( item.getText( 4 ) );
    field.setLength( Const.toInt( item.getText( 5 ), -1 ) );
    field.setPrecision( Const.toInt( item.getText( 6 ), -1 ) );
    field.setCurrencySymbol( item.getText( 7 ) );
    field.setDecimalSymbol( item.getText( 8 ) );
    field.setGroupSymbol( item.getText( 9 ) );
    field.setTrimType( ValueMetaBase.getTrimTypeByDesc( item.getText( 10 ) ) );
    field.setRepeated( BaseMessages.getString( PKG, "System.Combo.Yes" ).equalsIgnoreCase( item.getText( 11 ) ) );

    in.getInputFields()[i] = field;
  }
  in.setShortFileNameField( wShortFileFieldName.getText() );
  in.setPathField( wPathFieldName.getText() );
  in.setIsHiddenField( wIsHiddenName.getText() );
  in.setLastModificationDateField( wLastModificationTimeName.getText() );
  in.setUriField( wUriName.getText() );
  in.setRootUriField( wRootUriName.getText() );
  in.setExtensionField( wExtensionFieldName.getText() );
  in.setSizeField( wSizeFieldName.getText() );
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:60,
代码来源:JsonInputDialog.java

示例7: preview

点赞 2

import org.pentaho.di.trans.steps.jsoninput.JsonInputMeta; //导入依赖的package包/类
private void preview() {
  try {
    JsonInputMeta oneMeta = new JsonInputMeta();
    getInfo( oneMeta );

    TransMeta previewMeta =
        TransPreviewFactory.generatePreviewTransformation( transMeta, oneMeta, wStepname.getText() );

    EnterNumberDialog numberDialog =
        new EnterNumberDialog( shell, props.getDefaultPreviewSize(), BaseMessages.getString( PKG,
            "JsonInputDialog.NumberRows.DialogTitle" ), BaseMessages.getString( PKG,
            "JsonInputDialog.NumberRows.DialogMessage" ) );

    int previewSize = numberDialog.open();
    if ( previewSize > 0 ) {
      TransPreviewProgressDialog progressDialog =
          new TransPreviewProgressDialog( shell, previewMeta, new String[] { wStepname.getText() },
              new int[] { previewSize } );
      progressDialog.open();

      if ( !progressDialog.isCancelled() ) {
        Trans trans = progressDialog.getTrans();
        String loggingText = progressDialog.getLoggingText();

        if ( trans.getResult() != null && trans.getResult().getNrErrors() > 0 ) {
          EnterTextDialog etd =
              new EnterTextDialog( shell, BaseMessages.getString( PKG, "System.Dialog.PreviewError.Title" ),
                  BaseMessages.getString( PKG, "System.Dialog.PreviewError.Message" ), loggingText, true );
          etd.setReadOnly();
          etd.open();
        }
        PreviewRowsDialog prd =
            new PreviewRowsDialog( shell, transMeta, SWT.NONE, wStepname.getText(), progressDialog
                .getPreviewRowsMeta( wStepname.getText() ), progressDialog.getPreviewRows( wStepname.getText() ),
                loggingText );
        prd.open();
      }
    }
  } catch ( KettleException e ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "JsonInputDialog.ErrorPreviewingData.DialogTitle" ),
        BaseMessages.getString( PKG, "JsonInputDialog.ErrorPreviewingData.DialogMessage" ), e );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:44,
代码来源:JsonInputDialog.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)