org.pentaho.di.trans.steps.stringoperations
Class StringOperationsMeta

java.lang.Object
  extended by org.pentaho.di.trans.step.BaseStepMeta
      extended by org.pentaho.di.trans.steps.stringoperations.StringOperationsMeta
All Implemented Interfaces:
Cloneable, StepAttributesInterface, StepMetaInterface

public class StringOperationsMeta
extends BaseStepMeta
implements StepMetaInterface

This class takes care of the meta data for the StringOperations step.

Since:
02 April 2009
Author:
Samatar Hassan

Field Summary
static int DIGITS_NONE
           
static int DIGITS_ONLY
           
static int DIGITS_REMOVE
           
static String[] digitsCode
           
static String[] digitsDesc
           
static int INIT_CAP_NO
           
static int INIT_CAP_YES
           
static String[] initCapCode
           
static String[] initCapDesc
           
static int LOWER_UPPER_LOWER
           
static int LOWER_UPPER_NONE
           
static int LOWER_UPPER_UPPER
           
static String[] lowerUpperCode
          The lower upper codes
static String[] lowerUpperDesc
          The lower upper description
static int MASK_CDATA
           
static int MASK_ESCAPE_HTML
           
static int MASK_ESCAPE_SQL
           
static int MASK_ESCAPE_XML
           
static int MASK_NONE
           
static int MASK_UNESCAPE_HTML
           
static int MASK_UNESCAPE_XML
           
static String[] maskXMLCode
           
static String[] maskXMLDesc
           
static int PADDING_LEFT
           
static int PADDING_NONE
           
static int PADDING_RIGHT
           
static String[] paddingCode
           
static String[] paddingDesc
          The padding description
static int REMOVE_SPECIAL_CHARACTERS_CR
           
static int REMOVE_SPECIAL_CHARACTERS_CRLF
           
static int REMOVE_SPECIAL_CHARACTERS_ESPACE
           
static int REMOVE_SPECIAL_CHARACTERS_LF
           
static int REMOVE_SPECIAL_CHARACTERS_NONE
           
static int REMOVE_SPECIAL_CHARACTERS_TAB
           
static String[] removeSpecialCharactersCode
           
static String[] removeSpecialCharactersDesc
           
static int TRIM_BOTH
           
static int TRIM_LEFT
           
static int TRIM_NONE
           
static int TRIM_RIGHT
           
static String[] trimTypeCode
          The trim type codes
static String[] trimTypeDesc
          The trim description
 
Fields inherited from class org.pentaho.di.trans.step.BaseStepMeta
loggingObject, STEP_ATTRIBUTES_FILE
 
Constructor Summary
StringOperationsMeta()
           
 
Method Summary
 void allocate(int nrkeys)
           
 void check(List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepinfo, RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info)
          Checks the settings of this step and puts the findings in a remarks List.
 Object clone()
          Make an exact copy of this step, make sure to explicitly copy Collections etc.
 int[] getDigits()
           
static int getDigitsByDesc(String tt)
           
static String getDigitsDesc(int i)
           
 String[] getFieldInStream()
           
 String[] getFieldOutStream()
           
 void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
          Gets the fields.
 int[] getInitCap()
           
static int getInitCapByDesc(String tt)
           
static String getInitCapDesc(int i)
           
 int[] getLowerUpper()
           
static int getLowerUpperByDesc(String tt)
           
static String getLowerUpperDesc(int i)
           
 int[] getMaskXML()
           
static int getMaskXMLByDesc(String tt)
           
static String getMaskXMLDesc(int i)
           
 String[] getPadChar()
           
static int getPaddingByDesc(String tt)
           
static String getPaddingDesc(int i)
           
 int[] getPaddingType()
           
 String[] getPadLen()
           
 int[] getRemoveSpecialCharacters()
           
static int getRemoveSpecialCharactersByDesc(String tt)
           
static String getRemoveSpecialCharactersDesc(int i)
           
 StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta transMeta, Trans trans)
          Get the executing step, needed by Trans to launch a step.
 StepDataInterface getStepData()
          Get a new instance of the appropriate data class.
 int[] getTrimType()
           
static int getTrimTypeByDesc(String tt)
           
