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

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

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

Const.getDateFormats介绍

[英]Returning the localized date conversion formats. They get created once on first request.
[中]返回本地化的日期转换格式。它们在第一次请求时创建一次。

代码示例

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

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

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

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

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

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 String[] getComboValues( TableItem tableItem, int rowNr, int colNr ) {
 String[] comboValues = new String[] { };
 int type = ValueMeta.getType( 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

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

boolean[][] dateFormat = new boolean[nrfields][Const.getDateFormats().length]; // What are the date formats that
Date[][] minDate = new Date[nrfields][Const.getDateFormats().length]; // min date value
Date[][] maxDate = new Date[nrfields][Const.getDateFormats().length]; // max date value
double[][] minValue = new double[nrfields][Const.getDateFormats().length]; // min number value
double[][] maxValue = new double[nrfields][Const.getDateFormats().length]; // max number value
int[][] numberPrecision = new int[nrfields][Const.getNumberFormats().length]; // remember the precision?
int[][] numberLength = new int[nrfields][Const.getNumberFormats().length]; // remember the length?
 for ( int j = 0; j < Const.getDateFormats().length; j++ ) {
  dateFormat[i][j] = true;
  minDate[i][j] = Const.MAX_DATE;
  maxDate[i][j] = Const.MIN_DATE;
 dateFormatCount[i] = Const.getDateFormats().length;
    for ( int x = 0; x < Const.getDateFormats().length; x++ ) {
     if ( dateFormat[i][x] ) {
      message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateFormat2", Const
        .getDateFormats()[x] ) );
      Date mindate = minDate[i][x];
      Date maxdate = maxDate[i][x];
      daf2.applyPattern( Const.getDateFormats()[x] );
      try {
       Date md = daf2.parse( minstr[i] );
       message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.DateExample", Const
         .getDateFormats()[x], minstr[i], md.toString() ) );

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

boolean[][] dateFormat = new boolean[nrfields][Const.getDateFormats().length]; // What are the date formats that
Date[][] minDate = new Date[nrfields][Const.getDateFormats().length]; // min date value
Date[][] maxDate = new Date[nrfields][Const.getDateFormats().length]; // max date value
double[][] minValue = new double[nrfields][Const.getDateFormats().length]; // min number value
double[][] maxValue = new double[nrfields][Const.getDateFormats().length]; // max number value
int[][] numberPrecision = new int[nrfields][Const.getNumberFormats().length]; // remember the precision?
int[][] numberLength = new int[nrfields][Const.getNumberFormats().length]; // remember the length?
 for ( int j = 0; j < Const.getDateFormats().length; j++ ) {
  dateFormat[i][j] = true;
  minDate[i][j] = Const.MAX_DATE;
  maxDate[i][j] = Const.MIN_DATE;
 dateFormatCount[i] = Const.getDateFormats().length;
    for ( int x = 0; x < Const.getDateFormats().length; x++ ) {
     if ( dateFormat[i][x] ) {
      message.append( BaseMessages.getString(
       PKG, "TextFileCSVImportProgressDialog.Info.DateFormat2", Const.getDateFormats()[x] ) );
      Date mindate = minDate[i][x];
      Date maxdate = maxDate[i][x];
      daf2.applyPattern( Const.getDateFormats()[x] );
      try {
       Date md = daf2.parse( minstr[i] );
       message.append( BaseMessages.getString(
        PKG, "TextFileCSVImportProgressDialog.Info.DateExample", Const.getDateFormats()[x],

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

new ColumnInfo(
  BaseMessages.getString( PKG, "SetValueConstantDialog.Value.ConversionMask" ),
  ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getDateFormats() );
colinf[3] =
 new ColumnInfo(

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

new ColumnInfo(
  BaseMessages.getString( PKG, "IfNullDialog.Value.ConversionMask" ), ColumnInfo.COLUMN_TYPE_CCOMBO,
  Const.getDateFormats() );
colinf[1].setUsingVariables( true );
colinf[3] =

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

wMask = new CCombo( wAllFields, SWT.BORDER | SWT.READ_ONLY );
wMask.setEditable( true );
wMask.setItems( Const.getDateFormats() );
props.setLook( wMask );
wMask.addModifyListener( lsMod );
 new ColumnInfo(
  BaseMessages.getString( PKG, "IfNullDialog.Value.ConversionMask" ), ColumnInfo.COLUMN_TYPE_CCOMBO,
  Const.getDateFormats() );
colval[3] =
 new ColumnInfo(

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

wFormat.setItems( Const.getDateFormats() );
index =
 ( !Utils.isEmpty( formatString ) ) ? wFormat.indexOf( formatString ) : wFormat

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

String[] dats = Const.getDateFormats();

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

new ColumnInfo(
 BaseMessages.getString( PKG, "DataGridDialog.Format.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO,
 Const.getDateFormats() ),
new ColumnInfo(
 BaseMessages.getString( PKG, "DataGridDialog.Length.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ),

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

String[] dats = Const.getDateFormats();
String[] nums = Const.getNumberFormats();
int totsize = dats.length + nums.length;

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

wlDatePattern.setLayoutData( fdlDatePattern );
wDatePattern = new ComboVar( transMeta, wLogSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER );
wDatePattern.setItems( Const.getDateFormats() );
props.setLook( wDatePattern );
fdDatePattern = new FormData();

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

wMask.setItems( Const.getDateFormats() );
wMask.setEditable( true );
props.setLook( wMask );

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

wlDatePattern.setLayoutData( fdlDatePattern );
wDatePattern = new ComboVar( jobMeta, wMessageGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER );
wDatePattern.setItems( Const.getDateFormats() );
props.setLook( wDatePattern );
fdDatePattern = new FormData();

相关文章