|
AdventNet CLI 2.0 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.cli.terminal.TerminalIOHandler
This class can be used to handle Terminal Data. It uses the Transformation and Translation Handler implementations to perform the Transformation and Translation operations. For example it could perform translation between two types of Terminals (say a vt100 & IBM terminal). For doing these operations the user has to provide the Translation mappings for the key codes (say in a file). A default implementation for the Transformation and Translation Handler implementations are provided. These will be loaded during the initialization of this class. If the user wants his implementation of the handlers to be used he has to provide them (the class names of the implementation) in the terminal.conf file.
| Constructor Summary | |
TerminalIOHandler()
This constructor creates an instance of the TerminalIOHandler. |
|
| Method Summary | |
java.lang.String |
getTransformationHandlerClassName()
Gets the class name for the TransformationHandler implementation. |
java.lang.String[] |
getTransformationTableNames()
This method returns the table names that are present in the Transformation table list. |
java.lang.String |
getTranslationHandlerClassName()
Gets the class name for the TranslationHandler implementation. |
java.lang.String[] |
getTranslationTableNames()
This method returns the table names that are present in the Translation table list. |
void |
init(java.lang.String translationFileName,
java.lang.String transformationFileName)
This method loads the transformation & translation handlers and reads the translation/transformation tables from files. |
byte |
inverseTranslate(byte code)
This method is called to perform the opposite of translation. |
void |
setTransformationHandlerClassName(java.lang.String className)
Sets the class name of the TransformationHandler implementation. |
void |
setTranslationHandlerClassName(java.lang.String className)
Sets the class name of the TranslationHandler implementation. |
byte[] |
transform(byte[] codes)
This method is called to perform the actual transformation. |
byte |
translate(byte code)
This method is called to perform the actual translation. |
void |
useTransformationTable(java.lang.String tableName)
This method sets the Transformation Table to use among the different tables read. |
void |
useTranslationTable(java.lang.String tableName)
This method sets the Translation Table to use among the different tables read. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public TerminalIOHandler()
throws TerminalException
| Method Detail |
public void setTransformationHandlerClassName(java.lang.String className)
className - the TransformationHandler Implementation class name.public java.lang.String getTransformationHandlerClassName()
public void setTranslationHandlerClassName(java.lang.String className)
className - the TranslationHandler Implementation class name.public java.lang.String getTranslationHandlerClassName()
public byte[] transform(byte[] codes)
throws TerminalException
codes - the data to be transformed
public byte translate(byte code)
throws TerminalException
code - the terminal code to be translated
public byte inverseTranslate(byte code)
throws TerminalException
code - the terminal code to be inverse translated
public void useTranslationTable(java.lang.String tableName)
throws TerminalException
tableName - the table name indicates the table which should be
used for the translation.
public void useTransformationTable(java.lang.String tableName)
throws TerminalException
tableName - the table name indicates the table which should be
used for the transformation.
public void init(java.lang.String translationFileName,
java.lang.String transformationFileName)
throws java.lang.Exception
translationFileName - the file name in which the translation table
is present.transformationFileName - the file name in which the transformation
table is present.
public java.lang.String[] getTransformationTableNames()
throws TerminalException
public java.lang.String[] getTranslationTableNames()
throws TerminalException
|
AdventNet CLI 2.0 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||