Java Code Examples for org.pentaho.di.core.util.Utils#normalizeArrays()

The following examples show how to use org.pentaho.di.core.util.Utils#normalizeArrays() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DimensionLookupMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrStream = ( keyStream == null ) ? -1 : keyStream.length;
  if ( nrStream > 0 ) {
    String[][] rtn = Utils.normalizeArrays( nrStream, keyLookup );
    keyLookup = rtn[ 0 ];
  }
  int nrFields = ( fieldStream == null ) ? -1 : fieldStream.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtnFieldLookup = Utils.normalizeArrays( nrFields, fieldLookup );
  fieldLookup = rtnFieldLookup[ 0 ];

  int[][] rtnFieldUpdate = Utils.normalizeArrays( nrFields, fieldUpdate );
  fieldUpdate = rtnFieldUpdate[ 0 ];
}
 
Example 2
Source File: UpdateMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( keyStream == null ) ? -1 : keyStream.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtn = Utils.normalizeArrays( nrFields, keyLookup, keyCondition, keyStream2 );
  keyLookup = rtn[ 0 ];
  keyCondition = rtn[ 1 ];
  keyStream2 = rtn[ 2 ];

  nrFields = updateLookup.length;
  rtn = Utils.normalizeArrays( nrFields, updateStream );
  updateStream = rtn[ 0 ];
}
 
Example 3
Source File: ReplaceStringMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldInStream == null ) ? -1 : fieldInStream.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtnStringArrays = Utils.normalizeArrays( nrFields, fieldOutStream, replaceString, replaceByString, replaceFieldByString );
  fieldOutStream = rtnStringArrays[ 0 ];
  replaceString = rtnStringArrays[ 1 ];
  replaceByString = rtnStringArrays[ 2 ];
  replaceFieldByString = rtnStringArrays[ 3 ];

  nullToEmpty( fieldOutStream );
  nullToEmpty( replaceString );
  nullToEmpty( replaceByString );
  nullToEmpty( replaceFieldByString );

  boolean[][] rtnBooleanArrays =
    Utils.normalizeArrays( nrFields, useRegEx, setEmptyString, wholeWord, caseSensitive, isUnicode );
  useRegEx = rtnBooleanArrays[ 0 ];
  setEmptyString = rtnBooleanArrays[ 1 ];
  wholeWord = rtnBooleanArrays[ 2 ];
  caseSensitive = rtnBooleanArrays[ 3 ];
  isUnicode = rtnBooleanArrays[ 4 ];
}
 
Example 4
Source File: SortRowsMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldName == null ) ? -1 : fieldName.length;
  if ( nrFields <= 0 ) {
    return;
  }
  boolean[][] rtnBooleanArrays = Utils.normalizeArrays( nrFields, ascending, caseSensitive, collatorEnabled, preSortedField );
  ascending = rtnBooleanArrays[ 0 ];
  caseSensitive = rtnBooleanArrays[ 1 ];
  collatorEnabled = rtnBooleanArrays[ 2 ];
  preSortedField = rtnBooleanArrays[ 3 ];

  int[][] rtnIntArrays = Utils.normalizeArrays( nrFields, collatorStrength );
  collatorStrength = rtnIntArrays[ 0 ];

}
 
Example 5
Source File: GPLoadMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldTable == null ) ? -1 : fieldTable.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtnStringArray = Utils.normalizeArrays( nrFields, fieldStream, dateMask );
  fieldStream = rtnStringArray[ 0 ];
  dateMask = rtnStringArray[ 1 ];

  boolean[][] rtnBoolArray = Utils.normalizeArrays( nrFields, matchColumn, updateColumn );
  matchColumn = rtnBoolArray[ 0 ];
  updateColumn = rtnBoolArray[ 1 ];

}
 
