org.pentaho.di.core.Const.nullToEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(13.1k)|赞(0)|评价(0)|浏览(95)

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

Const.nullToEmpty介绍

[英]Return empty string "" in case the given parameter is null, otherwise return the same value.
[中]如果给定参数为null,则返回空字符串“”,否则返回相同的值。

代码示例

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wxmlFilename.setText( Const.nullToEmpty( jobEntry.getxmlFilename() ) );
 wxsdFilename.setText( Const.nullToEmpty( jobEntry.getxsdFilename() ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wFilename.setText( Const.nullToEmpty( jobEntry.getFilename() ) );
 wCreateParentFolder.setSelection( jobEntry.isCreateParentFolder() );
 wAppendFile.setSelection( jobEntry.isAppendFile() );
 wContent.setText( Const.nullToEmpty( jobEntry.getContent() ) );
 wEncoding.setText( Const.nullToEmpty( jobEntry.getEncoding() ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wLogMessage.setText( Const.nullToEmpty( jobEntry.getLogMessage() ) );
 wLogSubject.setText( Const.nullToEmpty( jobEntry.getLogSubject() ) );
 if ( jobEntry.getEntryLogLevel() != null ) {
  wLoglevel.select( jobEntry.getEntryLogLevel().getLevel() );
 }
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wTablename.setText( Const.nullToEmpty( jobEntry.getTablename() ) );
 wSchemaname.setText( Const.nullToEmpty( jobEntry.getSchemaname() ) );
 if ( jobEntry.getDatabase() != null ) {
  wConnection.setText( jobEntry.getDatabase().getName() );
 }
 wName.selectAll();
 wName.setFocus();
}

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

public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
  meta = (SplitFieldToRowsMeta) smi;
  data = (SplitFieldToRowsData) sdi;

  if ( super.init( smi, sdi ) ) {
   data.rownr = 1L;

   try {
    String delimiter = Const.nullToEmpty( meta.getDelimiter() );
    if ( meta.isDelimiterRegex() ) {
     data.delimiterPattern = Pattern.compile( environmentSubstitute( delimiter ) );
    } else {
     data.delimiterPattern = Pattern.compile( Pattern.quote( environmentSubstitute( delimiter ) ) );
    }
   } catch ( PatternSyntaxException pse ) {
    log.logError( pse.getMessage() );
    throw pse;
   }

   return true;
  }
  return false;
 }
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wSQL.setText( Const.nullToEmpty( jobEntry.getSQL() ) );
 DatabaseMeta dbinfo = jobEntry.getDatabase();
 if ( dbinfo != null && dbinfo.getName() != null ) {
  wConnection.setText( dbinfo.getName() );
 } else {
  wConnection.setText( "" );
 }
 wUseSubs.setSelection( jobEntry.getUseVariableSubstitution() );
 wSQLFromFile.setSelection( jobEntry.getSQLFromFile() );
 wSendOneStatement.setSelection( jobEntry.isSendOneStatement() );
 wFilename.setText( Const.nullToEmpty( jobEntry.getSQLFilename() ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wURL.setText( Const.nullToEmpty( jobEntry.getURL() ) );
 wConnectTimeOut.setText( Const.NVL( jobEntry.getConnectTimeOut(), "0" ) );
 wReadTimeOut.setText( Const.NVL( jobEntry.getReadTimeOut(), "0" ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 if ( jobEntry.getDatabase() != null ) {
  wConnection.setText( jobEntry.getDatabase().getName() );
 }
 wSchemaname.setText( Const.nullToEmpty( jobEntry.schemaname ) );
 wTablename.setText( Const.nullToEmpty( jobEntry.tablename ) );
 wSuccessCondition.setText( JobEntryWaitForSQL.getSuccessConditionDesc( jobEntry.successCondition ) );
 wRowsCountValue.setText( Const.NVL( jobEntry.rowsCountValue, "0" ) );
 wcustomSQL.setSelection( jobEntry.iscustomSQL );
 wUseSubs.setSelection( jobEntry.isUseVars );
 wAddRowsToResult.setSelection( jobEntry.isAddRowsResult );
 wClearResultList.setSelection( jobEntry.isClearResultList );
 wSQL.setText( Const.nullToEmpty( jobEntry.customSQL ) );
 wMaximumTimeout.setText( Const.NVL( jobEntry.getMaximumTimeout(), "" ) );
 wCheckCycleTime.setText( Const.NVL( jobEntry.getCheckCycleTime(), "" ) );
 wSuccesOnTimeout.setSelection( jobEntry.isSuccessOnTimeout() );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 if ( jobEntry.getHostname() != null ) {
  wHostname.setText( jobEntry.getHostname() );
 }
 wPort.setText( Const.NVL( jobEntry.getPort(), String.valueOf( JobEntryTelnet.DEFAULT_PORT ) ) );
 wTimeOut.setText( Const.NVL( jobEntry.getTimeOut(), String.valueOf( JobEntryTelnet.DEFAULT_TIME_OUT ) ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wFilename.setText( Const.NVL( jobEntry.getFilename(), "" ) );
 wMaximumTimeout.setText( Const.NVL( jobEntry.getMaximumTimeout(), "" ) );
 wCheckCycleTime.setText( Const.NVL( jobEntry.getCheckCycleTime(), "" ) );
 wSuccesOnTimeout.setSelection( jobEntry.isSuccessOnTimeout() );
 wFileSizeCheck.setSelection( jobEntry.isFileSizeCheck() );
 wAddFilenameResult.setSelection( jobEntry.isAddFilenameToResult() );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 if ( jobEntry.getGPGLocation() != null ) {
  wGPGLocation.setText( jobEntry.getGPGLocation() );
 }
 if ( jobEntry.getFilename() != null ) {
  wFilename.setText( jobEntry.getFilename() );
 }
 if ( jobEntry.getDetachedfilename() != null ) {
  wDetachedFilename.setText( jobEntry.getDetachedfilename() );
 }
 wuseDetachedSignature.setSelection( jobEntry.useDetachedfilename() );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 if ( jobEntry.getDatabase() != null ) {
  wConnection.setText( jobEntry.getDatabase().getName() );
 }
 if ( jobEntry.arguments != null ) {
  for ( int i = 0; i < jobEntry.arguments.length; i++ ) {
   // TableItem ti = new TableItem(wFields.table, SWT.NONE);
   TableItem ti = wFields.table.getItem( i );
   if ( jobEntry.arguments[i] != null ) {
    ti.setText( 1, jobEntry.arguments[i] );
   }
   if ( jobEntry.schemaname[i] != null ) {
    ti.setText( 2, jobEntry.schemaname[i] );
   }
  }
  wFields.removeEmptyRows();
  wFields.setRowNums();
  wFields.optWidth( true );
 }
 wPrevious.setSelection( jobEntry.argFromPrevious );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
 wPort.setText( Const.nullToEmpty( jobEntry.getPort() ) );
 wConnectionTimeOut.setText( Const.NVL( jobEntry.getConnectionTimeOut(), "" ) );
 wResponseTimeOut.setText( Const.nullToEmpty( jobEntry.getResponseTimeOut() ) );
 wPassword.setText( Const.NVL( jobEntry.getPassword(), "" ) );
 wSenderServerName.setText( Const.NVL( jobEntry.getSenderServerName(), "" ) );
 wSenderServiceName.setText( Const.NVL( jobEntry.getSenderServiceName(), "" ) );
 wMessage.setText( Const.NVL( jobEntry.getMessage(), "" ) );
 wEncryptionMode.setText( JobEntrySendNagiosPassiveCheck.getEncryptionModeDesc( jobEntry.getEncryptionMode() ) );
 wLevelMode.setText( JobEntrySendNagiosPassiveCheck.getLevelDesc( jobEntry.getLevel() ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 if ( jobEntry.getHostname() != null ) {
  wHostname.setText( jobEntry.getHostname() );
 }
 if ( jobEntry.getNbrPackets() != null ) {
  wNbrPackets.setText( jobEntry.getNbrPackets() );
 } else {
  wNbrPackets.setText( "2" );
 }
 if ( jobEntry.getTimeOut() != null ) {
  wTimeOut.setText( jobEntry.getTimeOut() );
 } else {
  wTimeOut.setText( "3000" );
 }
 wPingType.select( jobEntry.ipingtype );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
 wPort.setText( Const.NVL( jobEntry.getPort(), String.valueOf( SyslogDefs.DEFAULT_PORT ) ) );
 if ( jobEntry.getFacility() != null ) {
  wFacility.setText( jobEntry.getFacility() );
 }
 if ( jobEntry.getPriority() != null ) {
  wPriority.setText( jobEntry.getPriority() );
 }
 if ( jobEntry.getMessage() != null ) {
  wMessage.setText( jobEntry.getMessage() );
 }
 if ( jobEntry.getDatePattern() != null ) {
  wDatePattern.setText( jobEntry.getDatePattern() );
 }
 wAddTimestamp.setSelection( jobEntry.isAddTimestamp() );
 wAddHostName.setSelection( jobEntry.isAddHostName() );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wFilename.setText( Const.NVL( jobEntry.getFilename(), "" ) );
 wFileVariableType.setText( JobEntrySetVariables.getVariableTypeDescription( jobEntry.getFileVariableType() ) );
 wVarSubs.setSelection( jobEntry.isReplaceVars() );
 if ( jobEntry.variableName != null ) {
  for ( int i = 0; i < jobEntry.variableName.length; i++ ) {
   TableItem ti = wFields.table.getItem( i );
   if ( jobEntry.variableName[i] != null ) {
    ti.setText( 1, jobEntry.variableName[i] );
   }
   if ( jobEntry.getVariableValue()[i] != null ) {
    ti.setText( 2, jobEntry.getVariableValue()[i] );
   }
   ti.setText( 3, JobEntrySetVariables.getVariableTypeDescription( jobEntry.getVariableType()[i] ) );
  }
  wFields.setRowNums();
  wFields.optWidth( true );
 }
 wName.selectAll();
 wName.setFocus();
}

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

wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
wServerPort.setText( jobEntry.getServerPort() );

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
 wServerPort.setText( jobEntry.getServerPort() );
 wUserName.setText( Const.NVL( jobEntry.getUserName(), "" ) );
 wPassword.setText( Const.NVL( jobEntry.getPassword(), "" ) );
 wScpDirectory.setText( Const.NVL( jobEntry.getScpDirectory(), "" ) );
 wTargetDirectory.setText( Const.NVL( jobEntry.getTargetDirectory(), "" ) );
 wWildcard.setText( Const.NVL( jobEntry.getWildcard(), "" ) );
 wRemove.setSelection( jobEntry.getRemove() );
 wAddFilenameToResult.setSelection( jobEntry.isAddToResult() );
 wCreateTargetFolder.setSelection( jobEntry.iscreateTargetFolder() );
 wgetPrevious.setSelection( jobEntry.isCopyPrevious() );
 wusePublicKey.setSelection( jobEntry.isUseKeyFile() );
 wKeyFilename.setText( Const.NVL( jobEntry.getKeyFilename(), "" ) );
 wkeyfilePass.setText( Const.NVL( jobEntry.getKeyPassPhrase(), "" ) );
 wCompression.setText( Const.NVL( jobEntry.getCompression(), "none" ) );
 wProxyType.setText( Const.NVL( jobEntry.getProxyType(), "" ) );
 wProxyHost.setText( Const.NVL( jobEntry.getProxyHost(), "" ) );
 wProxyPort.setText( Const.NVL( jobEntry.getProxyPort(), "" ) );
 wProxyUsername.setText( Const.NVL( jobEntry.getProxyUsername(), "" ) );
 wProxyPassword.setText( Const.NVL( jobEntry.getProxyPassword(), "" ) );
 wName.selectAll();
 wName.setFocus();
}

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

/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
 wName.setText( Const.nullToEmpty( jobEntry.getName() ) );
 wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
 wPort.setText( jobEntry.getPort() );
 wOID.setText( Const.NVL( jobEntry.getOID(), "" ) );
 wTimeout.setText( "" + jobEntry.getTimeout() );
 wRetry.setText( "" + jobEntry.getRetry() );
 wComString.setText( Const.NVL( jobEntry.getComString(), "" ) );
 wMessage.setText( Const.NVL( jobEntry.getMessage(), "" ) );
 wTargetType.setText( jobEntry.getTargetTypeDesc( jobEntry.getTargetType() ) );
 wUser.setText( Const.NVL( jobEntry.getUser(), "" ) );
 wPassphrase.setText( Const.NVL( jobEntry.getPassPhrase(), "" ) );
 wEngineID.setText( Const.NVL( jobEntry.getEngineID(), "" ) );
 wName.selectAll();
 wName.setFocus();
}

相关文章

微信公众号

最新文章

更多