private boolean isNullValueAllowed( int valueMetaType ) { //Check if retro compatibility is set or not, to guaranty compatibility with older versions. //In 6.1 null values were written with string "null". Since then the attribute is not written. String val = getVariable( Const.KETTLE_COMPATIBILITY_XML_OUTPUT_NULL_VALUES, "N" ); return ValueMetaBase.convertStringToBoolean( Const.NVL( val, "N" ) ) && valueMetaType == ValueMetaInterface.TYPE_STRING; }
public ValueMetaBase( String name, int type, int length, int precision, Comparator<Object> comparator ) { this.name = name; this.type = type; this.length = length; this.precision = precision; this.storageType = STORAGE_TYPE_NORMAL; this.sortedDescending = false; this.outputPaddingEnabled = false; this.decimalSymbol = "" + Const.DEFAULT_DECIMAL_SEPARATOR; this.groupingSymbol = "" + Const.DEFAULT_GROUPING_SEPARATOR; this.dateFormatLocale = Locale.getDefault(); this.collatorDisabled = true; this.collatorLocale = Locale.getDefault(); this.collator = Collator.getInstance( this.collatorLocale ); this.collatorStrength = 0; this.dateFormatTimeZone = TimeZone.getDefault(); this.identicalFormat = true; this.bigNumberFormatting = true; this.lenientStringToNumber = convertStringToBoolean( Const.NVL( System.getProperty( Const.KETTLE_LENIENT_STRING_TO_NUMBER_CONVERSION, "N" ), "N" ) ); this.ignoreTimezone = convertStringToBoolean( Const.NVL( System.getProperty( Const.KETTLE_COMPATIBILITY_DB_IGNORE_TIMEZONE, "N" ), "N" ) ); this.comparator = comparator; determineSingleByteEncoding(); setDefaultConversionMask(); }
@Override public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) { if ( !Utils.isEmpty( variableName ) ) { String value = environmentSubstitute( variableName ); if ( !Utils.isEmpty( value ) ) { return ValueMetaBase.convertStringToBoolean( value ); } } return defaultValue; }
@Override public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) { if ( !Utils.isEmpty( variableName ) ) { String value = environmentSubstitute( variableName ); if ( !Utils.isEmpty( value ) ) { return ValueMetaBase.convertStringToBoolean( value ); } } return defaultValue; }
@Override public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) { if ( !Utils.isEmpty( variableName ) ) { String value = environmentSubstitute( variableName ); if ( !Utils.isEmpty( value ) ) { return ValueMetaBase.convertStringToBoolean( value ); } } return defaultValue; }
/** * For legacy transformations containing AWS S3 access credentials, {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} can force Spoon to use * the Amazon Default Credentials Provider Chain instead of using the credentials embedded in the transformation metadata. * * @return true if {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} is true or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not specified */ public boolean getUseAwsDefaultCredentials() { if ( ValueMetaBase.convertStringToBoolean( Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS ), "N" ) ) ) { return true; } else if ( StringUtil.isEmpty( awsAccessKey ) && StringUtil.isEmpty( awsSecretKey ) ) { return true; } return false; }
Object emptyValue = isStringValue ? Const.NULL_STRING : null; Boolean isEmptyAndNullDiffer = convertStringToBoolean( Const.NVL( System.getProperty( Const.KETTLE_EMPTY_STRING_DIFFERS_FROM_NULL, "N" ), "N" ) );
private boolean processFirstRow() throws KettleStepException { String val = getVariable( Const.KETTLE_AGGREGATION_ALL_NULLS_ARE_ZERO, "N" ); this.allNullsAreZero = ValueMetaBase.convertStringToBoolean( val ); val = getVariable( Const.KETTLE_AGGREGATION_MIN_NULL_IS_VALUED, "N" ); this.minNullIsValued = ValueMetaBase.convertStringToBoolean( val ); data.inputRowMeta = getInputRowMeta(); data.outputRowMeta = data.inputRowMeta.clone();
switch ( storageType ) { case STORAGE_TYPE_NORMAL: return convertStringToBoolean( trim( (String) object ) ); case STORAGE_TYPE_BINARY_STRING: return convertStringToBoolean( trim( (String) convertBinaryStringToNativeType( (byte[]) object ) ) ); case STORAGE_TYPE_INDEXED: return convertStringToBoolean( trim( (String) index[( (Integer) object ).intValue()] ) ); default: throw new KettleValueException( toString() + " : Unknown storage type " + storageType + " specified." );
allNullsAreZero = ValueMetaBase.convertStringToBoolean( val ); val = getVariable( Const.KETTLE_AGGREGATION_MIN_NULL_IS_VALUED, "N" ); minNullIsValued = ValueMetaBase.convertStringToBoolean( val );
allNullsAreZero = ValueMetaBase.convertStringToBoolean( val ); val = getVariable( Const.KETTLE_AGGREGATION_MIN_NULL_IS_VALUED, "N" ); minNullIsValued = ValueMetaBase.convertStringToBoolean( val ); compatibilityMode = ValueMetaBase.convertStringToBoolean( getVariable( Const.KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE, "N" ) );
VariableSpace space, Repository repository, IMetaStore metaStore ) { boolean compatibilityMode = ValueMetaBase.convertStringToBoolean( space.getVariable( Const.KETTLE_COMPATIBILITY_MEMORY_GROUP_BY_SUM_AVERAGE_RETURN_NUMBER_TYPE, "N" ) );
boolean metaTypeChangeUsesNewTypeDefaults = false; // Normal behavior as of 5.x or so if ( space != null ) { metaTypeChangeUsesNewTypeDefaults = ValueMetaBase.convertStringToBoolean( space.getVariable( Const.KETTLE_COMPATIBILITY_SELECT_VALUES_TYPE_CHANGE_USES_TYPE_DEFAULTS, "N" ) );
public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) { if ( !Utils.isEmpty( variableName ) ) { String value = environmentSubstitute( variableName ); if ( !Utils.isEmpty( value ) ) { return ValueMetaBase.convertStringToBoolean( value ); } } return defaultValue; }
public boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ) { if ( !Utils.isEmpty( variableName ) ) { String value = environmentSubstitute( variableName ); if ( !Utils.isEmpty( value ) ) { return ValueMetaBase.convertStringToBoolean( value ); } } return defaultValue; }
private void readData( Node stepnode, IMetaStore metastore ) throws KettleXMLException { try { String passFileds = XMLHandler.getTagValue( stepnode, "passing_through_fields" ) == null ? "false" : XMLHandler.getTagValue( stepnode, "passing_through_fields" ); passingThruFields = ValueMetaBase.convertStringToBoolean( passFileds ); schemaLocation = XMLHandler.getTagValue( stepnode, "schemaLocation" ); schemaLocationType = XMLHandler.getTagValue( stepnode, "schemaLocationType" ) == null ? LocationDescriptor.FILE_NAME.ordinal() : Integer.parseInt( XMLHandler.getTagValue( stepnode, "schemaLocationType" ) ); isCacheSchemas = ValueMetaBase.convertStringToBoolean( XMLHandler.getTagValue( stepnode, "isCacheSchemas" ) == null ? "false" : XMLHandler.getTagValue( stepnode, "isCacheSchemas" ) ); allowNullForMissingFields = ValueMetaBase.convertStringToBoolean( XMLHandler.getTagValue( stepnode, "allowNullForMissingFields" ) == null ? "false" : XMLHandler.getTagValue( stepnode, "allowNullForMissingFields" ) );
: XMLHandler.getTagValue( stepnode, "ignore_empty_folder" ); allocateFiles( nrfiles ); inputFiles.passingThruFields = ValueMetaBase.convertStringToBoolean( passThroughFields ); ignoreEmptyFolder = ValueMetaBase.convertStringToBoolean( skipIfNoFile ); for ( int i = 0; i < nrfiles; i++ ) { Node envnode = XMLHandler.getSubNodeByNr( filenode, "environment", i );
: XMLHandler.getTagValue( stepnode, "passing_through_fields" ); allocateFiles( nrfiles ); inputFiles.passingThruFields = ValueMetaBase.convertStringToBoolean( passThroughFields ); for ( int i = 0; i < nrfiles; i++ ) { Node envnode = XMLHandler.getSubNodeByNr( filenode, "environment", i );