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

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

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

Const.isEmpty介绍

[英]Check if the CharSequence supplied is empty. A CharSequence is empty when it is null or when the length is 0
[中]检查提供的CharSequence是否为空。CharSequence为null或长度为0时为空

代码示例

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

@Override public String getURL( String hostname, String port, String databaseName ) {
 if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) {
  return "jdbc:odbc:" + databaseName;
 } else {
  if ( Const.isEmpty( port ) ) {
   return "jdbc:mariadb://" + hostname + "/" + databaseName;
  } else {
   return "jdbc:mariadb://" + hostname + ":" + port + "/" + databaseName;
  }
 }
}

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

private boolean isTransformationDefined() {
 return !Utils.isEmpty( fileName ) || transObjectId != null || ( !Utils.isEmpty( this.directoryPath ) && !Const
  .isEmpty( transName ) );
}

代码示例来源:origin: pentaho/big-data-plugin

private boolean hasCombinerDefinition() {
 return !Const.isEmpty( combinerTrans ) || combinerRepositoryReference != null
  || ( !Const.isEmpty( combinerRepositoryDir ) && !Const.isEmpty( combinerRepositoryFile ) );
}

代码示例来源:origin: pentaho/big-data-plugin

private boolean hasMapperDefinition() {
 return !Const.isEmpty( mapTrans ) || mapRepositoryReference != null
  || ( !Const.isEmpty( mapRepositoryDir ) && !Const.isEmpty( mapRepositoryFile ) );
}

代码示例来源:origin: pentaho/pdi-sdk-plugins

/**
 *  This method is called when Spoon needs to display the name
 *  of the partitioner on dialogs etc. 
 *  
 *  @return a string containing a descriptive string for the partitioner 
 */
public String getDescription() {
 String description = "String length based demo partitioner";
 if ( !Const.isEmpty( fieldName ) ) {
  description += " (" + fieldName + ")";
 }
 return description;
}

代码示例来源:origin: pentaho/big-data-plugin

protected String decodeAccessKey( String key ) {
 if ( Const.isEmpty( key ) ) {
  return key;
 }
 return key.replaceAll( "%2B", "\\+" ).replaceAll( "%2F", "/" );
}

代码示例来源:origin: pentaho/big-data-plugin

boolean filterMatch( String string ) {
 if ( Const.isEmpty( string ) ) {
  return true;
 }
 String filter = spoon.selectionFilter.getText();
 if ( Const.isEmpty( filter ) ) {
  return true;
 }
 return string.toUpperCase().contains( filter.toUpperCase() );
}

代码示例来源:origin: pentaho/big-data-plugin

public static URL stringToURL( String pathOrURL ) throws MalformedURLException {
 URL result = null;
 if ( !Const.isEmpty( pathOrURL ) ) {
  if ( pathOrURL.toLowerCase().startsWith( "http://" ) || pathOrURL.toLowerCase().startsWith( "file://" ) ) {
   result = new URL( pathOrURL );
  } else {
   String c = "file://" + pathOrURL;
   result = new URL( c );
  }
 }
 return result;
}

代码示例来源:origin: pentaho/big-data-plugin

@Override
public String getURL( String hostname, String port, String databaseName ) {
 if ( Const.isEmpty( port ) ) {
  port = Integer.toString( getDefaultDatabasePort() );
 }
 return URL_PREFIX + hostname + ":" + port + "/" + databaseName;
}

代码示例来源:origin: pentaho/modeler

private String summaryMsgKey() {
 if ( Const.isEmpty( getParentAttribute() ) ) {
  return "Modeler.CreateAttribute.Summary.noparent";
 }
 return "Modeler.CreateAttribute.Summary";
}

代码示例来源:origin: pentaho/big-data-plugin

private void ok() {
 if ( Const.isEmpty( wStepname.getText() ) ) {
  return;
 }
 stepname = wStepname.getText(); // return value
 getInfo( input );
 dispose();
}

代码示例来源:origin: pentaho/big-data-plugin

private void ok() {
 if ( Const.isEmpty( wStepname.getText() ) ) {
  return;
 }
 stepname = wStepname.getText(); // return value
 getInfo( input );
 dispose();
}

