org.pentaho.di.core.Const类的使用及代码示例

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

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

Const介绍

暂无

代码示例

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

protected void printParameter( String name, String value, String defaultValue, String description ) {
 if ( Utils.isEmpty( defaultValue ) ) {
  System.out.println( "Parameter: " + name + "=" + Const.NVL( value, "" ) + " : " + Const.NVL( description, "" ) );
 } else {
  System.out.println( "Parameter: " + name + "=" + Const.NVL( value, "" ) + ", default=" + defaultValue + " : " + Const.NVL( description, "" ) );
 }
}

代码示例来源: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

/**
 * @deprecated use {@link #getSplitEvery(VariableSpace)} or {@link #getSplitEveryRows()}
 * @return Returns the splitEvery.
 */
@Override
public int getSplitEvery() {
 return Const.toInt( splitEveryRows, 0 );
}

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

/**
 * @return An array of all default conversion formats, to be used in dialogs etc.
 */
public static String[] getConversionFormats() {
 String[] dats = Const.getDateFormats();
 String[] nums = Const.getNumberFormats();
 int totsize = dats.length + nums.length;
 String[] formats = new String[totsize];
 for ( int x = 0; x < dats.length; x++ ) {
  formats[x] = dats[x];
 }
 for ( int x = 0; x < nums.length; x++ ) {
  formats[dats.length + x] = nums[x];
 }
 return formats;
}

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

public void guessTrimType() {
 boolean spaces_before = false;
 boolean spaces_after = false;
 for ( int i = 0; i < samples.length; i++ ) {
  spaces_before |= Const.nrSpacesBefore( samples[i] ) > 0;
  spaces_after |= Const.nrSpacesAfter( samples[i] ) > 0;
  samples[i] = Const.trim( samples[i] );
 }
 trimtype = ValueMetaInterface.TRIM_TYPE_NONE;
 if ( spaces_before ) {
  trimtype |= ValueMetaInterface.TRIM_TYPE_LEFT;
 }
 if ( spaces_after ) {
  trimtype |= ValueMetaInterface.TRIM_TYPE_RIGHT;
 }
}

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

protected String trim( String string ) {
 switch ( getTrimType() ) {
  case TRIM_TYPE_NONE:
   break;
  case TRIM_TYPE_RIGHT:
   string = Const.rtrim( string );
   break;
  case TRIM_TYPE_LEFT:
   string = Const.ltrim( string );
   break;
  case TRIM_TYPE_BOTH:
   string = Const.trim( string );
   break;
  default:
   break;
 }
 return string;
}

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

private void setEncodings( ComboVar var ) {
  // Encoding of the text file:
  String encoding = Const.NVL( var.getText(), Const.getEnvironmentVariable( "file.encoding", "UTF-8" ) );
  var.removeAll();
  ArrayList<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
  for ( int i = 0; i < values.size(); i++ ) {
   Charset charSet = values.get( i );
   var.add( charSet.displayName() );
  }

  // Now select the default!
  int idx = Const.indexOfString( encoding, var.getItems() );
  if ( idx >= 0 ) {
   var.select( idx );
  }
 }
}

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

protected void setComboBoxes() {
 // Something was changed in the row.
 //
 final Map<String, Integer> fields = new HashMap<String, Integer>();
 // Add the currentMeta fields...
 fields.putAll( inputFields );
 Set<String> keySet = fields.keySet();
 List<String> entries = new ArrayList<String>( keySet );
 String[] fieldNames = entries.toArray( new String[entries.size()] );
 Const.sortStrings( fieldNames );
 colinf[0].setComboValues( fieldNames );
}

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

@Override
 public void run() {
  try {
   cleanupJarFiles( jarFiles );
  } catch ( Exception e ) {
   System.err.println( "Error cleaning up temporary Talend jar file extracts: "
    + Const.getStackTracker( e ) );
  }
 }
} );

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

public static final int getFileType( String fileTypeCode ) {
 int t = Const.indexOfString( fileTypeCode, FixedInputMeta.fileTypeCode );
 if ( t >= 0 ) {
  return t;
 }
 t = Const.indexOfString( fileTypeCode, FixedInputMeta.fileTypeDesc );
 if ( t >= 0 ) {
  return t;
 }
 return FILE_TYPE_NONE;
}

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

