Package com.ibm.di.entry
Class NameTokenizer
- java.lang.Object
-
- com.ibm.di.entry.NameTokenizer
-
- All Implemented Interfaces:
java.lang.Cloneable
public class NameTokenizer extends java.lang.Object implements java.lang.CloneableTokenizer used for reading TDI attribute names.
-
-
Constructor Summary
Constructors Constructor Description NameTokenizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NameTokenizerclone()intgetAfterEndIndex()Get the index of the after-end position.intgetBeforeStartIndex()Get the index of the before-start position.intgetCurrentPosition()Returns the current tokenizer position.intgetNextSeparatorPosition(char separator)Returns the position of the next separator.java.lang.StringgetNextToken(char separator)Returns the string from the current position to the next separator.intgetPreviousSeparatorPosition(char separator)Returns the position of the previous separator.java.lang.StringgetPreviousToken(char separator)Returns the string from the current position to the previous separator.java.util.ListIterator<java.lang.String>listIterator(char separator)Creates aListIteratorfor easier work with the Tokenizer..voidsetEscapeChar(char escapeChar)Changes the used escape character.voidsetName(java.lang.String name)Sets the attribute name to be parsed.voidsetName(java.lang.String name, boolean start)Sets the attribute name to be parsed.voidsetName(java.lang.String name, int position)Sets the attribute name to be parsed.
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Sets the attribute name to be parsed.- Parameters:
name- attribute name.
-
setName
public void setName(java.lang.String name, boolean start)Sets the attribute name to be parsed.- Parameters:
name- attribute name.start- whether the tokenizer should be position at the name start or at its end.
-
setName
public void setName(java.lang.String name, int position)Sets the attribute name to be parsed.- Parameters:
name- attribute name.position- starting position.
-
setEscapeChar
public void setEscapeChar(char escapeChar)
Changes the used escape character.- Parameters:
escapeChar- escape character.
-
getCurrentPosition
public int getCurrentPosition()
Returns the current tokenizer position.- Returns:
- position.
-
getNextSeparatorPosition
public int getNextSeparatorPosition(char separator)
Returns the position of the next separator.- Parameters:
separator- the separator.- Returns:
- the separator's position.
-
getNextToken
public java.lang.String getNextToken(char separator)
Returns the string from the current position to the next separator. All escaped separators in the resulting string will be replaced by the separator.- Parameters:
separator- the separator.- Returns:
- the resolved string from the current position to the next separator.
-
getPreviousSeparatorPosition
public int getPreviousSeparatorPosition(char separator)
Returns the position of the previous separator.- Parameters:
separator- the separator.- Returns:
- the separator's position.
-
getPreviousToken
public java.lang.String getPreviousToken(char separator)
Returns the string from the current position to the previous separator. All escaped separators in the resulting string will be replaced by the separator.- Parameters:
separator- the separator.- Returns:
- the resolved string from the current position to the previous separator.
-
getBeforeStartIndex
public final int getBeforeStartIndex()
Get the index of the before-start position.- Returns:
- the before-start position's index.
-
getAfterEndIndex
public final int getAfterEndIndex()
Get the index of the after-end position.- Returns:
- the after-end position's index.
-
listIterator
public java.util.ListIterator<java.lang.String> listIterator(char separator)
Creates aListIteratorfor easier work with the Tokenizer..- Parameters:
separator- the separator to be used by the Iterator.- Returns:
- the
ListIterator.
-
clone
protected NameTokenizer clone()
- Overrides:
clonein classjava.lang.Object
-
-