WebLogic Integration


com.bea.wlxt.bintype
Class Bintype

java.lang.Object
  |
  +--com.bea.wlxt.bintype.Bintype
Direct Known Subclasses:
Bintype_IBMFloat, BintypeDate, BintypeDouble, BintypeEndian, BintypeFloat, BintypeLiteral, BintypePacked, BintypeString, BintypeTinyInt, BintypeZoned

public abstract class Bintype
extends java.lang.Object
implements java.io.Serializable

This class provides the default implementation for Data Types used by the WLXT to translate Binary Data to XML or XML data to Binary data.

This Class defines the method signatures for the basic Read and Write operations required for WLXT Data Types. It also defines defaults for type attributes used to describe characteristics of a given data type.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Field Summary
static java.lang.String codepageEBCDIC
           
 
Constructor Summary
Bintype()
          Creates a new Bintype.
 
Method Summary
protected  java.lang.String applyPadAndTrim(java.lang.String value, com.bea.wlxt.mfl.MFLField fld, boolean applyPad, boolean applyTrim)
          Deprecated. Method is deprecated, new method applyPadAndTrim takes a fifth parameter for truncate option
protected  java.lang.String applyPadTrimAndTruncate(java.lang.String value, com.bea.wlxt.mfl.MFLField fld, boolean applyPad, boolean applyTrim, boolean applyTruncate)
          Creates a String that has either been padded to a specified length or has had leading, trailing or both white space trimmed from it.
 boolean canBeDataDelimited()
          Returns true if this type represents a variable length data type which may be terminated by a delimiter or can have data delimeter.
 boolean canBeDelimited()
          Returns true if this type represents a variable length data type which may be terminated by a delimiter.
 boolean canBeDelimSeparator()
           
 boolean canBeFieldType()
          Returns true if this type can be used to describe an MFL field.
 boolean canBeLenFieldType()
          Returns true if this type can be used as the data type of a field length.
 boolean canBePadded()
          Returns true if this type can be padded.
 boolean canBePassLiteral()
           
 boolean canBeTagFieldType()
          Returns true if this type can be used as the data type for a tag field.
 boolean canBeTrimmed()
          Returns true if this type can be trimmed.
 boolean canBeTruncated()
           
 boolean canHaveDecimalPlaces()
          Returns true if this type allows for decimal places.
static byte[] getBinaryBytes(java.lang.String str)
          Creates a binary byte array from String input.
 java.lang.String getDescriptionText()
          Returns a String that contains a text description of this data types function.
 java.lang.String getDisplayName()
          Returns a String containing the Display Name for a data type name.
 java.lang.String getTypeName()
          Returns a String containing the data type name.
 boolean isCodepageOK()
          Returns true if the data type supports the use of code pages.
 boolean isCutoffRequired()
          Returns true if this type requires a cutoff date.
 boolean isDateType()
          Returns true if this type is a Date type.
 boolean isFixedSize()
          Returns true if this type may have a fixed data length.
 boolean isValueOK()
          Returns true if this data type may have an initial value assigned, i.e.
static java.lang.String makeString(byte[] b)
          Creates a String from a binary byte array.
abstract  java.lang.String read(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField mflField)
          Defines the method signature for reading a field.
 byte[] readDataDelim(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField mflField)
           
protected  byte[] readDelimitedField(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField mflField)
          Reads data from the input stream until encountering delimiter for this field.
protected  int readLength(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField fld)
          Reads the length value for an MFL field from the input buffer.
protected  java.lang.String readTag(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField fld)
          Reads and Validates a tag value for an MFL field from the input buffer.
protected  void reverseBytes(byte[] data)
          Reverse the order of bytes in a byte array.
abstract  void write(BintypeOutputStream byteStream, com.bea.wlxt.mfl.MFLField mflField, java.lang.String value)
          Defines the method signature for writing a field.
protected  void writeLength(BintypeOutputStream byteStream, com.bea.wlxt.mfl.MFLField fld, int fldLen)
          Writes the length value for an MFL field to the output stream.
