method2testcases
stringlengths
118
6.63k
### Question: ValueMetaInternetAddress extends ValueMetaDate { @Override public byte[] getBinaryString( Object object ) throws KettleValueException { if ( isStorageBinaryString() && identicalFormat ) { return (byte[]) object; } if ( object == null ) { return null; } switch ( storageType ) { case STORAGE_TYPE_NORMAL: re...
### Question: ValueMetaFactory { public static ValueMetaInterface cloneValueMeta( ValueMetaInterface source ) throws KettlePluginException { return cloneValueMeta( source, source.getType() ); } static ValueMetaInterface createValueMeta( String name, int type, int length, int precision ); static ValueMetaInterface crea...
### Question: ValueMetaFactory { public static String[] getValueMetaNames() { List<String> strings = new ArrayList<String>(); List<PluginInterface> plugins = pluginRegistry.getPlugins( ValueMetaPluginType.class ); for ( PluginInterface plugin : plugins ) { int id = Integer.valueOf( plugin.getIds()[0] ); if ( id > 0 && ...
### Question: ValueMetaFactory { public static String[] getAllValueMetaNames() { List<String> strings = new ArrayList<String>(); List<PluginInterface> plugins = pluginRegistry.getPlugins( ValueMetaPluginType.class ); for ( PluginInterface plugin : plugins ) { String id = plugin.getIds()[0]; if ( !( "0".equals( id ) ) )...
### Question: ValueMetaFactory { public static String getValueMetaName( int type ) { for ( PluginInterface plugin : pluginRegistry.getPlugins( ValueMetaPluginType.class ) ) { if ( Integer.toString( type ).equals( plugin.getIds()[0] ) ) { return plugin.getName(); } } return "-"; } static ValueMetaInterface createValueM...
### Question: ValueMetaFactory { public static int getIdForValueMeta( String valueMetaName ) { for ( PluginInterface plugin : pluginRegistry.getPlugins( ValueMetaPluginType.class ) ) { if ( valueMetaName != null && valueMetaName.equalsIgnoreCase( plugin.getName() ) ) { return Integer.valueOf( plugin.getIds()[0] ); } } ...
### Question: ValueMetaFactory { public static List<ValueMetaInterface> getValueMetaPluginClasses() throws KettlePluginException { List<ValueMetaInterface> list = new ArrayList<ValueMetaInterface>(); List<PluginInterface> plugins = pluginRegistry.getPlugins( ValueMetaPluginType.class ); for ( PluginInterface plugin : p...
### Question: MessageEventService { public void fireEvent( final Message event ) throws MessageEventFireEventException { if ( event != null ) { if ( containsHandlerFor( event ) ) { final Collection<MessageEventHandler> handlers = getHandlersFor( event ); if ( handlers != null && handlers.size() > 0 ) { MessageEventFire...
### Question: ValueMetaFactory { public static ValueMetaInterface guessValueMetaInterface( Object object ) { if ( object instanceof Number ) { if ( object instanceof BigDecimal ) { return new ValueMetaBigNumber(); } else if ( object instanceof Double ) { return new ValueMetaNumber(); } else if ( object instanceof Long ...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public StringBuffer format( Date timestamp, StringBuffer toAppendTo, FieldPosition pos ) { if ( compatibleToSuperPattern ) { return super.format( timestamp, toAppendTo, pos ); } StringBuffer dateBuffer; String nan; if ( timestamp instanceof Timest...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public Date parse( String text, ParsePosition pos ) { String timestampFormatDate; Date tempDate; if ( compatibleToSuperPattern ) { tempDate = super.parse( text, pos ); return new Timestamp( tempDate.getTime() ); } StringBuilder dateText = new Stri...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public String toPattern() { return originalPattern; } SimpleTimestampFormat( String pattern ); SimpleTimestampFormat( String pattern, Locale locale ); SimpleTimestampFormat( String pattern, DateFormatSymbols formatSymbols ); @Override void setDa...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public String toLocalizedPattern() { if ( compatibleToSuperPattern ) { return super.toLocalizedPattern(); } else { StringBuffer pattern = new StringBuffer( super.toLocalizedPattern() ); int placeholderPosition = replaceHolder( pattern, true ); for...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public void applyPattern( String pattern ) { DateFormatSymbols formatSymbols = super.getDateFormatSymbols(); init( pattern, formatSymbols, false ); } SimpleTimestampFormat( String pattern ); SimpleTimestampFormat( String pattern, Locale locale );...
### Question: SimpleTimestampFormat extends SimpleDateFormat { @Override public void applyLocalizedPattern( String pattern ) { DateFormatSymbols formatSymbols = super.getDateFormatSymbols(); init( pattern, formatSymbols, true ); } SimpleTimestampFormat( String pattern ); SimpleTimestampFormat( String pattern, Locale l...
### Question: WriterOutputStream extends OutputStream { @Override public void write( int b ) throws IOException { write( new byte[] { (byte) b, } ); } WriterOutputStream( Writer writer ); WriterOutputStream( Writer writer, String encoding ); @Override void write( int b ); @Override void write( byte[] b, int off, int l...
### Question: PluginFolder implements PluginFolderInterface { @Override public FileObject[] findJarFiles() throws KettleFileException { return findJarFiles( searchLibDir ); } PluginFolder( String folder, boolean pluginXmlFolder, boolean pluginAnnotationsFolder ); PluginFolder( String folder, boolean pluginXmlFolder, b...
### Question: NamedParamsDefault implements NamedParams { @Override public void addParameterDefinition( String key, String defValue, String description ) throws DuplicateParamException { if ( params.get( key ) == null ) { OneNamedParam oneParam = new OneNamedParam(); oneParam.key = key; oneParam.defaultValue = defValue...
### Question: NamedParamsDefault implements NamedParams { @Override public void copyParametersFrom( NamedParams aParam ) { if ( params != null && aParam != null ) { params.clear(); String[] keys = aParam.listParameters(); for ( int idx = 0; idx < keys.length; idx++ ) { String desc; try { desc = aParam.getParameterDescr...
### Question: PDIClassLoader extends URLClassLoader { @Override protected synchronized Class<?> loadClass( String name, boolean resolve ) throws ClassNotFoundException { try { return super.loadClass( name, resolve ); } catch ( NoClassDefFoundError e ) { return super.findClass( name ); } } PDIClassLoader( URL[] url, Cla...
### Question: LongHashIndex { public Long get( long key ) throws KettleValueException { int hashCode = generateHashCode( key ); int indexPointer = indexFor( hashCode, index.length ); LongHashIndexEntry check = index[indexPointer]; while ( check != null ) { if ( check.hashCode == hashCode && check.equalsKey( key ) ) { r...
### Question: LongHashIndex { public boolean isEmpty() { return size == 0; } LongHashIndex( int size ); LongHashIndex(); int getSize(); boolean isEmpty(); Long get( long key ); void put( long key, Long value ); static int generateHashCode( Long key ); static int indexFor( int hash, int length ); }### Answer: @Test pu...
### Question: ByteArrayHashIndex { public int getSize() { return size; } ByteArrayHashIndex( RowMetaInterface keyRowMeta, int size ); ByteArrayHashIndex( RowMetaInterface keyRowMeta ); int getSize(); boolean isEmpty(); byte[] get( byte[] key ); void put( byte[] key, byte[] value ); static int generateHashCode( byte[] ...
### Question: Variables implements VariableSpace { @Override public void initializeVariablesFrom( VariableSpace parent ) { this.parent = parent; Set<String> systemPropertiesNames = System.getProperties().stringPropertyNames(); for ( String key : systemPropertiesNames ) { getProperties().put( key, System.getProperties()...
### Question: Variables implements VariableSpace { @Override public String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ) throws KettleValueException { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.substituteField( aString, rowMeta, rowData ); } Var...
### Question: DataHandler extends AbstractXulEventHandler { public void setDeckChildIndex() { getControls(); int originalSelection = ( dialogDeck == null ? -1 : dialogDeck.getSelectedIndex() ); boolean passed = true; if ( originalSelection == 3 ) { passed = checkPoolingParameters(); } if ( passed ) { int selected = dec...
### Question: Variables implements VariableSpace { @Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } Variables(); @Override void copyVariablesFrom( VariableSpace space );...
### Question: LifecycleException extends Exception { public boolean isSevere() { return severe; } LifecycleException( boolean severe ); LifecycleException( String message, boolean severe ); LifecycleException( Throwable cause, boolean severe ); LifecycleException( String message, Throwable cause, boolean severe ); b...
### Question: LifeEventInfo { public State getState() { return state; } void setHint( Hint hint ); String getMessage(); void setMessage( String message ); boolean hasHint( Hint h ); State getState(); void setState( State state ); String getName(); void setName( String name ); }### Answer: @Test public void testGetSta...
### Question: LifeEventInfo { public String getName() { return name; } void setHint( Hint hint ); String getMessage(); void setMessage( String message ); boolean hasHint( Hint h ); State getState(); void setState( State state ); String getName(); void setName( String name ); }### Answer: @Test public void testGetName...
### Question: ResultFile implements Cloneable { public RowMetaAndData getRow() { RowMetaAndData row = new RowMetaAndData(); row.addValue( new ValueMetaString( "type" ), getTypeDesc() ); row.addValue( new ValueMetaString( "filename" ), file.getName().getBaseName() ); row.addValue( new ValueMetaString( "path" ), file.get...
### Question: SlaveConnectionManager { public static SlaveConnectionManager getInstance() { if ( slaveConnectionManager == null ) { slaveConnectionManager = new SlaveConnectionManager(); } return slaveConnectionManager; } private SlaveConnectionManager(); static SlaveConnectionManager getInstance(); HttpClient createH...
### Question: HttpUtil { public static String decodeBase64ZippedString( String loggingString64 ) throws IOException { if ( loggingString64 == null || loggingString64.isEmpty() ) { return ""; } StringWriter writer = new StringWriter(); byte[] bytes64 = Base64.decodeBase64( loggingString64.getBytes() ); ByteArrayInputStr...
### Question: HttpUtil { public static String constructUrl( VariableSpace space, String hostname, String port, String webAppName, String serviceAndArguments ) throws UnsupportedEncodingException { return constructUrl( space, hostname, port, webAppName, serviceAndArguments, false ); } static String constructUrl( Variab...
### Question: ZipFileMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { readData( stepnode ); } ZipFileMeta(); String getDynamicSourceFileNameField(); void setDynamicSourceFileNameField( String sou...
### Question: DataHandler extends AbstractXulEventHandler { public void onPoolingCheck() { if ( poolingCheck != null ) { boolean dis = !poolingCheck.isChecked(); if ( poolSizeBox != null ) { poolSizeBox.setDisabled( dis ); } if ( maxPoolSizeBox != null ) { maxPoolSizeBox.setDisabled( dis ); } if ( poolSizeLabel != null...
### Question: ZipFileMeta extends BaseStepMeta implements StepMetaInterface { public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans ) { return new ZipFile( stepMeta, stepDataInterface, cnr, transMeta, trans ); } ZipFileMeta(); String getDynamicSo...
### Question: TextFileOutput extends BaseStep implements StepInterface { protected boolean closeFile() { boolean retval = false; try { if ( data.writer != null ) { data.writer.flush(); if ( data.cmdProc != null ) { if ( log.isDebug() ) { logDebug( "Closing output stream" ); } data.writer.close(); if ( log.isDebug() ) {...
### Question: TextFileOutput extends BaseStep implements StepInterface { public void writeRowToFile( RowMetaInterface rowMeta, Object[] r ) throws KettleStepException { try { if ( meta.getOutputFields() == null || meta.getOutputFields().length == 0 ) { for ( int i = 0; i < rowMeta.size(); i++ ) { if ( i > 0 && data.bin...
### Question: Rest extends BaseStep implements StepInterface { MultivaluedMapImpl createMultivalueMap( String paramName, String paramValue ) { MultivaluedMapImpl queryParams = new MultivaluedMapImpl(); queryParams.add( paramName, UriComponent.encode( paramValue, UriComponent.Type.QUERY_PARAM ) ); return queryParams; } ...
### Question: JoinRows extends BaseStep implements StepInterface { public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (JoinRowsMeta) smi; data = (JoinRowsData) sdi; if ( data.file != null ) { for ( int i = 1; i < data.file.length; i++ ) { if ( data.file[i] != null ) { data.file[i].delete(); } ...
### Question: JoinRows extends BaseStep implements StepInterface { public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { meta = (JoinRowsMeta) smi; data = (JoinRowsData) sdi; if ( first ) { first = false; initialize(); } if ( data.caching ) { if ( !cacheInputRow() ) { return...
### Question: DataHandler extends AbstractXulEventHandler { public void onClusterCheck() { if ( clusteringCheck != null ) { boolean dis = !clusteringCheck.isChecked(); if ( clusterParameterTree != null ) { clusterParameterTree.setDisabled( dis ); } if ( clusterParameterDescriptionLabel != null ) { clusterParameterDescr...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public void setSelectName( String[] selectName ) { resizeSelectFields( selectName.length ); for ( int i = 0; i < selectFields.length; i++ ) { selectFields[i].setName( selectName[i] ); } } SelectValuesMeta(); String[] getDeleteName(); voi...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public String[] getSelectName() { String[] selectName = new String[selectFields.length]; for ( int i = 0; i < selectName.length; i++ ) { selectName[i] = selectFields[i].getName(); } return selectName; } SelectValuesMeta(); String[] getDe...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public void setSelectRename( String[] selectRename ) { if ( selectRename.length > selectFields.length ) { resizeSelectFields( selectRename.length ); } for ( int i = 0; i < selectFields.length; i++ ) { if ( i < selectRename.length ) { sel...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public String[] getSelectRename() { String[] selectRename = new String[selectFields.length]; for ( int i = 0; i < selectRename.length; i++ ) { selectRename[i] = selectFields[i].getRename(); } return selectRename; } SelectValuesMeta(); St...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public void setSelectLength( int[] selectLength ) { if ( selectLength.length > selectFields.length ) { resizeSelectFields( selectLength.length ); } for ( int i = 0; i < selectFields.length; i++ ) { if ( i < selectLength.length ) { select...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public int[] getSelectLength() { int[] selectLength = new int[selectFields.length]; for ( int i = 0; i < selectLength.length; i++ ) { selectLength[i] = selectFields[i].getLength(); } return selectLength; } SelectValuesMeta(); String[] ge...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public void setSelectPrecision( int[] selectPrecision ) { if ( selectPrecision.length > selectFields.length ) { resizeSelectFields( selectPrecision.length ); } for ( int i = 0; i < selectFields.length; i++ ) { if ( i < selectPrecision.le...
### Question: SelectValuesMeta extends BaseStepMeta implements StepMetaInterface { public int[] getSelectPrecision() { int[] selectPrecision = new int[selectFields.length]; for ( int i = 0; i < selectPrecision.length; i++ ) { selectPrecision[i] = selectFields[i].getPrecision(); } return selectPrecision; } SelectValuesM...
### Question: DataHandler extends AbstractXulEventHandler { public void onCancel() { close(); } DataHandler(); void loadConnectionData(); void loadAccessData(); void editOptions( int index ); void clearOptionsData(); void getOptionHelp(); void setDeckChildIndex(); void onPoolingCheck(); void onClusterCheck(); Object ge...
### Question: SFTPPut extends BaseStep implements StepInterface { @VisibleForTesting void checkRemoteFilenameField( String remoteFilenameFieldName, SFTPPutData data ) throws KettleStepException { remoteFilenameFieldName = environmentSubstitute( remoteFilenameFieldName ); if ( !Utils.isEmpty( remoteFilenameFieldName ) )...
### Question: SFTPPut extends BaseStep implements StepInterface { @VisibleForTesting void checkSourceFileField( String sourceFilenameFieldName, SFTPPutData data ) throws KettleStepException { sourceFilenameFieldName = environmentSubstitute( sourceFilenameFieldName ); if ( Utils.isEmpty( sourceFilenameFieldName ) ) { th...
### Question: SFTPPut extends BaseStep implements StepInterface { @VisibleForTesting void checkRemoteFoldernameField( String remoteFoldernameFieldName, SFTPPutData data ) throws KettleStepException { remoteFoldernameFieldName = environmentSubstitute( remoteFoldernameFieldName ); if ( Utils.isEmpty( remoteFoldernameFiel...
### Question: DataHandler extends AbstractXulEventHandler { public void onOK() { DatabaseMeta database = new DatabaseMeta(); this.getInfo( database ); boolean passed = checkPoolingParameters(); if ( !passed ) { return; } String[] remarks = database.checkParameters(); String message = ""; if ( remarks.length != 0 ) { fo...
### Question: SFTPPut extends BaseStep implements StepInterface { @VisibleForTesting void checkDestinationFolderField( String realDestinationFoldernameFieldName, SFTPPutData data ) throws KettleStepException { realDestinationFoldernameFieldName = environmentSubstitute( realDestinationFoldernameFieldName ); if ( Utils.i...
### Question: SystemDataMeta extends BaseStepMeta implements StepMetaInterface { @Override public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { readData( stepnode ); } SystemDataMeta(); String[] getFieldName(); void setFieldName( String[] fieldName ); Syst...
### Question: SystemDataMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " <fields>" + Const.CR ); for ( int i = 0; i < fieldName.length; i++ ) { retval.append( " <field>" + Const.CR ); retval.append( " " + XMLHandler....
### Question: SystemData extends BaseStep implements StepInterface { public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { Object[] row; if ( data.readsRows ) { row = getRow(); if ( row == null ) { setOutputDone(); return false; } if ( first ) { first = false; data.outputRow...
### Question: MissingTransStep extends DummyTrans { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { if ( super.init( smi, sdi ) ) { logError( BaseMessages.getString( PKG, "MissingTransStep.Log.CannotRunTrans" ) ); } return false; } MissingTransStep( StepMeta stepMeta, StepDataInterface stepDataInt...
### Question: DataHandler extends AbstractXulEventHandler { public void restoreDefaults() { if ( poolParameterTree != null ) { for ( int i = 0; i < poolParameterTree.getRootChildren().getItemCount(); i++ ) { XulTreeItem item = poolParameterTree.getRootChildren().getItem( i ); String parameterName = item.getRow().getCel...
### Question: CalculatorData extends BaseStepData implements StepDataInterface { public ValueMetaInterface getValueMetaFor( int resultType, String name ) throws KettlePluginException { ValueMetaInterface meta = resultMetaMapping.get( resultType ); if ( meta == null ) { meta = ValueMetaFactory.createValueMeta( name, res...
### Question: CalculatorMeta extends BaseStepMeta implements StepMetaInterface { @Override public StepDataInterface getStepData() { return new CalculatorData(); } CalculatorMetaFunction[] getCalculation(); void setCalculation( CalculatorMetaFunction[] calcTypes ); void allocate( int nrCalcs ); @Override void loadXML( ...
### Question: CalculatorMeta extends BaseStepMeta implements StepMetaInterface { @Override public void setDefault() { calculation = new CalculatorMetaFunction[0]; } CalculatorMetaFunction[] getCalculation(); void setCalculation( CalculatorMetaFunction[] calcTypes ); void allocate( int nrCalcs ); @Override void loadXML...
### Question: StepDefinition implements Cloneable { public Object clone() throws CloneNotSupportedException { StepDefinition retval; retval = (StepDefinition) super.clone(); if ( stepMeta != null ) { retval.stepMeta = (StepMeta) stepMeta.clone(); } return retval; } StepDefinition(); StepDefinition( String tag, String ...
### Question: PrioritizeStreams extends BaseStep implements StepInterface { public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { meta = (PrioritizeStreamsMeta) smi; data = (PrioritizeStreamsData) sdi; if ( first ) { if ( meta.getStepName() != null || meta.getStepName().leng...
### Question: DataHandler extends AbstractXulEventHandler { public void poolingRowChange( int idx ) { if ( idx != -1 ) { if ( idx >= BaseDatabaseMeta.poolingParameters.length ) { idx = BaseDatabaseMeta.poolingParameters.length - 1; } if ( idx < 0 ) { idx = 0; } poolingDescription.setValue( BaseDatabaseMeta.poolingParam...
### Question: Script extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (ScriptMeta) smi; data = (ScriptData) sdi; if ( super.init( smi, sdi ) ) { jsScripts = meta.getJSScripts(); for ( int j = 0; j < jsScripts.length; j++ ) { switch ( jsScripts[ j ]...
### Question: FilterRowsMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { FilterRowsMeta retval = (FilterRowsMeta) super.clone(); retval.setTrueStepname( getTrueStepname() ); retval.setFalseStepname( getFalseStepname() ); if ( condition != null ) { retval.condition = (Condition) condition...
### Question: DatabaseConnectionDialog { public XulDomContainer getSwtInstance( Shell shell ) throws XulException { SwtXulLoader loader = new SwtXulLoader(); return getSwtInstance( loader, shell ); } DatabaseConnectionDialog(); void registerClass( String key, String className ); XulDomContainer getSwtInstance( Shell sh...
### Question: TableOutputMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public boolean supportsErrorHandling() { if ( databaseMeta != null ) { return databaseMeta.getDatabaseInterface().supportsErrorHandling(); } else { return true; } } TableOutputMeta(); String getGeneratedKeyField(); vo...
### Question: TableOutput extends BaseStep implements StepInterface { void truncateTable() throws KettleDatabaseException { if ( !meta.isPartitioningEnabled() && !meta.isTableNameInField() ) { if ( meta.truncateTable() && ( ( getCopy() == 0 && getUniqueStepNrAcrossSlaves() == 0 ) || !Utils.isEmpty( getPartitionID() ) )...
### Question: SplitFieldToRows extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (SplitFieldToRowsMeta) smi; data = (SplitFieldToRowsData) sdi; if ( super.init( smi, sdi ) ) { data.rownr = 1L; try { String delimiter = Const.nullToEmpty( meta.getDeli...
### Question: DataHandler extends AbstractXulEventHandler { public void disablePortIfInstancePopulated() { String serverInstance = serverInstanceBox.getValue(); if ( serverInstance != null && serverInstance.length() > 0 ) { portNumberBox.setDisabled( true ); } else { portNumberBox.setDisabled( false ); } } DataHandler(...
### Question: MonetDbVersion implements Comparable<MonetDbVersion> { @Override public int compareTo( MonetDbVersion mDbVersion ) { int result = majorVersion.compareTo( mDbVersion.majorVersion ); if ( result != 0 ) { return result; } result = minorVersion.compareTo( mDbVersion.minorVersion ); if ( result != 0 ) { return...
### Question: BlockUntilStepsFinishMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { BlockUntilStepsFinishMeta retval = (BlockUntilStepsFinishMeta) super.clone(); int nrfields = stepName.length; retval.allocate( nrfields ); System.arraycopy( stepName, 0, retval.stepName, 0, nrfields ); Sy...
### Question: MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public String getXML() { StringBuilder retval = new StringBuilder(); String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY; retval.append( " " ).append( XMLHandler.addTagValue( "join_type"...
### Question: MultiMergeJoinMeta extends BaseStepMeta implements StepMetaInterface { @Override public Object clone() { MultiMergeJoinMeta retval = (MultiMergeJoinMeta) super.clone(); int nrKeys = keyFields == null ? 0 : keyFields.length; int nrSteps = inputSteps == null ? 0 : inputSteps.length; retval.allocateKeys( nrK...
### Question: ConcatFields extends TextFileOutput implements StepInterface { Object[] prepareOutputRow( Object[] r ) { Object[] outputRowData = null; if ( !meta.isRemoveSelectedFields() ) { outputRowData = RowDataUtil.resizeArray( r, data.outputRowMeta.size() ); } else { outputRowData = new Object[data.outputRowMeta.si...
### Question: DataHandler extends AbstractXulEventHandler { protected void showMessage( String message, boolean scroll ) { try { XulMessageBox box = (XulMessageBox) document.createElement( "messagebox" ); box.setMessage( message ); box.setModalParent( ( (XulRoot) document.getElementById( "general-datasource-window" ) )...
### Question: ExcelWriterStep extends BaseStep implements StepInterface { protected void protectSheet( Sheet sheet, String password ) { if ( sheet instanceof HSSFSheet ) { sheet.protectSheet( password ); } } ExcelWriterStep( StepMeta s, StepDataInterface stepDataInterface, int c, TransMeta t, Trans dis ); @Override boo...
### Question: LdapProtocolFactory { public LdapProtocol createLdapProtocol( VariableSpace variableSpace, LdapMeta meta, Collection<String> binaryAttributes ) throws KettleException { String connectionType = variableSpace.environmentSubstitute( meta.getProtocol() ); synchronized ( protocols ) { for ( Class<? extends Lda...
### Question: LDAPInput extends BaseStep implements StepInterface { public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { meta = (LDAPInputMeta) smi; data = (LDAPInputData) sdi; if ( super.init( smi, sdi ) ) { data.rownr = 1L; data.multi_valuedFieldSeparator = environmentSubstitute( meta.getMultiValuedS...
### Question: CsvInputData extends BaseStepData implements StepDataInterface { byte[] removeEscapedEnclosures( byte[] field, int nrEnclosuresFound ) { byte[] result = new byte[field.length - nrEnclosuresFound]; int resultIndex = 0; for ( int i = 0; i < field.length; i++ ) { result[resultIndex++] = field[i]; if ( field[...
### Question: NamedFieldsMapping implements FieldsMapping { @Override public int fieldMetaIndex( int index ) { if ( index >= size() || index < 0 ) { return FIELD_DOES_NOT_EXIST; } return actualToMetaFieldMapping[index]; } NamedFieldsMapping( int[] actualToMetaFieldMapping ); @Override int fieldMetaIndex( int index ); @...
### Question: DataHandler extends AbstractXulEventHandler { public void handleUseSecurityCheckbox() { if ( useIntegratedSecurityCheck != null ) { if ( useIntegratedSecurityCheck.isChecked() ) { userNameBox.setDisabled( true ); passwordBox.setDisabled( true ); } else { userNameBox.setDisabled( false ); passwordBox.setDi...
### Question: NamedFieldsMapping implements FieldsMapping { @Override public int size() { return actualToMetaFieldMapping.length; } NamedFieldsMapping( int[] actualToMetaFieldMapping ); @Override int fieldMetaIndex( int index ); @Override int size(); static NamedFieldsMapping mapping( String[] actualFieldNames, String[...
### Question: NamedFieldsMapping implements FieldsMapping { public static NamedFieldsMapping mapping( String[] actualFieldNames, String[] metaFieldNames ) { LinkedHashMap<String, List<Integer>> metaNameToIndex = new LinkedHashMap<>(); List<Integer> unmatchedMetaFields = new ArrayList<>(); int[] actualToMetaFieldMapping...
### Question: UnnamedFieldsMapping implements FieldsMapping { @Override public int fieldMetaIndex( int index ) { return ( index >= fieldsCount || index < 0 ) ? FieldsMapping.FIELD_DOES_NOT_EXIST : index; } UnnamedFieldsMapping( int fieldsCount ); @Override int fieldMetaIndex( int index ); @Override int size(); static U...
### Question: UnnamedFieldsMapping implements FieldsMapping { @Override public int size() { return fieldsCount; } UnnamedFieldsMapping( int fieldsCount ); @Override int fieldMetaIndex( int index ); @Override int size(); static UnnamedFieldsMapping mapping( int fieldsCount ); }### Answer: @Test public void size() { ass...
### Question: UnnamedFieldsMapping implements FieldsMapping { public static UnnamedFieldsMapping mapping( int fieldsCount ) { return new UnnamedFieldsMapping( fieldsCount ); } UnnamedFieldsMapping( int fieldsCount ); @Override int fieldMetaIndex( int index ); @Override int size(); static UnnamedFieldsMapping mapping( i...
### Question: CreditCardVerifier { public static boolean isNumber( String n ) { try { Double.valueOf( n ).doubleValue(); return true; } catch ( NumberFormatException e ) { return false; } } static String getCardName( int id ); static String getNotValidCardNames( int id ); static ReturnIndicator CheckCC( String CardNum...
### Question: CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public boolean supportsErrorHandling() { return true; } CreditCardValidatorMeta(); String getDynamicField(); void setDynamicField( String fieldname ); String getResultFieldName(); void setOnlyDigits( boolean onlydigits ); boolean ...
### Question: CreditCardValidatorMeta extends BaseStepMeta implements StepMetaInterface { public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { String realresultfieldn...
### Question: TransExecutorParameters implements Cloneable { @Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.array...
### Question: FragmentHandler extends AbstractXulEventHandler { protected void loadDatabaseOptionsFragment( String fragmentUri ) throws XulException { XulComponent groupElement = document.getElementById( "database-options-box" ); XulComponent parentElement = groupElement.getParent(); XulDomContainer fragmentContainer; ...
### Question: LoadFileInputMeta extends BaseStepMeta implements StepMetaInterface { public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException { readData( stepnode ); } LoadFileInputMeta(); String getShortFileNameField(); void setShortFileNameField( String field )...
### Question: SyslogMessage extends BaseStep implements StepInterface { public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { meta = (SyslogMessageMeta) smi; data = (SyslogMessageData) sdi; if ( data.syslog != null ) { data.syslog.shutdown(); } super.dispose( smi, sdi ); } SyslogMessage( StepMeta stepMe...
### Question: MergeJoinMeta extends BaseStepMeta implements StepMetaInterface { public Object clone() { MergeJoinMeta retval = (MergeJoinMeta) super.clone(); int nrKeys1 = keyFields1.length; int nrKeys2 = keyFields2.length; retval.allocate( nrKeys1, nrKeys2 ); System.arraycopy( keyFields1, 0, retval.keyFields1, 0, nrKe...