public class SimpleStepExample extends SimpleStepAdapter
ISimpleStep
semantics.
This is an example implementation of
ISimpleStep
, through extension of the
SimpleStepAdapter
, that adds a value
to an input field and places the result in the new field; sample_added
.
This example has two parameters. The parameters are used to identify the field in which to add and the value to add to the field value.
Note: The plugin examples are included in the Data Management Platform Java™ Plugin jar and as such have a package name that represents that location. Therefore, modifying the examples requires placing the modified source, including the package statement, in a new Java™ compilation unit.
mInputFields, mOutputFields, mParameterNames, mParameterValues, mRowCount, mTimings, mValues
Constructor and Description |
---|
SimpleStepExample()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
processRow()
Process a row of data.
|
void |
validateInputs()
Validate input field information.
|
getOutputFieldCount, getOutputFieldInformation, getOutputFieldValue, getParameterCount, getParameterName, postExec, preExec, release, setInputFieldCount, setInputFieldInformation, setInputFieldValue, setParameterValue
public SimpleStepExample()
This example requires two parameters. To enable parameter processing by the
SimpleStepAdapter
the constructor must
create/populate mParameterNames
and mParameterValues
.
public void processRow() throws StepException
ISimpleStep
Called after all of the fields of an input row have been passed in. Process the row and make output fields available. Throw an exception to signal an error.
processRow
in interface ISimpleStep
processRow
in class SimpleStepAdapter
StepException
- If an error occurs during row processing.public void validateInputs() throws StepException
ISimpleStep
Called after all parameters are set and all input field information from the parent has been specified.
validateInputs
in interface ISimpleStep
validateInputs
in class SimpleStepAdapter
StepException
- If the inputs are not valid.Copyright © 2012 SAS Institute Inc. All Rights Reserved.