protected  void writeTag(BintypeOutputStream byteStream, com.bea.wlxt.mfl.MFLField fld)
          Writes a tag value for an MFL field to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codepageEBCDIC

public static final java.lang.String codepageEBCDIC
Constructor Detail

Bintype

public Bintype()
Creates a new Bintype.
Method Detail

read

public abstract java.lang.String read(java.io.InputStream byteStream,
                                      com.bea.wlxt.mfl.MFLField mflField)
                               throws BintypeException
Defines the method signature for reading a field. The resulting String data is returned to the caller.

Parameters:
byteStream - InputStream object containing the data related to this field
mflField - MFLField object containing the meta data that describes the data contained in the field.
Throws:
BintypeException - If an error occurs reading the input data.

write

public abstract void write(BintypeOutputStream byteStream,
                           com.bea.wlxt.mfl.MFLField mflField,
                           java.lang.String value)
                    throws BintypeException
Defines the method signature for writing a field. The resulting String data is returned to the caller.

Parameters:
byteStream - BinTypeOutputStream object that will contain the data written by this method.
mflField - MFLField object containing the meta data that describes the data contained in the field.
value - String object that contains the data value to be written.
Throws:
BintypeException - If an error occurs writing output data.

canBeFieldType

public boolean canBeFieldType()
Returns true if this type can be used to describe an MFL field. Defaults to true.


canBeLenFieldType

public boolean canBeLenFieldType()
Returns true if this type can be used as the data type of a field length. Defaults to false.


canBeTagFieldType

public boolean canBeTagFieldType()
Returns true if this type can be used as the data type for a tag field. Defaults to true.


canBeDelimited

public boolean canBeDelimited()
Returns true if this type represents a variable length data type which may be terminated by a delimiter. Defaults to false.


canBeDataDelimited

public boolean canBeDataDelimited()
Returns true if this type represents a variable length data type which may be terminated by a delimiter or can have data delimeter. Defaults to false.


canBeDelimSeparator

public boolean canBeDelimSeparator()


canBePassLiteral

public boolean canBePassLiteral()


isFixedSize

public boolean isFixedSize()
Returns true if this type may have a fixed data length. Defaults to true.


isDateType

public boolean isDateType()
Returns true if this type is a Date type. Defaults to false.


isCutoffRequired

public boolean isCutoffRequired()
Returns true if this type requires a cutoff date. Cutoff values are required for date values which contain two digit years. Defaults to false.


isCodepageOK

public boolean isCodepageOK()
Returns true if the data type supports the use of code pages. Defaults to false.


isValueOK

public boolean isValueOK()
Returns true if this data type may have an initial value assigned, i.e. a literal data type. Defaults to false.


canHaveDecimalPlaces

public boolean canHaveDecimalPlaces()
Returns true if this type allows for decimal places. Defaults to false.


canBePadded

public boolean canBePadded()
Returns true if this type can be padded. Note that only fixed length fields will be padded. Defaults to false.


canBeTrimmed

public boolean canBeTrimmed()
Returns true if this type can be trimmed. Defaults to false.


canBeTruncated

public boolean canBeTruncated()


getBinaryBytes

public static byte[] getBinaryBytes(java.lang.String str)
Creates a binary byte array from String input.

Parameters:
str - String object that will contain the data that is converted to a byte array by this method.

makeString

public static java.lang.String makeString(byte[] b)
Creates a String from a binary byte array.

Parameters:
b - byte[] Binary byte array containing data to be converted to a String.

reverseBytes

protected void reverseBytes(byte[] data)
Reverse the order of bytes in a byte array.

Parameters:
byteStream - InputStream the input stream that contains the binary data
fld - MFLField the MFL field that is currently being read from the input stream.

readTag

protected java.lang.String readTag(java.io.InputStream byteStream,
                                   com.bea.wlxt.mfl.MFLField fld)
                            throws BintypeException
Reads and Validates a tag value for an MFL field from the input buffer. A String containing the Tag is returned to the caller.

Parameters:
byteStream - InputStream the input stream that contains the binary data
fld - MFLField the MFL field that is currently being read from the input stream.
Throws:
BintypeException - If an error occurs reading the input data.

readLength