代码示例来源:origin: pentaho/big-data-plugin

private void ok() {
 if ( Const.isEmpty( wStepname.getText() ) ) {
  return;
 }
 getInfo( input );
 dispose();
}

代码示例来源:origin: pentaho/big-data-plugin

public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
 if ( !Const.isEmpty( m_incomingKeyField ) ) {
  rep.saveStepAttribute( id_transformation, id_step, 0, "incoming_key_field", m_incomingKeyField );
 }
 if ( !Const.isEmpty( m_incomingResultField ) ) {
  rep.saveStepAttribute( id_transformation, id_step, 0, "incoming_result_field", m_incomingResultField );
 }
 namedClusterLoadSaveUtil.saveRep( rep, metaStore, id_transformation, id_step, namedClusterService, namedCluster, log );
 if ( m_mapping != null ) {
  m_mapping.saveRep( rep, id_transformation, id_step );
 }
}

代码示例来源:origin: pentaho/big-data-plugin

protected void ok() {
 if ( Const.isEmpty( m_stepnameText.getText() ) ) {
  return;
 }
 stepname = m_stepnameText.getText();
 setMeta( m_currentMeta );
 if ( !m_originalMeta.equals( m_currentMeta ) ) {
  m_currentMeta.setChanged();
  changed = m_currentMeta.hasChanged();
 }
 dispose();
}

代码示例来源:origin: pentaho/big-data-plugin

@Override
public String getMissingDatabaseConnectionInformationMessage() {
 if ( Const.isEmpty( getJobConfig().getDatabase() ) && !Const.isEmpty( getJobConfig().getConnect() ) ) {
  // We're using advanced configuration, alert the user we cannot visualize unless we're not using a database
  // managed by Kettle
  return BaseMessages.getString( AbstractSqoopJobEntry.class, "ErrorMustConfigureDatabaseConnectionFromList" );
 }
 // Use the default error message
 return null;
}

代码示例来源:origin: pentaho/modeler

private HierarchyMetaData locateHierarchy( final ModelerWorkspace workspace, final String name ) {
 for ( DimensionMetaData dimensionMetaData : workspace.getModel().getDimensions() ) {
  if ( dimensionMetaData.getName().equals( getDimension() ) ) {
   for ( HierarchyMetaData hierarchyMetaData : dimensionMetaData ) {
    if ( hierarchyMetaData.getName().equals( Const.isEmpty( name ) ? getDimension() : name ) ) {
     return hierarchyMetaData;
    }
   }
  }
 }
 return null;
}

代码示例来源:origin: pentaho/big-data-plugin

protected FileSystemOptions getFileSystemOptions() throws FileSystemException {
 FileSystemOptions opts = new FileSystemOptions();
 if ( !Const.isEmpty( getAccessKey() ) || !Const.isEmpty( getSecretKey() ) ) {
  // create a FileSystemOptions with user & password
  StaticUserAuthenticator userAuthenticator =
   new StaticUserAuthenticator( null, getVariableSpace().environmentSubstitute( getAccessKey() ),
    getVariableSpace().environmentSubstitute( getSecretKey() ) );
  DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator( opts, userAuthenticator );
 }
 return opts;
}

代码示例来源:origin: pentaho/big-data-plugin

protected void getData() {
 if ( !Const.isEmpty( m_currentMeta.getIncomingKeyField() ) ) {
  m_incomingKeyCombo.setText( m_currentMeta.getIncomingKeyField() );
 }
 if ( !Const.isEmpty( m_currentMeta.getIncomingResultField() ) ) {
  m_incomingResultCombo.setText( m_currentMeta.getIncomingResultField() );
 }
 m_mappingEditor.setSelectedNamedCluster( m_currentMeta.getNamedCluster().getName() );
 if ( m_currentMeta.getMapping() != null ) {
  m_mappingEditor.setMapping( m_currentMeta.getMapping() );
 }
}

代码示例来源:origin: pentaho/modeler

@Override public String getSummary() {
 return BaseMessages
   .getString( MSG_CLASS, summaryMsgKey(), getName(), Const.isEmpty( getHierarchy() ) ? "" : " " + getHierarchy(),
     getParentAttribute() );
}

相关文章

微信公众号

最新文章

更多