當前位置: 首頁>>代碼示例>>Java>>正文


Java Const.isEmpty方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.Const.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java Const.isEmpty方法的具體用法?Java Const.isEmpty怎麽用?Java Const.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.Const的用法示例。


在下文中一共展示了Const.isEmpty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getData

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void getData() {
    this.wCompression.setText(this.meta.getCompression().toString());

    if (!Const.isEmpty(this.meta.getCqlStatement())) {
        this.wtCql.setText(this.meta.getCqlStatement());
    }
    this.wLimit.setText(String.valueOf(this.meta.getRowLimit()));

    boolean hasInfo = (this.meta.getStepIOMeta().getInfoStreams() != null) && (!this.meta.getStepIOMeta().getInfoStreams().isEmpty());
    this.wEachRow.setEnabled(hasInfo);
    this.wlEachRow.setEnabled(hasInfo);

    setCQLToolTip();
    setFlags();

    this.wStepname.selectAll();
    this.wStepname.setFocus();
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:19,代碼來源:CassandraInputDialog.java

示例2: getURL

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
@Override
public String getURL( String hostname, String port, String databaseName ) {
  if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) {
    return "jdbc:odbc:" + databaseName;
  } else {
    String realHostname = hostname;
    String account = hostname;
    if ( !realHostname.contains( "." ) ) {
      realHostname = hostname + ".snowflakecomputing.com";
    } else {
      account = hostname.substring( 0, hostname.indexOf( "." ) );
    }
    if ( Const.isEmpty( port ) ) {
      return "jdbc:snowflake://" + realHostname + "/?account=" + account + "&db=" + databaseName
        + "&user=" + getUsername() + "&password=" + getPassword();
    } else {
      return "jdbc:snowflake://" + realHostname + ":" + port + "/?account=" + account + "&db=" + databaseName
        + "&user=" + getUsername() + "&password=" + getPassword();
    }
  }
}
 
開發者ID:inquidia,項目名稱:PentahoSnowflakePlugin,代碼行數:22,代碼來源:SnowflakeDatabaseMeta.java