static String getTrimTypeDesc(int i)
           
 String getXML()
          Produces the XML string that describes this step's information.
 void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String,Counter> counters)
          Load the values for this step from an XML Node
 void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String,Counter> counters)
          Read the steps information from a Kettle repository
 void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
          Save the steps data into a Kettle repository
 void setDefault()
          Set default values
 void setFieldInStream(String[] keyStream)
           
 void setFieldOutStream(String[] keyStream)
           
 void setLowerUpper(int[] lowerUpper)
           
 void setTrimType(int[] trimType)
           
 boolean supportsErrorHandling()
           
 
Methods inherited from class org.pentaho.di.trans.step.BaseStepMeta
analyseImpact, cancelQueries, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, findAttribute, findParent, getDescription, getDialogClassName, getLog, getLogChannelId, getName, getObjectCopy, getObjectId, getObjectRevision, getObjectType, getOptionalStreams, getParent, getParentStepMeta, getRepCode, getRepositoryDirectory, getRequiredFields, getRequiredFields, getResourceDependencies, getSQLStatements, getStepInjectionMetadataEntries, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getTooltip, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, getXmlCode, handleStreamSelection, hasChanged, hasRepositoryReferences, isBasic, isDebug, isDetailed, isRowLevel, logBasic, logBasic, logDebug, logDebug, logDetailed, logDetailed, logError, logError, logError, logMinimal, logMinimal, logRowlevel, logRowlevel, lookupRepositoryReferences, resetStepIoMeta, searchInfoAndTargetSteps, setChanged, setChanged, setParentStepMeta
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.di.trans.step.StepMetaInterface
analyseImpact, cancelQueries, excludeFromCopyDistributeVerification, excludeFromRowLayoutVerification, exportResources, getDialogClassName, getOptionalStreams, getParentStepMeta, getRequiredFields, getResourceDependencies, getSQLStatements, getStepIOMeta, getStepMetaInjectionInterface, getSupportedTransformationTypes, getTableFields, getUsedArguments, getUsedDatabaseConnections, getUsedLibraries, handleStreamSelection, hasRepositoryReferences, lookupRepositoryReferences, resetStepIoMeta, searchInfoAndTargetSteps, setParentStepMeta
 

Field Detail

trimTypeCode

public static final String[] trimTypeCode
The trim type codes


TRIM_NONE

public static final int TRIM_NONE
See Also:
Constant Field Values

TRIM_LEFT

public static final int TRIM_LEFT
See Also:
Constant Field Values

TRIM_RIGHT

public static final int TRIM_RIGHT
See Also:
Constant Field Values

TRIM_BOTH

public static final int TRIM_BOTH
See Also:
Constant Field Values

trimTypeDesc

public static final String[] trimTypeDesc
The trim description


lowerUpperCode

public static final String[] lowerUpperCode
The lower upper codes


LOWER_UPPER_NONE

public static final int LOWER_UPPER_NONE
See Also:
Constant Field Values

LOWER_UPPER_LOWER

public static final int LOWER_UPPER_LOWER
See Also:
Constant Field Values

LOWER_UPPER_UPPER

public static final int LOWER_UPPER_UPPER
See Also:
Constant Field Values

lowerUpperDesc

public static final String[] lowerUpperDesc
The lower upper description


initCapDesc

public static final String[] initCapDesc

initCapCode

public static final String[] initCapCode

INIT_CAP_NO

public static final int INIT_CAP_NO
See Also:
Constant Field Values

INIT_CAP_YES

public static final int INIT_CAP_YES
See Also:
Constant Field Values

digitsCode

public static final String[] digitsCode

DIGITS_NONE

public static final int DIGITS_NONE
See Also:
Constant Field Values

DIGITS_ONLY

public static final int DIGITS_ONLY
See Also:
Constant Field Values

DIGITS_REMOVE

public static final int DIGITS_REMOVE
See Also:
Constant Field Values

digitsDesc

public static final String[] digitsDesc

maskXMLDesc

public static final String[] maskXMLDesc

maskXMLCode

public static final String[] maskXMLCode

MASK_NONE

public static final int MASK_NONE
See Also:
Constant Field Values

MASK_ESCAPE_XML

public static final int MASK_ESCAPE_XML
See Also:
Constant Field Values

MASK_CDATA

public static final int MASK_CDATA
See Also:
Constant Field Values

MASK_UNESCAPE_XML

public static final int MASK_UNESCAPE_XML
See Also:
Constant Field Values

