A message can have a segment present but empty, like if I parse a message that has a segment "ZPD|||". Calling Message.printStructure() shows the segment as "ZPD".
Given such a message, I see no easy way to make a Parser automatically encode such segments. They are just stripped from the encoded form by default. I know I could use ParserConfiguration.addForcedEncode() to force encoding certain segments, but I am using HAPI to just pass through messages after doing some transformation so I actually have no idea what optional/non-standard segments may be present in the message.
So I am writing to request an option to encode present but empty segments. Thanks in advance.