IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class Compressor

java.lang.Object
  extended by com.ibm.btt.base.FormatElement
      extended by com.ibm.btt.base.FormatDecorator
          extended by com.ibm.btt.base.Compressor
All Implemented Interfaces:
Cacheable, java.io.Externalizable, java.io.Serializable

public class Compressor
extends FormatDecorator

This decorator compresses its decorated String in order to reduce the decorated string size.

See Also:
Serialized Form

Field Summary
protected  int bufferSize
           
static int DEFAULT_BUFFER_SIZE
           
static byte DEFAULT_COMPRESSION
           
 
Fields inherited from class com.ibm.btt.base.FormatDecorator
decorated
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name, xmlSupport
 
Constructor Summary
Compressor()
          This constructor creates a Compressor object.
Compressor(java.lang.String aName)
          This constructor creates a new instance of the Compressor class, which is obtained from the external definition files through aName.
 
Method Summary
 java.lang.String addDecoration(java.lang.String aString)
          Compresses the aString parameter and returns the compressed String.
protected  java.lang.String getBodyEncoding()
          This method is designed for the extension.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a Compressor with the aTag attributes.
 java.lang.String removeDecoration(java.lang.String aString)
          Returns the uncompressed String resulting from aString.
 java.lang.String removeDecoration(java.lang.String aString, int intArray)
          Returns the uncompressed String resulting from aString.
 Vector toStrings()
          Return a visual representation of the Compressor object.
 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
extract, 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, getAttributeValueForXMLFormat, 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

DEFAULT_COMPRESSION

public static final byte DEFAULT_COMPRESSION
See Also:
Constant Field Values

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values

bufferSize

protected int bufferSize
Constructor Detail

Compressor

public Compressor()
This constructor creates a Compressor object.


Compressor

public Compressor(java.lang.String aName)
           throws java.io.IOException
This constructor creates a new instance of the Compressor class, which is obtained from the external definition files through aName.

Parameters:
aName - java.lang.String
Throws:
java.io.IOException
Method Detail

addDecoration

public java.lang.String addDecoration(java.lang.String aString)
                               throws DSEInvalidArgumentException
Compresses the aString parameter and returns the compressed String. The compression is done like a ZIP compression, using the classes provided by the package java.util.zip. The result cannot be accessed by an external application using ZIP compression because the ZIP headers are not included into the compressed String.

Specified by:
addDecoration in class FormatDecorator
Throws:
DSEInvalidArgumentException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
Initializes a Compressor with the aTag attributes.

Specified by:
initializeFrom in class FormatElement
Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
Object

removeDecoration

public java.lang.String removeDecoration(java.lang.String aString)
                                  throws DSEInvalidArgumentException
Returns the uncompressed String resulting from aString.

Specified by:
removeDecoration in class FormatDecorator
Parameters:
aString - String
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException

toStrings

public Vector toStrings()
Return a visual representation of the Compressor object.

Specified by:
toStrings in class FormatDecorator
Returns:
java.lang.String

removeDecoration

public java.lang.String removeDecoration(java.lang.String aString,
                                         int intArray)
                                  throws DSEInvalidArgumentException
Returns the uncompressed String resulting from aString.

Parameters:
aString - java.lang.String
intArray - int
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException - - The exception description

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.String
ndxFrom - int
ndxTo - int
ctx - 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.String
ndxFrom - int
ndxTo - int
de - com.ibm.btt.base.DataElement;
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

getBodyEncoding

protected java.lang.String getBodyEncoding()
This method is designed for the extension. The sub class overrides this method to return the required encoding. The encoding setting is only used to body content.


IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011