示例3: updateTopicCombo

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void updateTopicCombo( RowMetaInterface previousFields ) {
  if ( m_wTopicFromIncomingField.getSelection() ) {
    m_wlTopicName.setText( BaseMessages.getString( MQTTPublisherMeta.PKG, "MQTTClientDialog.TopicNameFromField" ) );
  } else {
    m_wlTopicName.setText( BaseMessages
        .getString( org.pentaho.di.trans.steps.pentahomqttpublisher.MQTTPublisherMeta.PKG,
            "MQTTClientDialog.TopicName.Label" ) );
  }

  String current = m_wTopicName.getText();
  m_wTopicName.removeAll();
  if ( m_wTopicFromIncomingField.getSelection() ) {
    m_wTopicName.setItems( previousFields.getFieldNames() );
  }

  if ( !Const.isEmpty( current ) ) {
    m_wTopicName.setText( current );
  }
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-mqtt-plugin,代碼行數:20,代碼來源:MQTTPublisherDialog.java

示例4: ok

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void ok() {
  if ( Const.isEmpty( wStepname.getText() ) ) {
    return;
  }

  stepname = wStepname.getText(); // return value

  input.setConnection(null);
  String connectionName = wConnection.getText();
  if (StringUtils.isNotEmpty(connectionName)) {
    try{
      HCPConnection connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
      input.setConnection(connection);
    } catch(Exception exception) {
      new ErrorDialog(shell, 
          BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Title"), 
          BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Message", connectionName), exception);
    }
  }
  input.setTargetFileField(wTargetFileField.getText() );
  input.setResponseCodeField(wResponseCodeField.getText());
  input.setResponseTimeField(wResponseTimeField.getText());
  
  dispose();
}
 
開發者ID:mattcasters,項目名稱:pdi-hcp-plugin,代碼行數:26,代碼來源:HCPDeleteDialog.java

示例5: getStage

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
/**
 * Gets the Snowflake stage name based on the configured metadata
 * @param space The variable space
 * @return The Snowflake stage name to use
 */
public String getStage( VariableSpace space ) {
  if ( locationType.equals( LOCATION_TYPE_CODES[LOCATION_TYPE_USER] ) ) {
    return "@~/" + space.environmentSubstitute( targetTable );
  } else if ( locationType.equals( LOCATION_TYPE_CODES[LOCATION_TYPE_TABLE] ) ) {
    if ( !Const.isEmpty( space.environmentSubstitute( targetSchema ) ) ) {
      return "@" + space.environmentSubstitute( targetSchema ) + ".%" + space.environmentSubstitute( targetTable );
    } else {
      return "@%" + space.environmentSubstitute( targetTable );
    }
  } else if ( locationType.equals( LOCATION_TYPE_CODES[LOCATION_TYPE_INTERNAL_STAGE] ) ) {
    if ( !Const.isEmpty( space.environmentSubstitute( targetSchema ) ) ) {
      return "@" + space.environmentSubstitute( targetSchema ) + "." + space.environmentSubstitute( stageName );
    } else {
      return "@" + space.environmentSubstitute( stageName );
    }
  }
  return null;
}
 
開發者ID:inquidia,項目名稱:PentahoSnowflakePlugin,代碼行數:24,代碼來源:SnowflakeBulkLoaderMeta.java

示例6: formatField

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
/**
 * Takes an input field and converts it to bytes to be stored in the temp file.
 * @param v The metadata about the column
 * @param valueData The column data
 * @return The bytes for the value
 * @throws KettleValueException
 */
private byte[] formatField( ValueMetaInterface v, Object valueData ) throws KettleValueException {
  if ( v.isString() ) {
    if ( v.isStorageBinaryString() && v.getTrimType() == ValueMetaInterface.TRIM_TYPE_NONE && v.getLength() < 0
      && Const.isEmpty( v.getStringEncoding() ) ) {
      return (byte[]) valueData;
    } else {
      String svalue = ( valueData instanceof String ) ? (String) valueData : v.getString( valueData );

      // trim or cut to size if needed.
      //
      return convertStringToBinaryString( v, Const.trimToType( svalue, v.getTrimType() ) );
    }
  } else {
    return v.getBinaryString( valueData );
  }
}
 
開發者ID:inquidia,項目名稱:PentahoSnowflakePlugin,代碼行數:24,代碼來源:SnowflakeBulkLoader.java

示例7: init

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
    meta = (SocrataPluginMeta) smi;
    data = (SocrataPluginData) sdi;

    if (super.init(smi, sdi)) {
        try {
            binaryNullValue = new byte[meta.getOutputFields().length][];
            for (int i = 0; i < meta.getOutputFields().length; i++) {
                binaryNullValue[i] = null;
                String nullString = meta.getOutputFields()[i].getNullString();
                if (!Const.isEmpty(nullString)) {
                    binaryNullValue[i] = nullString.getBytes();
                }
            }
        } catch (Exception e) {
            logError("Couldn't initialize binary data fields", e);
            setErrors(1);
            stopAll();
        }

        return true;

    }

    return false;
}
 
開發者ID:socrata,項目名稱:socrata-kettle,代碼行數:27,代碼來源:SocrataPlugin.java

示例8: outputOrganizationDomainRow

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void outputOrganizationDomainRow( Organization org ) throws KettleStepException {
  if ( data.organizationDomainRowMeta == null || data.organizationDomainRowMeta.isEmpty() ) {
    return;
  }

  for ( String domain : org.getDomainNames() ) {
    if ( !Const.isEmpty( domain ) ) {
      Object[] outputRow = RowDataUtil.allocateRowData( data.organizationDomainRowMeta.size() );

      if ( data.domainOrganizationIdIndex >= 0 ) {
        outputRow[data.domainOrganizationIdIndex] = org.getId();
      }
      if ( data.domainNameIndex >= 0 ) {
        outputRow[data.domainNameIndex] = domain;
      }
      putRowTo( data.organizationDomainRowMeta, outputRow, data.organizationDomainOutputRowSet );
    }
  }
}
 
開發者ID:matthewtckr,項目名稱:pdi-zendesk-plugin,代碼行數:20,代碼來源:ZendeskInputOrganizations.java

示例9: ok

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
/**
 * Ok general method
 */
private void ok() {
  if ( Const.isEmpty( wStepname.getText() ) ) {
    return;
  }

  stepname = wStepname.getText(); // return value

  setData( m_inputMeta );
  if ( !m_originalMeta.equals( m_inputMeta ) ) {
    m_inputMeta.setChanged();
    changed = m_inputMeta.hasChanged();
  }

  dispose();
}
 
開發者ID:pentaho-labs,項目名稱:pentaho-cpython-plugin,代碼行數:19,代碼來源:CPythonScriptExecutorDialog.java

示例10: setSelectedFields

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void setSelectedFields(List<SequoiaDBInputField> fields) {
   if (null == fields) {
      return ;
   }
   
   m_fieldsView.clearAll();
   for (SequoiaDBInputField f : fields){
      TableItem item = new TableItem(m_fieldsView.table, SWT.NONE);
      
      if(!Const.isEmpty(f.m_fieldName)){
         item.setText(FIRST_COL, f.m_fieldName);
      }
      
      if(!Const.isEmpty(f.m_path)){
         item.setText(SECOND_COL, f.m_path);
      }
      
      if(!Const.isEmpty(f.m_kettleType)){
         item.setText(THIRD_COL, f.m_kettleType);
      }
   }
   
   m_fieldsView.removeEmptyRows();
   m_fieldsView.setRowNums();
   m_fieldsView.optWidth(true);
}
 
開發者ID:SequoiaDB,項目名稱:pentaho-sequoiadb-plugin,代碼行數:27,代碼來源:SequoiaDBInputDialog.java

示例11: setTableFieldCombo

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void setTableFieldCombo() {
    Runnable fieldLoader = new Runnable() {
        public void run() {
            if (!m_wEndpoint.isDisposed() && !m_wAccessId.isDisposed() && !m_wAccessKey
                .isDisposed() && !m_wProjectName.isDisposed() && !m_wTableName.isDisposed()) {

                final String endpoint = m_wEndpoint.getText(),
                    accessId = m_wAccessId.getText(),
                    accessKey = m_wAccessKey.getText(),
                    projectName = m_wProjectName.getText(),
                    tableName = m_wTableName.getText();

                if (!Const.isEmpty(endpoint) && !Const.isEmpty(accessId) && !Const
                    .isEmpty(accessKey) && !Const.isEmpty(projectName) && !Const
                    .isEmpty(tableName)) {

                    TableSchema schema = MaxcomputeUtil
                        .getTableSchema(new AliyunAccount(accessId, accessKey), endpoint,
                            projectName, tableName);

                    List<Column> columns = schema.getColumns();

                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < columns.size(); i++) {
                        sb.append(columns.get(i).getName()).append("\n");
                    }
                    String[] fieldNames = sb.toString().split("\n");
                    for (ColumnInfo colInfo : tableFieldColumns) {
                        colInfo.setComboValues(fieldNames);
                    }

                }
            }
        }
    };
    shell.getDisplay().asyncExec(fieldLoader);
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:38,代碼來源:OdpsInputDialog.java

示例12: readRep

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
@Override
public void readRep(Repository rep, IMetaStore metastore, ObjectId id_step, List<DatabaseMeta> databases)
        throws KettleException {
    this.cassandraNodes = rep.getStepAttributeString(id_step, 0, CASSANDRA_NODES);
    this.cassandraPort = rep.getStepAttributeString(id_step, 0, CASSANDRA_PORT);
    this.username = rep.getStepAttributeString(id_step, 0, USERNAME);
    this.password = rep.getStepAttributeString(id_step, 0, PASSWORD);
    if (!Const.isEmpty(this.password)) {
        this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
    }
    this.keyspace = rep.getStepAttributeString(id_step, 0, CASSANDRA_KEYSPACE);
    this.SslEnabled = rep.getStepAttributeBoolean(id_step, 0, CASSANDRA_WITH_SSL);
    this.trustStoreFilePath = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_FILE_PATH);
    this.trustStorePass = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_PASS);
    if (!Const.isEmpty(this.trustStorePass)) {
        this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
    }
    this.columnfamily = rep.getStepAttributeString(id_step, 0, CASSANDRA_COLUMN_FAMILY);
    this.syncMode = rep.getStepAttributeBoolean(id_step, 0, SYNC_ENABLED);

    String batchSize = rep.getStepAttributeString(id_step, 0, BATCH_SIZE);
    this.batchSize = (Const.isEmpty(batchSize) ? 1000 : Integer.valueOf(batchSize));

    String sCompression = rep.getStepAttributeString(id_step, 0, QUERY_COMPRESSION);
    this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));

    this.specifyFields = rep.getStepAttributeBoolean(id_step, 0, SPECIFY_FIELDS);

    int nrCols = rep.countNrStepAttributes(id_step, COLUMN_NAME);
    int nrStreams = rep.countNrStepAttributes(id_step, STREAM_NAME);
    int nrRows = nrCols < nrStreams ? nrStreams : nrCols;

    allocate(nrRows);
    for (int idx = 0; idx < nrRows; idx++) {
        this.cassandraFields[idx] = Const.NVL(rep.getStepAttributeString(id_step, idx, COLUMN_NAME), "");
        this.streamFields[idx] = Const.NVL(rep.getStepAttributeString(id_step, idx, STREAM_NAME), "");
    }

    this.ttl = Const.toInt(rep.getStepAttributeString(id_step, 0, TTL), 0);
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:41,代碼來源:CassandraOutputMeta.java