MASK_ESCAPE_SQL

public static final int MASK_ESCAPE_SQL
See Also:
Constant Field Values

MASK_ESCAPE_HTML

public static final int MASK_ESCAPE_HTML
See Also:
Constant Field Values

MASK_UNESCAPE_HTML

public static final int MASK_UNESCAPE_HTML
See Also:
Constant Field Values

removeSpecialCharactersCode

public static final String[] removeSpecialCharactersCode

REMOVE_SPECIAL_CHARACTERS_NONE

public static final int REMOVE_SPECIAL_CHARACTERS_NONE
See Also:
Constant Field Values

REMOVE_SPECIAL_CHARACTERS_CR

public static final int REMOVE_SPECIAL_CHARACTERS_CR
See Also:
Constant Field Values

REMOVE_SPECIAL_CHARACTERS_LF

public static final int REMOVE_SPECIAL_CHARACTERS_LF
See Also:
Constant Field Values

REMOVE_SPECIAL_CHARACTERS_CRLF

public static final int REMOVE_SPECIAL_CHARACTERS_CRLF
See Also:
Constant Field Values

REMOVE_SPECIAL_CHARACTERS_TAB

public static final int REMOVE_SPECIAL_CHARACTERS_TAB
See Also:
Constant Field Values

REMOVE_SPECIAL_CHARACTERS_ESPACE

public static final int REMOVE_SPECIAL_CHARACTERS_ESPACE
See Also:
Constant Field Values

removeSpecialCharactersDesc

public static final String[] removeSpecialCharactersDesc

paddingDesc

public static final String[] paddingDesc
The padding description


paddingCode

public static final String[] paddingCode

PADDING_NONE

public static final int PADDING_NONE
See Also:
Constant Field Values

PADDING_LEFT

public static final int PADDING_LEFT
See Also:
Constant Field Values

PADDING_RIGHT

public static final int PADDING_RIGHT
See Also:
Constant Field Values
Constructor Detail

StringOperationsMeta

public StringOperationsMeta()
Method Detail

getFieldInStream

public String[] getFieldInStream()
Returns:
Returns the fieldInStream.

setFieldInStream

public void setFieldInStream(String[] keyStream)
Parameters:
fieldInStream - The fieldInStream to set.

getFieldOutStream

public String[] getFieldOutStream()
Returns:
Returns the fieldOutStream.

setFieldOutStream

public void setFieldOutStream(String[] keyStream)
Parameters:
keyStream - The fieldOutStream to set.

getPadLen

public String[] getPadLen()

getPadChar

public String[] getPadChar()

getTrimType

public int[] getTrimType()

setTrimType

public void setTrimType(int[] trimType)

getLowerUpper

public int[] getLowerUpper()

setLowerUpper

public void setLowerUpper(int[] lowerUpper)

getInitCap

public int[] getInitCap()

getMaskXML

public int[] getMaskXML()

getDigits

public int[] getDigits()

getRemoveSpecialCharacters

public int[] getRemoveSpecialCharacters()

getPaddingType

public int[] getPaddingType()

loadXML

public void loadXML(Node stepnode,
                    List<DatabaseMeta> databases,
                    Map<String,Counter> counters)
             throws KettleXMLException
Description copied from interface: StepMetaInterface
Load the values for this step from an XML Node

Specified by:
loadXML in interface StepMetaInterface
Parameters:
stepnode - the Node to get the info from
databases - The available list of databases to reference to
counters - Counters to reference.
Throws:
KettleXMLException - When an unexpected XML error occurred. (malformed etc.)

allocate

public void allocate(int nrkeys)

clone

public Object clone()
Description copied from interface: StepMetaInterface
Make an exact copy of this step, make sure to explicitly copy Collections etc.

Specified by:
clone in interface StepMetaInterface
Overrides:
clone in class BaseStepMeta
Returns:
an exact copy of this step

setDefault

public void setDefault()
Description copied from interface: StepMetaInterface
Set default values

Specified by:
setDefault in interface StepMetaInterface

getXML

public String getXML()
Description copied from class: BaseStepMeta
Produces the XML string that describes this step's information.

Specified by:
getXML in interface StepMetaInterface
Overrides:
getXML in class BaseStepMeta
Returns:
String containing the XML describing this step.

readRep

