本文整理匯總了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;
}
示例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;
}
示例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() ) );
}
}
}
示例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];
}
示例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];
}