com.ibm.eNetwork.beans.HOD.cpc
Class Converter

java.lang.Object
  |
  +--com.ibm.eNetwork.beans.HOD.HODBean
        |
        +--com.ibm.eNetwork.beans.HOD.cpc.Converter
All Implemented Interfaces:
java.lang.Cloneable, ConvertListener, java.util.EventListener, java.io.Externalizable, com.ibm.eNetwork.HOD.common.HODConstants, java.beans.PropertyChangeListener, java.io.Serializable, TraceProducer

public class Converter
extends HODBean
implements ConvertListener

The Converter bean performs a codepage-to-codepage conversion. For the Arabic and Hebrew languages, Converter performs certain BIDI-specific transformations, including the logical-to-visual transform...or vice-versa, and Lam-Alef processing (Arabic only).

Converter implements the ConvertListener Interface in order to receive ConvertEvent events.

The Converter bean receives a ConvertEvent event which contains information about a file requiring conversion: the parameters are the conversion output file , input and output codepages and BIDI specific conversion attributes (when applicable). The ConvertEvent contains a field of class ActInfo. This ActInfo member contains all the above mentioned parameters specifying the conversion.

When the codepage conversion is finished, the Converter bean emits an ActionEvent to indicate that it is in the "ready" state.

The Converter does not use the standard JVM converters. Instead it uses HOD-supplied converters. Here is the list of supported codepages:

There are two ways for a caller to set up conversion parameters:

See Also:
ActInfo, Serialized Form

Field Summary
static java.lang.String OS2
          Used to specify the input or output host type as an OS/2 platform.
static java.lang.String OS390
          Used to specify the input or output host type as an OS/390 platform.
static java.lang.String OS400
          Used to specify the input or output host type as an OS/400 platform.
static java.lang.String UNIX
          Used to specify the input or output host type as a Unix platform.
static java.lang.String WIN
          Used to specify the input or output host type as a Dos/Windows platform.
 
Fields inherited from class com.ibm.eNetwork.beans.HOD.HODBean
BEAN_VERSION_STRING, TRACE_LEVEL, TRACE_MAXIMUM, TRACE_MINIMUM, TRACE_NONE, TRACE_NORMAL
 
Fields inherited from interface com.ibm.eNetwork.HOD.common.HODConstants
DEFAULT_WIN_FONT, HOD_ICON_EVENT, HOD_MSG_FILE, HOD_RAS_COMPID_ASSOC_PRT, HOD_RAS_COMPID_BLINKREMAP, HOD_RAS_COMPID_CODEPAGE, HOD_RAS_COMPID_COLORREMAP, HOD_RAS_COMPID_CONFIG, HOD_RAS_COMPID_FILETRANSFER, HOD_RAS_COMPID_FTP_SCREEN, HOD_RAS_COMPID_FTP_SESSION, HOD_RAS_COMPID_FTP_TERMINAL, HOD_RAS_COMPID_FUDOMA, HOD_RAS_COMPID_IMPEXP, HOD_RAS_COMPID_JNILOAD, HOD_RAS_COMPID_KEYPAD, HOD_RAS_COMPID_KEYREMAP, HOD_RAS_COMPID_MACRO, HOD_RAS_COMPID_MACROMANGR, HOD_RAS_COMPID_PRT_TERMINAL, HOD_RAS_COMPID_SCREEN, HOD_RAS_COMPID_SESSION, HOD_RAS_COMPID_SESSION_MGR, HOD_RAS_COMPID_SLP, HOD_RAS_COMPID_TERMINAL, HOD_RAS_FUNC_NAME, HOD_START_UP, HOD_TRANSFER_FILE_INFO, MOUSE_DOUBLE_CLICK_THRESHOLD, XFER_ASCII_GET_OPTIONS, XFER_ASCII_GET_OPTIONS_DEFAULT, XFER_ASCII_PUT_OPTIONS, XFER_ASCII_PUT_OPTIONS_DEFAULT, XFER_BINARY_GET_OPTIONS, XFER_BINARY_GET_OPTIONS_DEFAULT, XFER_BINARY_PUT_OPTIONS, XFER_BINARY_PUT_OPTIONS_DEFAULT, XFER_DEFAULT_OPTIONS, XFER_FILETYPE_DTA, XFER_FILETYPE_SAVF, XFER_FILETYPE_SRC, XFER_HOST_TYPE, XFER_HOST_TYPE_CICS, XFER_HOST_TYPE_CMS, XFER_HOST_TYPE_DEFAULT, XFER_HOST_TYPE_OS400, XFER_HOST_TYPE_TSO, XFER_PACKET_SIZE, XFER_PACKET_SIZE_DEFAULT, XFER_TIME_OUT_VALUE, XFER_TIME_OUT_VALUE_DEFAULT, XFER_TRANSFER_MODE, XFER_TRANSFER_MODE_ASCII, XFER_TRANSFER_MODE_BINARY, XFER_TRANSFER_MODE_DEFAULT
 
