it.imolinfo.jbi4cics.typemapping.cobol
Class CobolFieldFormatter
java.lang.Object
it.imolinfo.jbi4cics.typemapping.cobol.CobolFieldFormatter
public final class CobolFieldFormatter
- extends java.lang.Object
Questo metodo formatta un tipo java in un buffer di byte secondo il formato
cobol. Il metodo ha i seguenti vincoli: Tipo cobol STRING l'oggetto passato
deve essere di tipo String Tipo cobol PACKED_DECIMAL l'oggetto passato deve
essere BigInteger o BigDecimal o Long o Integer o Float o Double Tipo cobol
INTEGER l'oggetto passato deve essere di tipo Number, se la dimensione e' >
16 ci possono essere problemi di conversione Tipo cobol ZONED l'oggetto
passato deve essere BigInteger o BigDecimal o Long o Integer o Float o Double
l'invariante di questo metodo e' che alla fine lo spazio occupato sull'array
sara' sempre esattamente cobolType.getBufferedSize()
TODO ATTENZIONE su questo punto vanno fatte maggiori verifiche (ad esempio
come comportarsi nel caso una stringa sia troppo lunga...)
- Author:
- raffaele, Marco Cimatti
Method Summary |
static void |
format(java.lang.Object value,
byte[] buffer,
CobolTypeDescriptor desc,
int offset)
|
static java.lang.Object |
unformat(byte[] buffer,
CobolTypeDescriptor desc,
int offset)
Questo metodo legge un tipo cobol descritto da cobolType nel buffer a
partire da startingOffset e crea il corrispondente tipo java le
corrispondenze sono le seguenti: tipo cobol STRING tipo java String tipo
cobol PACKED_DECIMAL tipo java BigDecimal tipo cobol INTEGER tipo java
BigInteger tipo cobol ZONED tipo java BigDecimal |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
format
public static void format(java.lang.Object value,
byte[] buffer,
CobolTypeDescriptor desc,
int offset)
throws FormatException
- Throws:
FormatException
unformat
public static java.lang.Object unformat(byte[] buffer,
CobolTypeDescriptor desc,
int offset)
throws FormatException
- Questo metodo legge un tipo cobol descritto da cobolType nel buffer a
partire da startingOffset e crea il corrispondente tipo java le
corrispondenze sono le seguenti: tipo cobol STRING tipo java String tipo
cobol PACKED_DECIMAL tipo java BigDecimal tipo cobol INTEGER tipo java
BigInteger tipo cobol ZONED tipo java BigDecimal
- Parameters:
buffer
- desc
- offset
-
- Returns:
-
- Throws:
FormatException
Copyright © 2005-2008 Imola Informatica. All Rights Reserved.