public ExcelInputData() { super(); workbook = null; filenr = 0; sheetnr = 0; rownr = -1; colnr = -1; valueMetaString = new ValueMetaString( "v" ); valueMetaNumber = new ValueMetaNumber( "v" ); valueMetaDate = new ValueMetaDate( "v" ); valueMetaBoolean = new ValueMetaBoolean( "v" ); } }
@Override public int string2intPrimitive( String v ) throws KettleValueException { return ValueMetaFactory.getIdForValueMeta( v ); } }
public static final String getUpdateTypeCode( boolean upd, int t ) { if ( !upd ) { return ValueMetaFactory.getValueMetaName( t ); } else { return typeCodes[t]; } }
public ValueMapperData() { super(); hashtable = null; stringMeta = new ValueMetaString( "string" ); }
public static int[] getTypeCodes( String[] typeNames ) { int[] typeCodes = new int[typeNames.length]; for ( int i = 0; i < typeNames.length; i++ ) { typeCodes[i] = ValueMetaBase.getType( typeNames[i] ); } return typeCodes; }
/** * Get an array of String describing the possible types a Value can have. * * @return an array of String describing the possible types a Value can have. */ public static final String[] getAllTypes() { return ValueMetaFactory.getAllValueMetaNames(); /* * String retval[] = new String[typeCodes.length]; System.arraycopy(typeCodes, 0, retval, 0, typeCodes.length); * return retval; */ }
/** * Checks whether or not this Value is Numeric A Value is numeric if it is either of type Number or Integer * * @return true if the value is either of type Number or Integer */ @Override public boolean isNumeric() { return isInteger() || isNumber() || isBigNumber(); }
@Override public Object getNativeDataType( Object object ) throws KettleValueException { switch ( getStorageType() ) { case STORAGE_TYPE_BINARY_STRING: return convertBinaryStringToNativeType( (byte[]) object ); case STORAGE_TYPE_INDEXED: return index[(Integer) object]; case STORAGE_TYPE_NORMAL: default: return object; } }
@Override public Date getDate( Object object ) throws KettleValueException { Timestamp timestamp = getTimestamp( object ); if ( timestamp == null ) { return null; } return timestamp; }
/** * @param encoding * the encoding to set */ @Override public void setStringEncoding( String encoding ) { this.stringEncoding = encoding; determineSingleByteEncoding(); compareStorageAndActualFormat(); }
@Override public Object convertNormalStorageTypeToBinaryString( Object object ) throws KettleValueException { if ( object == null ) { return null; } String string = getString( object ); return convertStringToBinaryString( string ); }
@Override public int string2intPrimitive( String v ) throws KettleValueException { return ValueMetaString.getTrimTypeByCode( v ); } }
/** * @param decimalSymbol * the decimalSymbol to set */ @Override public void setDecimalSymbol( String decimalSymbol ) { this.decimalSymbol = decimalSymbol; decimalFormatChanged = true; compareStorageAndActualFormat(); }
public static ValueMetaPluginType getInstance() { if ( valueMetaPluginType == null ) { valueMetaPluginType = new ValueMetaPluginType(); } return valueMetaPluginType; }
@Override protected String extractClassLoaderGroup( Annotation annotation ) { return ( (ValueMetaPlugin) annotation ).classLoaderGroup(); } }
@Override public String getFormatMask() { return getDateFormatMask(); } }
@Override public int string2intPrimitive( String v ) throws KettleValueException { return ValueMetaFactory.getIdForValueMeta( v ); } }
/** * TODO: change Desc to Code all over the place. Make sure we can localise this stuff later on. * * @param type * the type * @return the description (code) of the type */ public static final String getTypeDesc( int type ) { return ValueMetaFactory.getValueMetaName( type ); // return typeCodes[type]; }
/** * @param conversionMask * the conversionMask to set */ @Override public void setConversionMask( String conversionMask ) { this.conversionMask = conversionMask; dateFormatChanged = true; decimalFormatChanged = true; compareStorageAndActualFormat(); }
public static final String getUpdateType( boolean upd, int t ) { if ( !upd ) { return ValueMetaFactory.getValueMetaName( t ); } else { return typeDesc[t]; } }