com.bankframe.ei.channel.codec
Class DPTPCodec

java.lang.Object
  extended bycom.bankframe.ei.channel.codec.DPTPCodec
All Implemented Interfaces:
Codec
Direct Known Subclasses:
DPTPPaddingCodec

public class DPTPCodec
extends java.lang.Object
implements Codec

This class converts DataPackets or Vectors of DataPackets to/from a compact XML representation. The aim of this class is to define a standard means of representing a DataPacket as a String. Secondly the class is designed to be lightweight and fast, therefore this class does all the xml encoding and decoding itself, it does not rely on third party XML packages such as Xerces or JAXP. This class is not as robust as fully fledged XML parsers, it can only handle the defined DataPacket xml reprensentation and it cannot handle xml strings that are not well formed.


Field Summary
static java.lang.String CLOSE_TAG_BEGIN
           
static java.lang.String CLOSE_TAG_END
           
static java.lang.String DATAPACKET_END_TAG
           
static java.lang.String DATAPACKET_ENTITY
           
static java.lang.String DATAPACKET_START_TAG
           
static java.lang.String GT_TOKEN
           
static java.lang.String LT_TOKEN
           
static java.lang.String NAME_TOKEN
           
static java.lang.String OPEN_TAG_BEGIN
           
static java.lang.String OPEN_TAG_END
           
static java.lang.String OPEN_TAG_MIDDLE
           
static java.lang.String ROOT_NODE_NAME
           
static java.lang.String VALUE_END_TAG
           
static java.lang.String VALUE_ENTITY
           
static java.lang.String VALUE_START_TAG
           
static java.lang.String VECTOR_END_TAG
           
static java.lang.String VECTOR_ENTITY
           
static java.lang.String VECTOR_START_TAG
           
static java.lang.String XML_PI
           
 
Constructor Summary
DPTPCodec()
          DataPacketCodec constructor comment.
 
Method Summary
 java.util.Vector decode(java.lang.String encoded)
          This method converts a xml DataPacket representation into a Vector of one or more DataPackets
 java.lang.String encode(java.util.Vector dataPackets)
          This method encodes one or more DataPackets into a compact xml reprensentation
 java.lang.String getName()
          Return the name of this codec.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_TOKEN

public static final java.lang.String NAME_TOKEN
See Also:
Constant Field Values

OPEN_TAG_BEGIN

public static final java.lang.String OPEN_TAG_BEGIN
See Also:
Constant Field Values

OPEN_TAG_MIDDLE

public static final java.lang.String OPEN_TAG_MIDDLE
See Also:
Constant Field Values

OPEN_TAG_END

public static final java.lang.String OPEN_TAG_END
See Also:
Constant Field Values

CLOSE_TAG_BEGIN

public static final java.lang.String CLOSE_TAG_BEGIN
See Also:
Constant Field Values

CLOSE_TAG_END

public static final java.lang.String CLOSE_TAG_END
See Also:
Constant Field Values

VECTOR_ENTITY

public static final java.lang.String VECTOR_ENTITY
See Also:
Constant Field Values

DATAPACKET_ENTITY

public static final java.lang.String DATAPACKET_ENTITY
See Also:
Constant Field Values

VALUE_ENTITY

public static final java.lang.String VALUE_ENTITY
See Also:
Constant Field Values

VALUE_START_TAG

public static final java.lang.String VALUE_START_TAG
See Also:
Constant Field Values

VALUE_END_TAG

public static final java.lang.String VALUE_END_TAG
See Also:
Constant Field Values

VECTOR_START_TAG

public static final java.lang.String VECTOR_START_TAG
See Also:
Constant Field Values

VECTOR_END_TAG

public static final java.lang.String VECTOR_END_TAG
See Also:
Constant Field Values

DATAPACKET_START_TAG

public static final java.lang.String DATAPACKET_START_TAG
See Also:
Constant Field Values

DATAPACKET_END_TAG

public static final java.lang.String DATAPACKET_END_TAG
See Also:
Constant Field Values

ROOT_NODE_NAME

public static final java.lang.String ROOT_NODE_NAME
See Also:
Constant Field Values

XML_PI

public static final java.lang.String XML_PI
See Also:
Constant Field Values

LT_TOKEN

public static final java.lang.String LT_TOKEN
See Also:
Constant Field Values

GT_TOKEN

public static final java.lang.String GT_TOKEN
See Also:
Constant Field Values
Constructor Detail

DPTPCodec

public DPTPCodec()
DataPacketCodec constructor comment.

Method Detail

decode

public java.util.Vector decode(java.lang.String encoded)
This method converts a xml DataPacket representation into a Vector of one or more DataPackets

Specified by:
decode in interface Codec
Parameters:
encoded - String containing the xml reprensentation
Returns:
Vector of one or more DataPackets

encode

public java.lang.String encode(java.util.Vector dataPackets)
This method encodes one or more DataPackets into a compact xml reprensentation

Specified by:
encode in interface Codec
Parameters:
dataPackets - Vector of DataPackets
Returns:
String containing xml representation

getName

public java.lang.String getName()
Return the name of this codec.

Specified by:
getName in interface Codec
Returns:
java.lang.String


Copyright © 2005, 2007, Oracle. All rights reserved.