Constructor Summary
Converter()
          The default public constructor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds interested ActionEvent listeners wanting to be informed when a file conversion is complete.
 void dispose()
          Cleans up memory.
 void execute(ActInfo a)
          This method sets the bean properties and sets off the conversion.
 void execute(ConvertEvent e)
          This method implements ConvertListener interface.
 java.lang.String getInputCodepage()
          Returns the inputCodepage property value.
 java.lang.String getInputFileName()
          Returns the inputFileName property value.
 java.lang.String getInputHostType()
          Returns the inputHostType property value.
 java.lang.String getInputTextOrientation()
          Returns the inputTextOrientation property value.
 java.lang.String getInputTextType()
          Returns the inputTextType property value.
 java.lang.String getLanguage()
          Returns the cpcLanguage property value.
 java.lang.String getNumeralShaping()
          Returns the numeralShaping property value.
 java.lang.String getOutputCodepage()
          Returns the outputCodepage property value.
 java.lang.String getOutputFileName()
          Returns the outputFileName property value.
 java.lang.String getOutputHostType()
          Returns the outputHostType property value.
 java.lang.String getOutputTextOrientation()
          Returns the outputTextOrientation property value.
 java.lang.String getOutputTextType()
          Returns the outputTextType property value.
 int getRecordLength()
          Returns the recordLength property value.
 boolean isBinMode()
          Returns the BinMode property value.
 boolean isLamAlef()
          Returns the lamAlef property value.
 boolean isSymSwap()
          Returns the SymSwap boolean property value.
 void processConversion()
          Performs a codepage-to-codepage transformation according to the attributes registered in the Converter bean instance.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes registered ActionEvent listeners.
 void setBinMode(boolean BinMode)
          Sets the BinMode property value.
 void setInputCodepage(java.lang.String inputCodepage)
          Sets the inputCodepage property value.
 void setInputFileName(java.lang.String inputFileName)
          Sets the inputFileName property value.
 void setInputHostType(java.lang.String inputHostType)
          Sets the inputHostType property value.
 void setInputTextOrientation(java.lang.String inputTextOrientation)
          Sets the inputTextOrientation property value.
 void setInputTextType(java.lang.String inputTextType)
          Sets the inputTextType property value.
 void setLamAlef(boolean lamAlef)
          Sets the lamAlef property value.
 void setLanguage(java.lang.String lang)
          Sets the cpcLanguage property value.
 void setNumeralShaping(java.lang.String numeralShaping)
          Sets the numeralShaping property value.
 void setOutputCodepage(java.lang.String outputCodepage)
          Sets the outputCodepage property value.
 void setOutputFileName(java.lang.String outputFileName)
          Sets the outputFileName property value.
 void setOutputHostType(java.lang.String outputHostType)
          Sets the outputHostType property value.
 void setOutputTextOrientation(java.lang.String outputTextOrientation)
          Sets the outputTextOrientation property value.
 void setOutputTextType(java.lang.String outputTextType)
          Sets the outputTextType property value.
 void setRecordLength(int RecordLength)
          Sets the recordLength property value.
 void setSymSwap(boolean SymSwap)
          Sets the SymSwap property value.
 
Methods inherited from class com.ibm.eNetwork.beans.HOD.HODBean
addPropertyChangeListener, addTraceListener, addVetoableChangeListener, clone, getComponent, getFunction, getProperties, getTraceLevel, getTraceName, propertyChange, readExternal, removePropertyChangeListener, removeTraceListener, removeVetoableChangeListener, setProperties, setTraceLevel, toString, writeExternal
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNIX

public static final java.lang.String UNIX
Used to specify the input or output host type as a Unix platform.

WIN

public static final java.lang.String WIN
Used to specify the input or output host type as a Dos/Windows platform.

OS2

public static final java.lang.String OS2
Used to specify the input or output host type as an OS/2 platform.

OS390

public static final java.lang.String OS390
Used to specify the input or output host type as an OS/390 platform. For OS/390, only files with fixed record length are processed properly.

OS400

public static final java.lang.String OS400
Used to specify the input or output host type as an OS/400 platform. For OS/400, only files with fixed record length are processed properly.
Constructor Detail

Converter

public Converter()
The default public constructor.
Method Detail

setInputTextType

public void setInputTextType(java.lang.String inputTextType)
Sets the inputTextType property value.

The value should be one of the Session class TextType enumerations:

See Also:
getInputTextType()

getInputTextType

public java.lang.String getInputTextType()
Returns the inputTextType property value.
See Also:
setInputTextType(java.lang.String)

setOutputTextType

public void setOutputTextType(java.lang.String outputTextType)
Sets the outputTextType property value.

The value should be one of the Session class TextType enumerations:

See Also:
getOutputTextType()

getOutputTextType

public java.lang.String getOutputTextType()
Returns the outputTextType property value.
See Also:
setOutputTextType(java.lang.String)

setInputTextOrientation

public void setInputTextOrientation(java.lang.String inputTextOrientation)
Sets the inputTextOrientation property value.

The value should be one of the Session class TextOrientation enumerations:

See Also:
getInputTextOrientation()

getInputTextOrientation

public java.lang.String getInputTextOrientation()
Returns the inputTextOrientation property value.
See Also:
setInputTextOrientation(java.lang.String)

