|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.FormatElement
com.ibm.btt.base.FormatDecorator
com.ibm.btt.base.FixedLength
@ATTR(value={"length#Integer#IMPLIED","justify#String#IMPLIED","padChar#String#IMPLIED","noEmpty#Boolean#IMPLIED"}) public class FixedLength
This class ensures that a String has a specified length. To do this, it may truncate long Strings or add characters to theString until it has the length determined by the length attribute.
Field Summary | |
---|---|
int |
justify
The justification to be applied to the string. |
int |
length
The length of the string after the decoration is applied. |
java.lang.String |
noEmpty
A boolean that indicates whether to return the pad character when the resulting string is empty after applying the decorator. |
char |
padCharacter
The character to use to pad the string so that it has the specified length. |
Fields inherited from class com.ibm.btt.base.FormatDecorator |
---|
decorated |
Fields inherited from class com.ibm.btt.base.FormatElement |
---|
dataElementName, externalizer, name |
Constructor Summary | |
---|---|
FixedLength()
This is the default constructor used to create a FixedLength object. |
|
FixedLength(java.lang.String aName)
This is the constructor used by the Externalizer to create a FixedLength object. |
Method Summary | |
---|---|
java.lang.String |
addDecoration(java.lang.String aString)
Adjusts the length of the String to the length specified by the length attribute. |
java.lang.String[] |
extract(java.lang.String aString)
Extracts (strips) the substring corresponding to the format element from the input String and returns it and the remaining String as the elements of an array. |
int |
getJustify()
Returns the value of justify. |
int |
getLength()
Returns the value of the length attribute. |
java.lang.String |
getNoEmpty()
Returns the value of noEmpty. |
char |
getPadCharacter()
Returns the value of padCharacter. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a FixedLength object using the supplied Tag. |
java.lang.String |
removeDecoration(java.lang.String aString)
Removes the padding characters from the input String. |
void |
setJustify(int anInteger)
Sets the value of justify. |
void |
setLength(int anInteger)
Sets the value of length. |
void |
setNoEmpty(java.lang.String aString)
Sets the value of noEmpty. |
void |
setPadCharacter(char aCharacter)
Sets the value of padCharacter. |
Vector |
toStrings()
Returns a Vector containing a visual representation of the fixed length decorator. |
int |
unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
Context ctx)
Unformat strings that between ndxFrom and ndxTo into the Context. |
int |
unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
Unformat strings that between ndxFrom and ndxTo into the DataElement. |
Methods inherited from class com.ibm.btt.base.FormatDecorator |
---|
format, format, getDataElementName, getDecorated, getName, isConstant, isItConstant, reinitialize, rootDecorated, rootDecorator, setDecorated, toString, unformat, unformat |
Methods inherited from class com.ibm.btt.base.FormatElement |
---|
checkIndexes, exceptionInfo, externalizer, getExternalizer, getTagName, isCacheable, isNull, readExternal, readExternal, readObject, removeExternal, setDataElementName, setExternalizer, setName, setSize, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int length
public int justify
public char padCharacter
public java.lang.String noEmpty
Constructor Detail |
---|
public FixedLength()
public FixedLength(java.lang.String aName) throws java.io.IOException
aName
- java.lang.String
java.io.IOException
Method Detail |
---|
public java.lang.String addDecoration(java.lang.String aString)
addDecoration
in class FormatDecorator
aString
- String
public java.lang.String[] extract(java.lang.String aString) throws DSEInvalidArgumentException
extract
in class FormatDecorator
aString
- String
DSEInvalidArgumentException
public int getJustify()
public int getLength()
public java.lang.String getNoEmpty()
public char getPadCharacter()
public java.lang.Object initializeFrom(Tag aTag)
initializeFrom
in class FormatElement
aTag
- com.ibm.btt.base.Tag
public java.lang.String removeDecoration(java.lang.String aString) throws DSEInvalidArgumentException
removeDecoration
in class FormatDecorator
aString
- String
DSEInvalidArgumentException
public void setJustify(int anInteger)
anInteger
- java.lang.Integerpublic void setLength(int anInteger)
anInteger
- java.lang.Integerpublic void setNoEmpty(java.lang.String aString)
aString
- java.lang.Stringpublic void setPadCharacter(char aCharacter)
aCharacter
- java.lang.Characterpublic Vector toStrings()
toStrings
in class FormatDecorator
public int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement de) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformat
in class FormatElement
str
- java.lang.StringndxFrom
- intndxTo
- intde
- com.ibm.btt.base.DataElement;
DSEInvalidRequestException
DSEInvalidArgumentException
public int unformat(int ndxFrom, int ndxTo, java.lang.String str, Context ctx) throws DSEInvalidRequestException, DSEInvalidArgumentException
unformat
in class FormatElement
str
- java.lang.StringndxFrom
- intndxTo
- intctx
- com.ibm.btt.base.Context;
DSEInvalidRequestException
DSEInvalidArgumentException
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |