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


Java Const.indexOfString方法代碼示例

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


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

示例1: validateDataSetGroup

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private String validateDataSetGroup( DataSetGroup dataSetGroup, String previousName, List<String> groupNames ) {

    String message = null;

    String newName = dataSetGroup.getName();
    if ( Const.isEmpty( newName ) ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSetGroup.NoNameSpecified.Message" );
    } else if ( !Const.isEmpty( previousName ) && !previousName.equals( newName ) ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSetGroup.RenamingOfADataSetNotSupported.Message" );
    } else if ( dataSetGroup.getDatabaseMeta() == null ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSetGroup.NoDatabaseSpecified.Message" );
    } else {
      if ( Const.isEmpty( previousName ) && Const.indexOfString( newName, groupNames ) >= 0 ) {
        message = BaseMessages.getString( PKG, "DataSetHelper.DataSetGroup.AGroupWithNameExists.Message", newName );
      }
    }

    return message;
  }
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:20,代碼來源:DataSetHelper.java

示例2: validateDataSet

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private String validateDataSet( DataSet dataSet, String previousName, List<String> setNames ) {

    String message = null;

    String newName = dataSet.getName();
    if ( Const.isEmpty( newName ) ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSet.NoNameSpecified.Message" );
    } else if ( !Const.isEmpty( previousName ) && !previousName.equals( newName ) ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSet.RenamingOfADataSetsNotSupported.Message" );
    } else if ( dataSet.getGroup() == null ) {
      message = BaseMessages.getString( PKG, "DataSetHelper.DataSet.NoGroupSpecified.Message" );
    } else {
      if ( Const.isEmpty( previousName ) && Const.indexOfString( newName, setNames ) >= 0 ) {
        message = BaseMessages.getString( PKG, "DataSetHelper.DataSet.ADataSetWithNameExists.Message", newName );
      }
    }

    return message;
  }
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:20,代碼來源:DataSetHelper.java

示例3: setEncodings

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
private void setEncodings() {
  // Encoding of the text file:
  if ( !gotEncodings ) {
    gotEncodings = true;

    wEncoding.removeAll();
    List<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
    for ( int i = 0; i < values.size(); i++ ) {
      Charset charSet = values.get( i );
      wEncoding.add( charSet.displayName() );
    }

    // Now select the default!
    String defEncoding = Const.getEnvironmentVariable( "file.encoding", "UTF-8" );
    int idx = Const.indexOfString( defEncoding, wEncoding.getItems() );
    if ( idx >= 0 ) {
      wEncoding.select( idx );
    } else {
      wEncoding.select( Const.indexOfString( "UTF-8", wEncoding.getItems() ) );
    }
  }
}
 
開發者ID:griddynamics,項目名稱:xml-dom-kettle-etl-plugin,代碼行數:23,代碼來源:AddDOMXMLDialog.java

示例4: getTweakForDescription

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
/**
 * Get the TransTweak for a tweak description (from the dialog)
 * @param tweakDescription The description to look for
 * @return the tweak or NONE if nothing matched
 */
public TransTweak getTweakForDescription(String tweakDescription) {
  if (StringUtils.isEmpty(tweakDescription)) {
    return TransTweak.NONE;
  }
  int index = Const.indexOfString(tweakDescription, tweakDesc);
  if (index<0) {
    return TransTweak.NONE;
  }
  return TransTweak.values()[index];
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:16,代碼來源:DataSetConst.java

示例5: getTestTypeForDescription

import org.pentaho.di.core.Const; //導入方法依賴的package包/類
/**
 * Get the TestType for a tweak description (from the dialog)
 * @param testTypeDescription The description to look for
 * @return the test type or NONE if nothing matched
 */
public static final TestType getTestTypeForDescription(String testTypeDescription) {
  if (StringUtils.isEmpty(testTypeDescription)) {
    return TestType.NONE;
  }
  int index = Const.indexOfString(testTypeDescription, testTypeDesc);
  if (index<0) {
    return TestType.NONE;
  }
  return TestType.values()[index];
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:16,代碼來源:DataSetConst.java


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