java.lang.String |
addDecoration(java.lang.String aString)
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, toTags, writeExternal, writeExternal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
size
public int size
- The size of the unformatted result.
byteOrdering
public int byteOrdering
- The sign decides the byte ordering.
lengthIncluded
public boolean lengthIncluded
- The property indicates whether the length is included in field length.
lengthRepresentation
public boolean lengthRepresentation
- The property indicates the representation form of the length.
SelfLength
public SelfLength()
- This is the default constructor used to create a SelfLength object.
SelfLength
public SelfLength(java.lang.String aName)
throws java.io.IOException
- This is the constructor used by the Externalizer to create a SelfLength
object.
- Parameters:
aName - java.lang.String
- Throws:
java.io.IOException
addDecoration
public java.lang.String addDecoration(java.lang.String aString)
throws DSEInvalidArgumentException
- Prepends the length of the formatted String as an unsigned integer to the
String. The length is determined by the size attribute.
- Specified by:
addDecoration in class FormatDecorator
- Parameters:
aString - java.lang.String
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
extract
public java.lang.String[] extract(java.lang.String aString)
throws DSEInvalidArgumentException
- 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.
- Overrides:
extract in class FormatDecorator
- Parameters:
aString - java.lang.String
- Returns:
- java.lang.String[]
- Throws:
DSEInvalidArgumentException
getByteOrdering
public int getByteOrdering()
- Returns the value of byteOrdering.
- Returns:
- int
getLengthIncluded
public boolean getLengthIncluded()
- Returns true if the length of the decorator is included in the length of
the String.
- Returns:
- boolean
getLengthRepresentation
public boolean getLengthRepresentation()
- Gets the value of the lengthRepresentation parameter. If this parameter
is true, the length appears as a String in the decorated String,
Otherwise the length appears as bytes.
- Returns:
- boolean
getSize
public int getSize()
- Returns the size of the String.
- Returns:
- int
initializeFrom
public java.lang.Object initializeFrom(Tag aTag)
- Initializes a SelfLength object with the aTag attributes.
- Specified by:
initializeFrom in class FormatElement
- Parameters:
aTag - com.ibm.btt.base.Tag
- Returns:
- java.lang.Object
removeDecoration
public java.lang.String removeDecoration(java.lang.String aString)
throws DSEInvalidArgumentException
- Removes the size chars from the input String. This method changes the
size attribute of the decorated String to the size indicated by the
decorator.
- Specified by:
removeDecoration in class FormatDecorator
- Parameters:
aString - java.lang.String
- Returns:
- java.lang.String
- Throws:
DSEInvalidArgumentException
setByteOrdering
public void setByteOrdering(int anInt)
- Sets the value of byteOrdering. The values of the parameter are:
- 0 ==> PC or littleEndian
- 1 ==> Host or bigEndian.
- Parameters:
anInt - int
setLengthIncluded
public void setLengthIncluded(boolean aBoolean)
- Sets the value of the lengthIncluded attribute. If set to true, the total
length of the decorated String includes a String or bytes giving the
length of the String.
- Parameters:
aBoolean - boolean
setLengthRepresentation
public void setLengthRepresentation(boolean aBoolean)
- Sets the value of the lengthRepresentation attribute. If set to true, the
total length of the decorated String includes a String giving the length
of the String. If set to false, the total length of the decorated String
includes bytes giving the length of the String.
- Parameters:
aBoolean - boolean
setSize
public void setSize(int anInt)
- Sets the size of the decorating string.
- Overrides:
setSize in class FormatElement
- Parameters:
anInt - int
toStrings
public Vector toStrings()
- Returns a visual representation of this decorator.
- Specified by:
toStrings in class FormatDecorator
- Returns:
- java.util.Vector
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
Context ctx)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformat strings that between ndxFrom and ndxTo into the Context.
- Overrides:
unformat in class FormatElement
- Parameters:
str - java.lang.StringndxFrom - intndxTo - intctx - com.ibm.btt.base.Context;
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
unformat
public int unformat(int ndxFrom,
int ndxTo,
java.lang.String str,
DataElement de)
throws DSEInvalidRequestException,
DSEInvalidArgumentException
- Unformat strings that between ndxFrom and ndxTo into the DataElement.
- Overrides:
unformat in class FormatElement
- Parameters:
str - java.lang.StringndxFrom - intndxTo - intde - com.ibm.btt.base.DataElement;
- Returns:
- int
- Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
(c) Copyright IBM Corporation 1998, 2009
|