Example 6
Source File: GaInputStepMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( feedField == null ) ? -1 : feedField.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtnStringArray = Utils.normalizeArrays( nrFields, feedFieldType, outputField, conversionMask );
  feedFieldType = rtnStringArray[ 0 ];
  outputField = rtnStringArray[ 1 ];
  conversionMask = rtnStringArray[ 2 ];

  int[][] rtnIntArray = Utils.normalizeArrays( nrFields, outputType );
  outputType = rtnIntArray[ 0 ];

}
 
Example 7
Source File: FieldSplitterMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldName == null ? -1 : fieldName.length );
  if ( nrFields <= 0 ) {
    return;
  }

  String[][] normalizedStringArrays = Utils.normalizeArrays( nrFields, fieldID, fieldFormat, fieldGroup, fieldDecimal, fieldCurrency, fieldNullIf, fieldIfNull );
  fieldID = normalizedStringArrays[ 0 ];
  fieldFormat = normalizedStringArrays[ 1 ];
  fieldGroup = normalizedStringArrays[ 2 ];
  fieldDecimal = normalizedStringArrays[ 3 ];
  fieldCurrency = normalizedStringArrays[ 4 ];
  fieldNullIf = normalizedStringArrays[ 5 ];
  fieldIfNull = normalizedStringArrays[ 6 ];

  boolean[][] normalizedBooleanArrays = Utils.normalizeArrays( nrFields, fieldRemoveID );
  fieldRemoveID = normalizedBooleanArrays[ 0 ];

  int[][] normalizedIntArrays = Utils.normalizeArrays( nrFields, fieldType, fieldLength, fieldPrecision, fieldTrimType );
  fieldType = normalizedIntArrays[ 0 ];
  fieldLength = normalizedIntArrays[ 1 ];
  fieldPrecision = normalizedIntArrays[ 2 ];
  fieldTrimType = normalizedIntArrays[ 3 ];

}
 
Example 8
Source File: ValueMapperMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( sourceValue == null ) ? -1 : sourceValue.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtn = Utils.normalizeArrays( nrFields, targetValue );
  targetValue = rtn[ 0 ];
}
 
Example 9
Source File: MemoryGroupByMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( subjectField == null ? -1 : subjectField.length );
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] normalizedStringArrays = Utils.normalizeArrays( nrFields, aggregateField, valueField );
  aggregateField = normalizedStringArrays[ 0 ];
  valueField = normalizedStringArrays[ 1 ];

  int[][] normalizedIntArrays = Utils.normalizeArrays( nrFields, aggregateType );
  aggregateType = normalizedIntArrays[ 0 ];
}
 
Example 10
Source File: MySQLBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldTable == null ) ? -1 : fieldTable.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtnStrings = Utils.normalizeArrays( nrFields, fieldStream );
  fieldStream = rtnStrings[ 0 ];

  int[][] rtnInts = Utils.normalizeArrays( nrFields, fieldFormatType );
  fieldFormatType = rtnInts[ 0 ];
}
 
Example 11
Source File: SortedMergeMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( fieldName == null ) ? -1 : fieldName.length;
  if ( nrFields <= 0 ) {
    return;
  }
  boolean[][] rtn = Utils.normalizeArrays( nrFields, ascending );
  ascending = rtn[ 0 ];
}
 
Example 12
Source File: CombinationLookupMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths. We need synchronize them for consistency behavior with
 * UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( keyField == null ) ? -1 : keyField.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtn = Utils.normalizeArrays( nrFields, keyLookup );
  keyLookup = rtn[ 0 ];
}
 
Example 13
Source File: AnalyticQueryMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * If we use injection we can have different arrays lengths.
 * We need synchronize them for consistency behavior with UI
 */
@AfterInjection
public void afterInjectionSynchronization() {
  int nrFields = ( subjectField == null ) ? -1 : subjectField.length;
  if ( nrFields <= 0 ) {
    return;
  }
  String[][] rtn = Utils.normalizeArrays( nrFields, aggregateField );
  aggregateField = rtn[ 0 ];

  int[][] rtnInt = Utils.normalizeArrays( nrFields, aggregateType, valueField );
  aggregateType = rtnInt[ 0 ];
  valueField = rtnInt[ 1 ];
}