public static final int getOperator( String description ) {
 if ( description == null ) {
  return OPERATOR_NONE;
 }
 for ( int i = 1; i < operators.length; i++ ) {
  if ( operators[i].equalsIgnoreCase( Const.trim( description ) ) ) {
   return i;
  }
 }
 return OPERATOR_NONE;
}

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

string = Const.trim( string );
wInputString.setText( string );
 wFormat.setItems( Const.getNumberFormats() );
 int index = ( !Utils.isEmpty( formatString ) ) ? wFormat.indexOf( formatString ) : wFormat.indexOf( "#" );
 wFormat.setItems( Const.getNumberFormats() );
 index = ( !Utils.isEmpty( formatString ) ) ? wFormat.indexOf( formatString ) : wFormat.indexOf( "#.#" );
 wFormat.setItems( Const.getDateFormats() );
 index =
  ( !Utils.isEmpty( formatString ) ) ? wFormat.indexOf( formatString ) : wFormat

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

private String[] getComboValues( TableItem row, ColumnInfo colinfo ) {
 if ( colinfo.getType() == ColumnInfo.COLUMN_TYPE_FORMAT ) {
  int type = ValueMetaFactory.getIdForValueMeta( row.getText( colinfo.getFieldTypeColumn() ) );
  switch ( type ) {
   case ValueMetaInterface.TYPE_DATE:
    return Const.getDateFormats();
   case ValueMetaInterface.TYPE_INTEGER:
   case ValueMetaInterface.TYPE_BIGNUMBER:
   case ValueMetaInterface.TYPE_NUMBER:
    return Const.getNumberFormats();
   case ValueMetaInterface.TYPE_STRING:
    return Const.getConversionFormats();
   default:
    return new String[0];
  }
 }
 return colinfo.getComboValues();
}

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

public StringEvaluator( boolean tryTrimming ) {
 this( tryTrimming, DEFAULT_NUMBER_FORMATS, Const.getDateFormats() );
}

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

protected void setComboBoxes() {
 // Something was changed in the row.
 //
 final Map<String, Integer> fields = new HashMap<String, Integer>();
 // Add the currentMeta fields...
 fields.putAll( inputFields );
 Set<String> keySet = fields.keySet();
 List<String> entries = new ArrayList<String>( keySet );
 String[] fieldNames = entries.toArray( new String[entries.size()] );
 Const.sortStrings( fieldNames );
 colinf[0].setComboValues( fieldNames );
}

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

public void showDocumentMap() {
 try {
  URL url = new URL( DOCUMENTATION_URL );
  HelpUtils.openHelpDialog( shell, STRING_DOCUMENT_TAB_NAME, url.toString() );
 } catch ( MalformedURLException e1 ) {
  log.logError( Const.getStackTracker( e1 ) );
 }
}

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

public String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) {
 String[] comboValues = new String[] {};
 int type = ValueMetaFactory.getIdForValueMeta( tableItem.getText( colNr - 1 ) );
 switch ( type ) {
  case ValueMetaInterface.TYPE_DATE:
   comboValues = Const.getDateFormats();
   break;
  case ValueMetaInterface.TYPE_INTEGER:
  case ValueMetaInterface.TYPE_BIGNUMBER:
  case ValueMetaInterface.TYPE_NUMBER:
   comboValues = Const.getNumberFormats();
   break;
  default:
   break;
 }
 return comboValues;
}

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

@Override
public boolean matches( String id ) {
 return Const.indexOfString( id, ids ) >= 0;
}

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

public static final int getFunction( String description ) {
 for ( int i = 1; i < functions.length; i++ ) {
  if ( functions[i].equalsIgnoreCase( Const.trim( description ) ) ) {
   return i;
  }
 }
 return FUNC_EQUAL;
}

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

public void guessTrimType() {
 boolean spaces_before = false;
 boolean spaces_after = false;
 for ( int i = 0; i < samples.length; i++ ) {
  spaces_before |= Const.nrSpacesBefore( samples[i] ) > 0;
  spaces_after |= Const.nrSpacesAfter( samples[i] ) > 0;
  samples[i] = Const.trim( samples[i] );
 }
 trimtype = ValueMetaInterface.TRIM_TYPE_NONE;
 if ( spaces_before ) {
  trimtype |= ValueMetaInterface.TRIM_TYPE_LEFT;
 }
 if ( spaces_after ) {
  trimtype |= ValueMetaInterface.TRIM_TYPE_RIGHT;
 }
}

相关文章