示例13: init

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
    if (super.init(smi, sdi)) {
        this.meta = ((CassandraOutputMeta) smi);

        this.nodes = environmentSubstitute(this.meta.getCassandraNodes());
        this.port = environmentSubstitute(this.meta.getCassandraPort());
        this.username = environmentSubstitute(this.meta.getUsername());
        this.password = environmentSubstitute(this.meta.getPassword());
        this.keyspace = environmentSubstitute(this.meta.getKeyspace());
        this.columnfamily = environmentSubstitute(this.meta.getColumnfamily());
        this.SslEnabled = this.meta.getSslEnabled();
        this.truststoreFilePath = environmentSubstitute(this.meta.getTrustStoreFilePath());
        this.truststorepass = environmentSubstitute(this.meta.getTrustStorePass());
        this.compression = this.meta.getCompression();
        this.syncModeEnabled = this.meta.isSyncMode();
        this.maxOpenQueue = (this.syncModeEnabled ? 0 : this.meta.getBatchSize());

        try {
            if (Const.isEmpty(this.columnfamily)) {
                throw new RuntimeException(BaseMessages.getString(CassandraOutputMeta.PKG,
                        "CassandraOutput.Error.NoColumnFamilySpecified", new String[0]));
            }

            if ((this.meta.isSpecifyFields()) && (this.meta.getCassandraFields().length != this.meta.getStreamFields().length)) {
                throw new RuntimeException(BaseMessages.getString(CassandraOutputMeta.PKG,
                        "CassandraOutput.Error.InitializationColumnProblem", new String[0]));
            }

            this.connection = Utils.connect(this.nodes, this.port, this.username, this.password,
                    this.keyspace, this.SslEnabled, this.truststoreFilePath, this.truststorepass, this.compression);

            return true;
        } catch (Exception ex) {
            logError(BaseMessages.getString(CassandraOutputMeta.PKG,"CassandraOutput.Error.InitializationProblem"), ex);
        }
    }
    return false;
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:40,代碼來源:CassandraOutput.java

