New Methods in DataCell Derived Classes

We defined three derived classes to support CSV formats in Chapter 7. To use those classes now for flat files we must add a prepareOutput method. It is very similar in most classes, but it varies depending on justification and whether or not truncation is allowed. Note again that for flat file formats we need to use only the Length Attribute of the grammar Element, but for EDI support in the next chapter we retrieve the MaxLength Attribute if Length is not present.

DataCellAN prepareOutput Method

For the alphanumeric data type supported by the DataCellAN class, we left-justify and truncate if specified by the Truncatable Attribute of the Grammar Element.

Logic for the DataCellAN prepareOutput Method
 Arguments: ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.