public void readRep(Repository rep,
                    ObjectId id_step,
                    List<DatabaseMeta> databases,
                    Map<String,Counter> counters)
             throws KettleException
Description copied from interface: StepMetaInterface
Read the steps information from a Kettle repository

Specified by:
readRep in interface StepMetaInterface
Parameters:
rep - The repository to read from
id_step - The step ID
databases - The databases to reference
counters - The counters to reference
Throws:
KettleException - When an unexpected error occurred (database, network, etc)

saveRep

public void saveRep(Repository rep,
                    ObjectId id_transformation,
                    ObjectId id_step)
             throws KettleException
Description copied from interface: StepMetaInterface
Save the steps data into a Kettle repository

Specified by:
saveRep in interface StepMetaInterface
Parameters:
rep - The Kettle repository to save to
id_transformation - The transformation ID
id_step - The step ID
Throws:
KettleException - When an unexpected error occurred (database, network, etc)

getFields

public void getFields(RowMetaInterface inputRowMeta,
                      String name,
                      RowMetaInterface[] info,
                      StepMeta nextStep,
                      VariableSpace space)
               throws KettleStepException
Description copied from class: BaseStepMeta
Gets the fields.

Specified by:
getFields in interface StepMetaInterface
Overrides:
getFields in class BaseStepMeta
Parameters:
inputRowMeta - the input row meta
name - the name
info - the info
nextStep - the next step
space - the space
Throws:
KettleStepException - the kettle step exception

check

public void check(List<CheckResultInterface> remarks,
                  TransMeta transMeta,
                  StepMeta stepinfo,
                  RowMetaInterface prev,
                  String[] input,
                  String[] output,
                  RowMetaInterface info)
Description copied from interface: StepMetaInterface
Checks the settings of this step and puts the findings in a remarks List.

Specified by:
check in interface StepMetaInterface
Parameters:
remarks - The list to put the remarks in @see org.pentaho.di.core.CheckResult
stepinfo - The stepMeta to help checking
prev - The fields coming from the previous step
input - The input step names
output - The output step names
info - The fields that are used as information by the step

getStep

public StepInterface getStep(StepMeta stepMeta,
                             StepDataInterface stepDataInterface,
                             int cnr,
                             TransMeta transMeta,
                             Trans trans)
Description copied from interface: StepMetaInterface
Get the executing step, needed by Trans to launch a step.

Specified by:
getStep in interface StepMetaInterface
Parameters:
stepMeta - The step info
stepDataInterface - the step data interface linked to this step. Here the step can store temporary data, database connections, etc.
cnr - The copy nr to get
transMeta - The transformation info
trans - The launching transformation

getStepData

public StepDataInterface getStepData()
Description copied from interface: StepMetaInterface
Get a new instance of the appropriate data class. This data class implements the StepDataInterface. It basically contains the persisting data that needs to live on, even if a worker thread is terminated.

Specified by:
getStepData in interface StepMetaInterface
Returns:
The appropriate StepDataInterface class.

supportsErrorHandling

public boolean supportsErrorHandling()
Specified by:
supportsErrorHandling in interface StepMetaInterface
Overrides:
supportsErrorHandling in class BaseStepMeta
Returns:
true if this step supports error "reporting" on rows: the ability to send rows to a certain target step.

getTrimTypeDesc

public static String getTrimTypeDesc(int i)

getLowerUpperDesc

public static String getLowerUpperDesc(int i)

getInitCapDesc

public static String getInitCapDesc(int i)

getMaskXMLDesc

public static String getMaskXMLDesc(int i)

getDigitsDesc

public static String getDigitsDesc(int i)

getRemoveSpecialCharactersDesc

public static String getRemoveSpecialCharactersDesc(int i)

getPaddingDesc

public static String getPaddingDesc(int i)

getTrimTypeByDesc

public static int getTrimTypeByDesc(String tt)

getLowerUpperByDesc

public static int getLowerUpperByDesc(String tt)

getInitCapByDesc

public static int getInitCapByDesc(String tt)

getMaskXMLByDesc

public static int getMaskXMLByDesc(String tt)

getDigitsByDesc

public static int getDigitsByDesc(String tt)

getRemoveSpecialCharactersByDesc

public static int getRemoveSpecialCharactersByDesc(String tt)

getPaddingByDesc

public static int getPaddingByDesc(String tt)