示例14: loadXML

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metastore) throws KettleXMLException {
    this.cassandraNodes = XMLHandler.getTagValue(stepnode, CASSANDRA_NODES);
    this.cassandraPort = XMLHandler.getTagValue(stepnode, CASSANDRA_PORT);
    this.username = XMLHandler.getTagValue(stepnode, USERNAME);
    this.password = XMLHandler.getTagValue(stepnode, PASSWORD);
    if (!Const.isEmpty(this.password)) {
        this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
    }
    this.keyspace = XMLHandler.getTagValue(stepnode, CASSANDRA_KEYSPACE);
    this.SslEnabled = "Y".equals(XMLHandler.getTagValue(stepnode, CASSANDRA_WITH_SSL));
    this.trustStoreFilePath = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_FILE_PATH);
    this.trustStorePass = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_PASS);
    String sCompression = XMLHandler.getTagValue(stepnode, COMPRESSION);
    this.cqlStatement = XMLHandler.getTagValue(stepnode, CQL);
    this.executeForEachInputRow = "Y".equals(XMLHandler.getTagValue(stepnode, EXECUTE_FOR_EACH_INPUT));
    String sRowLimit = XMLHandler.getTagValue(stepnode, ROW_LIMIT);

    checkNulls();

    if (this.cqlStatement == null) {
        this.cqlStatement = "";
    }
    if (!Const.isEmpty(sRowLimit)) {
        this.rowLimit = Integer.parseInt(sRowLimit);
    }
    this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:29,代碼來源:CassandraInputMeta.java

示例15: readRep

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
@Override
public void readRep(Repository rep, IMetaStore metastore, ObjectId id_step, List<DatabaseMeta> databases)
        throws KettleException {
    this.cassandraNodes = rep.getStepAttributeString(id_step, 0, CASSANDRA_NODES);
    this.cassandraPort = rep.getStepAttributeString(id_step, 0, CASSANDRA_PORT);
    this.username = rep.getStepAttributeString(id_step, 0, USERNAME);
    this.password = rep.getStepAttributeString(id_step, 0, PASSWORD);
    if (!Const.isEmpty(this.password)) {
        this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
    }
    this.keyspace = rep.getStepAttributeString(id_step, 0, CASSANDRA_KEYSPACE);
    this.SslEnabled = rep.getStepAttributeBoolean(id_step, CASSANDRA_WITH_SSL);
    this.trustStoreFilePath = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_FILE_PATH);
    this.trustStorePass = rep.getStepAttributeString(id_step, 0, CASSANDRA_TRUSTSTORE_PASS);
    String sCompression = rep.getStepAttributeString(id_step, 0, COMPRESSION);
    this.cqlStatement = rep.getStepAttributeString(id_step, 0, CQL);
    this.executeForEachInputRow = rep.getStepAttributeBoolean(id_step, EXECUTE_FOR_EACH_INPUT);
    this.rowLimit = ((int) rep.getStepAttributeInteger(id_step, ROW_LIMIT));

    if (!Const.isEmpty(this.trustStorePass)) {
        this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
    }

    checkNulls();

    if (this.cqlStatement == null) {
        this.cqlStatement = "";
    }
    this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
}
 
開發者ID:bcolas,項目名稱:pentaho-cassandra-plugin,代碼行數:31,代碼來源:CassandraInputMeta.java


注:本文中的org.pentaho.di.core.Const.isEmpty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。