本文整理了Java中org.pentaho.di.core.util.Utils.isEmpty()
方法的一些代码示例,展示了Utils.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.isEmpty()
方法的具体详情如下:
包路径:org.pentaho.di.core.util.Utils
类名称:Utils
方法名:isEmpty
[英]Check if the list supplied is empty. An array is empty when it is null or when the length is 0
[中]
代码示例来源:origin: pentaho/pentaho-kettle
public TextFileSelector( String sourcefolderin, String filewildcard ) {
if ( !Utils.isEmpty( sourcefolderin ) ) {
sourceFolder = sourcefolderin;
}
if ( !Utils.isEmpty( filewildcard ) ) {
fileWildcard = filewildcard;
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public TextOneFileSelector( String sourcefolderin, String sourcefilenamein, String destfolderin ) {
if ( !Utils.isEmpty( sourcefilenamein ) ) {
filename = sourcefilenamein;
}
if ( !Utils.isEmpty( sourcefolderin ) ) {
foldername = sourcefolderin;
}
if ( !Utils.isEmpty( destfolderin ) ) {
destfolder = destfolderin;
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public String loadURL( String url, String ncName, IMetaStore metastore, Map<String, String> mappings ) {
if ( !Utils.isEmpty( ncName ) && !Utils.isEmpty( url ) ) {
mappings.put( url, ncName );
}
return url;
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public BigDecimal getBigNumber() {
if ( Utils.isEmpty( string ) ) {
return null;
}
// Localise , to .
if ( Const.DEFAULT_DECIMAL_SEPARATOR != '.' ) {
string = string.replace( Const.DEFAULT_DECIMAL_SEPARATOR, '.' );
}
return new BigDecimal( string );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void write( byte[] b ) throws IOException {
if ( Utils.isEmpty( encoding ) ) {
writer.append( new String( b ) );
} else {
writer.append( new String( b, encoding ) );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public String getURL( String hostname, String port, String databaseName ) {
if ( !Utils.isEmpty( port ) && Const.toInt( port, -1 ) > 0 ) {
return "jdbc:luciddb:http://" + hostname + ":" + port;
} else {
return "jdbc:luciddb:http://" + hostname;
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public void focusGained( org.eclipse.swt.events.FocusEvent e ) {
// check if the URL and login credentials passed and not just had error
if ( Utils.isEmpty( wURL.getText() )
|| Utils.isEmpty( wUserName.getText() ) || Utils.isEmpty( wPassword.getText() )
|| ( getModulesListError ) ) {
return;
}
getModulesList();
}
} );
代码示例来源:origin: pentaho/pentaho-kettle
public static String getPortSpecification( VariableSpace space, String port ) {
String realPort = space.environmentSubstitute( port );
String portSpec = ":" + realPort;
if ( Utils.isEmpty( realPort ) || port.equals( "80" ) ) {
portSpec = "";
}
return portSpec;
}
代码示例来源:origin: pentaho/pentaho-kettle
public static String createEntryKey( String connectionGroup, String partitionID, Database database ) {
StringBuilder key = new StringBuilder( connectionGroup );
key.append( ':' ).append( database.getDatabaseMeta().getName() );
if ( !Utils.isEmpty( partitionID ) ) {
key.append( ':' ).append( partitionID );
}
return key.toString();
}
代码示例来源:origin: pentaho/pentaho-kettle
private void ok() {
if ( Utils.isEmpty( wStepname.getText() ) ) {
return;
}
// Get the information for the dialog into the input structure.
getInfo( input );
dispose();
}
代码示例来源:origin: pentaho/pentaho-kettle
private void ok() {
if ( Utils.isEmpty( wStepname.getText() ) ) {
return;
}
stepname = wStepname.getText(); // return value
input.setMessageField( wMessageField.getText() );
dispose();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public ObjectId renameJob( ObjectId id_job, String versionComment, RepositoryDirectoryInterface newDir,
String newName ) throws KettleException {
ObjectId objectId = renameObject( id_job, newDir, newName, EXT_JOB );
if ( !Utils.isEmpty( versionComment ) ) {
insertLogEntry( "Rename job : " + versionComment );
}
return objectId;
}
代码示例来源:origin: pentaho/pentaho-kettle
public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
boolean add_fieldname, boolean add_cr ) {
String definition =
v.getDatabaseColumnTypeDefinition( databaseInterface, tk, pk, use_autoinc, add_fieldname, add_cr );
if ( !Utils.isEmpty( definition ) ) {
return definition;
}
return databaseInterface.getFieldDefinition( v, tk, pk, use_autoinc, add_fieldname, add_cr );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Overrides parent behavior to allow <code>getDatabasePortNumberString</code> value to override value of
* <code>DBS_PORT</code> extra option.
*/
@Override
public Map<String, String> getExtraOptions() {
Map<String, String> map = super.getExtraOptions();
if ( !Utils.isEmpty( getDatabasePortNumberString() ) ) {
map.put( getPluginId() + ".DBS_PORT", getDatabasePortNumberString() );
}
return map;
}
代码示例来源:origin: pentaho/pentaho-kettle
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore )
throws KettleStepException {
// Output field (String)
if ( !Utils.isEmpty( resultfieldname ) ) {
ValueMetaInterface v = new ValueMetaBoolean( space.environmentSubstitute( resultfieldname ) );
v.setOrigin( name );
inputRowMeta.addValueMeta( v );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
private TransMeta loadTransformation( ReportSubjectLocation location ) throws KettleException {
TransMeta transMeta;
if ( !Utils.isEmpty( location.getFilename() ) ) {
transMeta = new TransMeta( location.getFilename() );
} else {
transMeta = repository.loadTransformation( location.getName(), location.getDirectory(), null, true, null );
}
return transMeta;
}
代码示例来源:origin: pentaho/pentaho-kettle
private JobMeta loadJob( ReportSubjectLocation location ) throws KettleException {
JobMeta jobMeta;
if ( !Utils.isEmpty( location.getFilename() ) ) {
jobMeta = new JobMeta( location.getFilename(), repository );
} else {
jobMeta = repository.loadJob( location.getName(), location.getDirectory(), null, null );
}
return jobMeta;
}
代码示例来源:origin: pentaho/pentaho-kettle
public void truncateTable( String schema, String tablename ) throws KettleDatabaseException {
if ( Utils.isEmpty( connectionGroup ) ) {
String truncateStatement = databaseMeta.getTruncateTableStatement( schema, tablename );
if ( truncateStatement == null ) {
throw new KettleDatabaseException( "Truncate table not supported by "
+ databaseMeta.getDatabaseInterface().getPluginName() );
}
execStatement( truncateStatement );
} else {
execStatement( "DELETE FROM " + databaseMeta.getQuotedSchemaTableCombination( schema, tablename ) );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
private boolean checkUser() {
if ( Utils.isEmpty( wUserName.getText() ) ) {
MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage( BaseMessages.getString( PKG, "SalesforceUpdateDialog.UsernameMissing.DialogMessage" ) );
mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
mb.open();
return false;
}
return true;
}
代码示例来源:origin: pentaho/pentaho-kettle
private boolean checkUser() {
if ( Utils.isEmpty( wUserName.getText() ) ) {
MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage( BaseMessages.getString( PKG, "SalesforceInsertDialog.UsernameMissing.DialogMessage" ) );
mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
mb.open();
return false;
}
return true;
}
内容来源于网络,如有侵权,请联系作者删除!