protected int readLength(java.io.InputStream byteStream,
                         com.bea.wlxt.mfl.MFLField fld)
                  throws BintypeException
Reads the length value for an MFL field from the input buffer. Returns a integer containing the length value.

Parameters:
byteStream - InputStream the input stream that contains the binary data
fld - MFLField the MFL field that is currently being read from the input stream.
Throws:
BintypeException - If an error occurs reading the input data.

writeTag

protected void writeTag(BintypeOutputStream byteStream,
                        com.bea.wlxt.mfl.MFLField fld)
                 throws BintypeException
Writes a tag value for an MFL field to the output stream.

Parameters:
byteStream - BintypeOutputStream the output stream that contains binary data
fld - MFLField the MFL field that is currently being written to the output stream.
Throws:
BintypeException - If an error occurs writing the output data.

writeLength

protected void writeLength(BintypeOutputStream byteStream,
                           com.bea.wlxt.mfl.MFLField fld,
                           int fldLen)
                    throws BintypeException
Writes the length value for an MFL field to the output stream.

Parameters:
byteStream - BintypeOutputStream the output stream that contains binary data
fld - MFLField the MFL field that is currently being written to the output stream. This field may or may not require the length to be specified
int - fldLen the length of the field data.

readDelimitedField

protected byte[] readDelimitedField(java.io.InputStream byteStream,
                                    com.bea.wlxt.mfl.MFLField mflField)
                             throws BintypeException
Reads data from the input stream until encountering delimiter for this field.

Parameters:
byteStream - BintypeOutputStream the output stream that contains binary data
fld - MFLField the MFL field that is currently being written to the output stream. This field may or may not require the length to be specified
fldLen - int the length of the field data.
Throws:
BintypeException - If an error occurs reading the input data.

readDataDelim

public byte[] readDataDelim(java.io.InputStream byteStream,
                            com.bea.wlxt.mfl.MFLField mflField)
                     throws BintypeException


applyPadAndTrim

protected java.lang.String applyPadAndTrim(java.lang.String value,
                                           com.bea.wlxt.mfl.MFLField fld,
                                           boolean applyPad,
                                           boolean applyTrim)
                                    throws BintypeException
Deprecated. Method is deprecated, new method applyPadAndTrim takes a fifth parameter for truncate option
Creates a String that has either been padded to a specified length or has had leading, trailing or both white space trimmed from it.

Parameters:
value - String the String that the pad or trim operations will be applied to.
fld - MFLField the MFL field that is currently being operated upon.
applyPad - boolean switch indicating whether or not padding is to be performed.
applyTrim - boolean switch indicating whether or not trimming is to be performed.

applyPadTrimAndTruncate

protected java.lang.String applyPadTrimAndTruncate(java.lang.String value,
                                                   com.bea.wlxt.mfl.MFLField fld,
                                                   boolean applyPad,
                                                   boolean applyTrim,
                                                   boolean applyTruncate)
                                            throws BintypeException
Creates a String that has either been padded to a specified length or has had leading, trailing or both white space trimmed from it.

Parameters:
value - String the String that the pad or trim operations will be applied to.
fld - MFLField the MFL field that is currently being operated upon.
applyPad - boolean switch indicating whether or not padding is to be performed.
applyTrim - boolean switch indicating whether or not trimming is to be performed.
applyTruncate - boolean switch indicating whether or not truncation is to be performed.

getDescriptionText

public java.lang.String getDescriptionText()
Returns a String that contains a text description of this data types function. This method should be implemented in a User Defined Types for documentation purposes This default implementation always returns an empty String. WLXT supplied types will use this default implementation.


getTypeName

public java.lang.String getTypeName()
Returns a String containing the data type name. This function is used with User Defined Types. This default implementation always returns a Sring that contains the class name of the data type. WLXT supplied types will use this default implementation.


getDisplayName

public java.lang.String getDisplayName()
Returns a String containing the Display Name for a data type name. This function is used with User Defined Types. This default implementation always returns a String that contains the class name of the data type. WLXT supplied types will use this default implementation.


WebLogic Integration

WebLogic Integration (WLI)