PDS data to Java type parsers.

These classes are responsible for taking a chunk of bytes and converting them to Java types. Since there are 38 PDS source data types and there are 9 supported Java value types for a total of 342 possible combinations. Due to the impraticality of generating a parser for every possible source data type and return type, a split architecture has been devised.

The majority of classes in this package fall into two types:

  1. Parsers which are responsible for reading binary bits and converting them to at least one Java type (usually BigDecimal)
  2. Adapters which down convert from a large range types such as BigDecimal to more commonly used Java types such as float. Adapters handle range checking during down convert.

The static method PdsGetterMaker.mk can be used to automatically instatiate an appropriate object implimenting the PdsValGetter interface for any supported combination of input PDS types and output Java types. This method first looks in the static object PdsGetterMaker.g_parserMap to see if a parser exists which directly outputs the desired type. If so it returns an instance of that parser. If no parser exists for direct output to the desired Java type, the map PdsGetterMaker.g_adapterMap is consulted to see if a PdsAdapter exists which could wrap the parser and return the proper type. If that fails as well UnsupportedOperationException is thrown.

Extending

Currently adapters exist to convert ComplexBigDecimals to to any numberic type. So the most generically useful way to add reading for a new binary type is to write a parser that outputs ComplexBigDecimal.

Adapters are not needed when a parser outputs the same type as is requested by the calling class. Thus for the most efficient operation create new parsers that output directly to the expected Java type.