code: public void visitCobolChoiceType(CobolChoiceType choiceType,
              ChoiceTypeAlternativeHandler callback) {
  
          CobolType alternative = null;
  
          // If we have a user provided strategy give it a chance to select a
          // alternative
          if (customChoiceStrategy != null) {
              alternative = customChoiceStrategy.choose(curFieldName, choiceType,
                      variables, hostData, lastPos, length);
          }
  
          // If user strategy did not succeed, try the default one
          if (alternative == null) {
              alternative = defaultChoiceStrategy.choose(curFieldName,
                      choiceType, variables, hostData, lastPos, length);
          }
  
          // All attempts have failed
          if (alternative == null) {
              throw new CobolChoiceStrategyException(
                      "Unable to select an alternative for choice "
                              + curFieldName + ", path: "
                              + getCurFieldFullCobolName());
          }
  
          // Make sure the strategy is returning a known alternative
          String alternativeName = choiceType.getAlternativeName(alternative);
          if (alternativeName == null) {
              throw new CobolChoiceStrategyException(
                      "Alternative does not correspond to a known alternative for choice "
                              + curFieldName + ", path: "
                              + getCurFieldFullCobolName());
          }
  
          callback.preVisit(alternativeName,
                  choiceType.getAlternativeIndex(alternativeName), alternative);
  
          alternative.accept(this);
  
          // If the alternative chosen is not the largest one, add the difference
          // to an extra offset that will be used if a fixed position item follows
          // this choice
          if (alternative.getMaxBytesLen() < choiceType.getMaxBytesLen()) {
              extraOffset += choiceType.getMaxBytesLen()
                      - alternative.getMaxBytesLen();
          }
  
          callback.postVisit(alternativeName,
                  choiceType.getAlternativeIndex(alternativeName), alternative);
  
      }
docs: Visit a choice type (COBOL REDEFINES) which determines which alternative
  must be selected.
  <p/>
  
  @param choiceType the choice type
  @param callback a function that is invoked after the selected alternative
  has been visited