setOutputTextOrientation

public void setOutputTextOrientation(java.lang.String outputTextOrientation)
Sets the outputTextOrientation property value.

The value should be one of the Session class TextOrientation enumerations:

See Also:
getOutputTextOrientation()

getOutputTextOrientation

public java.lang.String getOutputTextOrientation()
Returns the outputTextOrientation property value.
See Also:
setOutputTextOrientation(java.lang.String)

setInputFileName

public void setInputFileName(java.lang.String inputFileName)
Sets the inputFileName property value.
See Also:
getInputFileName()

getInputFileName

public java.lang.String getInputFileName()
Returns the inputFileName property value.
See Also:
setInputFileName(java.lang.String)

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)
Sets the outputFileName property value.
See Also:
getOutputFileName()

getOutputFileName

public java.lang.String getOutputFileName()
Returns the outputFileName property value.
See Also:
setOutputFileName(java.lang.String)

setInputCodepage

public void setInputCodepage(java.lang.String inputCodepage)
Sets the inputCodepage property value.
See Also:
getInputCodepage()

getInputCodepage

public java.lang.String getInputCodepage()
Returns the inputCodepage property value.
See Also:
setInputCodepage(java.lang.String)

setOutputCodepage

public void setOutputCodepage(java.lang.String outputCodepage)
Sets the outputCodepage property value.
See Also:
getOutputCodepage()

getOutputCodepage

public java.lang.String getOutputCodepage()
Returns the outputCodepage property value.
See Also:
setOutputCodepage(java.lang.String)

setInputHostType

public void setInputHostType(java.lang.String inputHostType)
Sets the inputHostType property value.

The value should be one of the following Converter class constants:


getInputHostType

public java.lang.String getInputHostType()
Returns the inputHostType property value.
See Also:
setInputHostType(java.lang.String)

setOutputHostType

public void setOutputHostType(java.lang.String outputHostType)
Sets the outputHostType property value.

The value should be one of the following Converter class constants:

See Also:
getOutputHostType()

getOutputHostType

public java.lang.String getOutputHostType()
Returns the outputHostType property value.
See Also:
setOutputHostType(java.lang.String)

setNumeralShaping

public void setNumeralShaping(java.lang.String numeralShaping)
Sets the numeralShaping property value.

The value should be one of the Session class NumeralShaping enumerations:

See Also:
getNumeralShaping()

getNumeralShaping

public java.lang.String getNumeralShaping()
Returns the numeralShaping property value.
See Also:
setNumeralShaping(java.lang.String)

setLamAlef

public void setLamAlef(boolean lamAlef)
Sets the lamAlef property value.

This property enables or disables LamAlef transform for Arabic codepages.

See Also:
isLamAlef()

isLamAlef

public boolean isLamAlef()
Returns the lamAlef property value.
See Also:
setLamAlef(boolean)

setSymSwap

public void setSymSwap(boolean SymSwap)
Sets the SymSwap property value.

This property enables or disables the Symmetric Swaping for Arabic and Hebrew codepages.

See Also:
isSymSwap()

isSymSwap

public boolean isSymSwap()
Returns the SymSwap boolean property value.
See Also:
setSymSwap(boolean SymSwap)

setBinMode

public void setBinMode(boolean BinMode)
Sets the BinMode property value.

If this property is set to true, the Converter converts the "end-of-line character" according to input and output host types.

For OS/390 and OS/400, only fixed record length file processing is available. The recordLength property is used to set the record length.

See Also:
isBinMode(), setRecordLength(int)

isBinMode

public boolean isBinMode()
Returns the BinMode property value.
See Also:
setBinMode(boolean)

setRecordLength

public void setRecordLength(int RecordLength)
Sets the recordLength property value.
See Also:
getRecordLength()

getRecordLength

public int getRecordLength()
Returns the recordLength property value.
See Also:
setRecordLength(int)

setLanguage

public void setLanguage(java.lang.String lang)
Sets the cpcLanguage property value.
See Also:
getLanguage()

getLanguage

public java.lang.String getLanguage()
Returns the cpcLanguage property value.
See Also:
setLanguage(String)

processConversion

public void processConversion()
Performs a codepage-to-codepage transformation according to the attributes registered in the Converter bean instance.

execute

public void execute(ConvertEvent e)
This method implements ConvertListener interface.

It calls the execute(ActInfo a) method and sends an ActionEvent to inform an interested listener that the conversion is finished.

Specified by:
execute in interface ConvertListener
Parameters:
e - an instance of a ConvertEvent.
See Also:
ConvertEvent, ActInfo

execute

public void execute(ActInfo a)
This method sets the bean properties and sets off the conversion. The bean properties are set to reflect the attribute values contained in the ActInfo instance paramater. Then the bean starts the conversion by calling the processConversion() method. See ActInfo for more information.
Parameters:
a - an instance of ActInfo.

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds interested ActionEvent listeners wanting to be informed when a file conversion is complete.
See Also:
removeActionListener(ActionListener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes registered ActionEvent listeners.
See Also:
addActionListener(ActionListener)

dispose

public void dispose()
Cleans up memory.
Overrides:
dispose in class HODBean