gt:         if (ORDER_QTY_DATA_COMP_TAGS.contains(tag.tagNum)) {
context: /*
   *   Copyright (c) 2006-2016 Marvisan Pty. Ltd. All rights reserved.
   *               Use is subject to license terms.
   */
  
  /*
   * OrderCancelRequestMsg50SP2.java
   *
   * $Id: OrderCancelRequestMsg50SP2.java,v 1.3 2011-05-02 04:04:19 vrotaru Exp $
   */
  package net.hades.fix.message.impl.v50sp2;
  
  import net.hades.fix.message.FIXFragment;
  import net.hades.fix.message.FragmentContext;
  import net.hades.fix.message.Header;
  import net.hades.fix.message.OrderCancelRequestMsg;
  import net.hades.fix.message.exception.BadFormatMsgException;
  import net.hades.fix.message.exception.InvalidMsgException;
  import net.hades.fix.message.exception.TagNotPresentException;
  import net.hades.fix.message.group.PartyGroup;
  import net.hades.fix.message.struct.Tag;
  import net.hades.fix.message.type.AcctIDSource;
  import net.hades.fix.message.type.ApplVerID;
  import net.hades.fix.message.type.BeginString;
  import net.hades.fix.message.type.Side;
  import net.hades.fix.message.xml.codec.jaxb.adapter.FixBooleanAdapter;
  
  import java.nio.ByteBuffer;
  import java.util.Arrays;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Set;
  
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlAttribute;
  import javax.xml.bind.annotation.XmlElementRef;
  import javax.xml.bind.annotation.XmlRootElement;
  import javax.xml.bind.annotation.XmlType;
  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  
  import net.hades.fix.message.comp.FinancingDetails;
  import net.hades.fix.message.comp.Instrument;
  import net.hades.fix.message.comp.OrderQtyData;
  import net.hades.fix.message.comp.Parties;
  import net.hades.fix.message.comp.UnderlyingInstrument;
  import net.hades.fix.message.comp.impl.v50sp2.FinancingDetails50SP2;
  import net.hades.fix.message.comp.impl.v50sp2.Instrument50SP2;
  import net.hades.fix.message.comp.impl.v50sp2.OrderQtyData50SP2;
  import net.hades.fix.message.comp.impl.v50sp2.Parties50SP2;
  import net.hades.fix.message.comp.impl.v50sp2.UnderlyingInstrument50SP2;
  import net.hades.fix.message.type.AccountType;
  import net.hades.fix.message.xml.codec.jaxb.adapter.FixDateTimeAdapter;
  
  /**
   * FIX version 5.0SP2 OrderCancelRequestMsg implementation.
   *
   * @author <a href="mailto:support@marvisan.com">Support Team</a>
   * @version $Revision: 1.3 $
   * @created 21/04/2009, 9:32:41 AM
   */
  @XmlRootElement(name="OrdCxlReq")
  @XmlType(propOrder = {"header", "partyIDGroups", "instrument", "financingDetails", "underlyingInstruments", "orderQtyData"})
  @XmlAccessorType(XmlAccessType.NONE)
  public class OrderCancelRequestMsg50SP2 extends OrderCancelRequestMsg {
  
      // <editor-fold defaultstate="collapsed" desc="Constants">
  
      private static final long serialVersionUID = 1L;
  
      protected static final Set<Integer> PARTIES_COMP_TAGS = new Parties50SP2().getFragmentAllTags();
      protected static final Set<Integer> INSTRUMENT_COMP_TAGS = new Instrument50SP2().getFragmentAllTags();
      protected static final Set<Integer> FINANCING_DETAILS_COMP_TAGS = new FinancingDetails50SP2().getFragmentAllTags();
      protected static final Set<Integer> UNDERLYING_INSTRUMENT_COMP_TAGS = new UnderlyingInstrument50SP2().getFragmentAllTags();
      protected static final Set<Integer> ORDER_QTY_DATA_COMP_TAGS = new OrderQtyData50SP2().getFragmentAllTags();
  
      protected static final Set<Integer> START_COMP_TAGS;
  
      protected static final Set<Integer> ALL_TAGS;
  
      // </editor-fold>
  
      // <editor-fold defaultstate="collapsed" desc="Static Block">
  
      static {
          ALL_TAGS = new HashSet<Integer>(TAGS);
          ALL_TAGS.addAll(START_DATA_TAGS);
          ALL_TAGS.addAll(PARTIES_COMP_TAGS);
          ALL_TAGS.addAll(INSTRUMENT_COMP_TAGS);
          ALL_TAGS.addAll(FINANCING_DETAILS_COMP_TAGS);
          ALL_TAGS.addAll(UNDERLYING_INSTRUMENT_COMP_TAGS);
          ALL_TAGS.addAll(ORDER_QTY_DATA_COMP_TAGS);
          START_COMP_TAGS = new HashSet<Integer>(PARTIES_COMP_TAGS);
          START_COMP_TAGS.addAll(INSTRUMENT_COMP_TAGS);
          START_COMP_TAGS.addAll(FINANCING_DETAILS_COMP_TAGS);
          START_COMP_TAGS.addAll(UNDERLYING_INSTRUMENT_COMP_TAGS);
          START_COMP_TAGS.addAll(ORDER_QTY_DATA_COMP_TAGS);
      }
  
      // </editor-fold>
  
      // <editor-fold defaultstate="collapsed" desc="Attributes">
  
      protected Set<Integer> STANDARD_SECURED_TAGS = TAGS;
  
      // </editor-fold>
  
      // <editor-fold defaultstate="collapsed" desc="Constructors">
  
      public OrderCancelRequestMsg50SP2() {
          super();
      }
  
      public OrderCancelRequestMsg50SP2(Header header, ByteBuffer rawMsg)
      throws InvalidMsgException, TagNotPresentException, BadFormatMsgException {
          super(header, rawMsg);
          SECURED_TAGS = STANDARD_SECURED_TAGS;
      }
  
      public OrderCancelRequestMsg50SP2(BeginString beginString) throws InvalidMsgException {
          super(beginString);
          SECURED_TAGS = STANDARD_SECURED_TAGS;
      }
  
      public OrderCancelRequestMsg50SP2(BeginString beginString, ApplVerID applVerID) throws InvalidMsgException {
          super(beginString, applVerID);
          SECURED_TAGS = STANDARD_SECURED_TAGS;
      }
  
      // </editor-fold>
  
      // <editor-fold defaultstate="collapsed" desc="Public Methods">
  
      @Override
      public Set<Integer> getFragmentTags() {
          return TAGS;
      }
  
      @Override
      public Set<Integer> getFragmentAllTags() {
          return ALL_TAGS;
      }
  
      @Override
      public void copyFixmlData(FIXFragment fragment) {
          OrderCancelRequestMsg50SP2 fixml = (OrderCancelRequestMsg50SP2) fragment;
          if (fixml.getOrigClOrdID() != null) {
              origClOrdID = fixml.getOrigClOrdID();
          }
          if (fixml.getOrderID() != null) {
              orderID = fixml.getOrderID();
          }
          if (fixml.getClOrdID() != null) {
              clOrdID = fixml.getClOrdID();
          }
          if (fixml.getSecondaryClOrdID() != null) {
              secondaryClOrdID = fixml.getSecondaryClOrdID();
          }
          if (fixml.getClOrdLinkID() != null) {
              clOrdLinkID = fixml.getClOrdLinkID();
          }
          if (fixml.getListID() != null) {
              listID = fixml.getListID();
          }
          if (fixml.getOrigOrdModTime() != null) {
              origOrdModTime = fixml.getOrigOrdModTime();
          }
          if (fixml.getAccount() != null) {
              account = fixml.getAccount();
          }
          if (fixml.getAcctIDSource() != null) {
              acctIDSource = fixml.getAcctIDSource();
          }
          if (fixml.getAccountType() != null) {
              accountType = fixml.getAccountType();
          }
          if (fixml.getParties() != null) {
              setParties(fixml.getParties());
          }
          if (fixml.getInstrument() != null) {
              setInstrument(fixml.getInstrument());
          }
          if (fixml.getFinancingDetails() != null) {
              setFinancingDetails(fixml.getFinancingDetails());
          }
          if (fixml.getUnderlyingInstruments() != null && fixml.getUnderlyingInstruments().length > 0) {
              setUnderlyingInstruments(fixml.getUnderlyingInstruments());
          }
          if (fixml.getDayBookingInst() != null) {
              dayBookingInst = fixml.getDayBookingInst();
          }
          if (fixml.getSide() != null) {
              side = fixml.getSide();
          }
          if (fixml.getTransactTime() != null) {
              transactTime = fixml.getTransactTime();
          }
          if (fixml.getOrderQtyData() != null) {
              setOrderQtyData(fixml.getOrderQtyData());
          }
          if (fixml.getComplianceID() != null) {
              complianceID = fixml.getComplianceID();
          }
          if (fixml.getSolicitedFlag() != null) {
              solicitedFlag = fixml.getSolicitedFlag();
          }
          if (fixml.getText() != null) {
              text = fixml.getText();
          }
          if (fixml.getEncodedTextLen() != null) {
              encodedTextLen = fixml.getEncodedTextLen();
              encodedText = fixml.getEncodedText();
          }
      }
  
      // ACCESSOR METHODS
      //////////////////////////////////////////
  
      @XmlElementRef
      @Override
      public Header getHeader() {
          return header;
      }
  
      @Override
      public void setHeader(Header header) {
          this.header = header;
      }
  
      @XmlAttribute(name = "OrigID")
      @Override
      public String getOrigClOrdID() {
          return origClOrdID;
      }
  
      @Override
      public void setOrigClOrdID(String origClOrdID) {
          this.origClOrdID = origClOrdID;
      }
  
      @XmlAttribute(name = "OrdID")
      @Override
      public String getOrderID() {
          return orderID;
      }
  
      @Override
      public void setOrderID(String orderID) {
          this.orderID = orderID;
      }
  
      @XmlAttribute(name = "ID")
      @Override
      public String getClOrdID() {
          return clOrdID;
      }
  
      @Override
      public void setClOrdID(String clOrdID) {
          this.clOrdID = clOrdID;
      }
  
      @XmlAttribute(name = "ID2")
      @Override
      public String getSecondaryClOrdID() {
          return secondaryClOrdID;
      }
  
      @Override
      public void setSecondaryClOrdID(String secondaryClOrdID) {
          this.secondaryClOrdID = secondaryClOrdID;
      }
  
      @XmlAttribute(name = "LnkID")
      @Override
      public String getClOrdLinkID() {
          return clOrdLinkID;
      }
  
      @Override
      public void setClOrdLinkID(String clOrdLinkID) {
          this.clOrdLinkID = clOrdLinkID;
      }
  
      @XmlAttribute(name = "ListID")
      @Override
      public String getListID() {
          return listID;
      }
  
      @Override
      public void setListID(String listID) {
          this.listID = listID;
      }
  
      @XmlAttribute(name = "OrigOrdModTm")
      @Override
      public Date getOrigOrdModTime() {
          return origOrdModTime;
      }
  
      @Override
      public void setOrigOrdModTime(Date origOrdModTime) {
          this.origOrdModTime = origOrdModTime;
      }
  
      @XmlAttribute(name = "Acct")
      @Override
      public String getAccount() {
          return account;
      }
  
      @Override
      public void setAccount(String account) {
          this.account = account;
      }
  
      @XmlAttribute(name = "AcctIDSrc")
      @Override
      public AcctIDSource getAcctIDSource() {
          return acctIDSource;
      }
  
      @Override
      public void setAcctIDSource(AcctIDSource acctIDSource) {
          this.acctIDSource = acctIDSource;
      }
  
      @XmlAttribute(name = "AcctTyp")
      @Override
      public AccountType getAccountType() {
          return accountType;
      }
  
      @Override
      public void setAccountType(AccountType accountType) {
          this.accountType = accountType;
      }
  
      @Override
      public Parties getParties() {
          return parties;
      }
  
      @Override
      public void setParties() {
          FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
          this.parties = new Parties50SP2(context);
      }
  
      @Override
      public void clearParties() {
          this.parties = null;
      }
  
      public void setParties(Parties parties) {
          this.parties = parties;
      }
  
      @XmlElementRef
      public PartyGroup[] getPartyIDGroups() {
          return parties == null ? null : parties.getPartyIDGroups();
      }
  
      public void setPartyIDGroups(PartyGroup[] partyIDGroups) {
          if (partyIDGroups != null) {
              if (parties == null) {
                  setParties();
              }
              ((Parties50SP2) parties).setPartyIDGroups(partyIDGroups);
          }
      }
  
      @XmlElementRef
      @Override
      public Instrument getInstrument() {
          return instrument;
      }
  
      @Override
      public void setInstrument() {
          FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
          this.instrument = new Instrument50SP2(context);
      }
  
      @Override
      public void clearInstrument() {
          this.instrument = null;
      }
  
      public void setInstrument(Instrument instrument) {
          this.instrument = instrument;
      }
  
      @XmlElementRef
      @Override
      public FinancingDetails getFinancingDetails() {
          return financingDetails;
      }
  
      @Override
      public void setFinancingDetails() {
          FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
          this.financingDetails = new FinancingDetails50SP2(context);
      }
  
      public void setFinancingDetails(FinancingDetails financingDetails) {
          this.financingDetails = financingDetails;
      }
  
      @Override
      public void clearFinancingDetails() {
          this.financingDetails = null;
      }
  
      @Override
      public Integer getNoUnderlyings() {
          return noUnderlyings;
      }
  
      @Override
      public void setNoUnderlyings(Integer noUnderlyings) {
          this.noUnderlyings = noUnderlyings;
          if (noUnderlyings != null) {
              underlyingInstruments = new UnderlyingInstrument[noUnderlyings.intValue()];
              FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
              for (int i = 0; i < underlyingInstruments.length; i++) {
                  underlyingInstruments[i] = new UnderlyingInstrument50SP2(context);
              }
          }
      }
  
      @XmlElementRef
      @Override
      public UnderlyingInstrument[] getUnderlyingInstruments() {
          return underlyingInstruments;
      }
  
      public void setUnderlyingInstruments(UnderlyingInstrument[] underlyingInstruments) {
          this.underlyingInstruments = underlyingInstruments;
          if (underlyingInstruments != null) {
              noUnderlyings = new Integer(underlyingInstruments.length);
          }
      }
  
      @Override
      public UnderlyingInstrument addUnderlyingInstrument() {
          UnderlyingInstrument group = new UnderlyingInstrument50SP2(new FragmentContext(sessionCharset, messageEncoding, validateRequired));
          List<UnderlyingInstrument> groups = new ArrayList<UnderlyingInstrument>();
          if (underlyingInstruments != null && underlyingInstruments.length > 0) {
              groups = new ArrayList<UnderlyingInstrument>(Arrays.asList(underlyingInstruments));
          }
          groups.add(group);
          underlyingInstruments = groups.toArray(new UnderlyingInstrument[groups.size()]);
          noUnderlyings = new Integer(underlyingInstruments.length);
  
          return group;
      }
  
      @Override
      public UnderlyingInstrument deleteUnderlyingInstrument(int index) {
          UnderlyingInstrument result = null;
          if (underlyingInstruments != null && underlyingInstruments.length > 0 && underlyingInstruments.length > index) {
              List<UnderlyingInstrument> groups = new ArrayList<UnderlyingInstrument>(Arrays.asList(underlyingInstruments));
              result = groups.remove(index);
              underlyingInstruments = groups.toArray(new UnderlyingInstrument[groups.size()]);
              if (underlyingInstruments.length > 0) {
                  noUnderlyings = new Integer(underlyingInstruments.length);
              } else {
                  underlyingInstruments = null;
                  noUnderlyings = null;
              }
          }
  
          return result;
      }
  
      @Override
      public int clearUnderlyingInstruments() {
          int result = 0;
          if (underlyingInstruments != null && underlyingInstruments.length > 0) {
              result = underlyingInstruments.length;
              underlyingInstruments = null;
              noUnderlyings = null;
          }
  
          return result;
      }
  
      @XmlAttribute(name = "Side")
      @Override
      public Side getSide() {
          return side;
      }
  
      @Override
      public void setSide(Side side) {
          this.side = side;
      }
  
      @XmlAttribute(name = "TxnTm")
      @XmlJavaTypeAdapter(FixDateTimeAdapter.class)
      @Override
      public Date getTransactTime() {
          return transactTime;
      }
  
      @Override
      public void setTransactTime(Date transactTime) {
          this.transactTime = transactTime;
      }
  
      @XmlElementRef
      @Override
      public OrderQtyData getOrderQtyData() {
          return orderQtyData;
      }
  
      @Override
      public void setOrderQtyData() {
          FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
          this.orderQtyData = new OrderQtyData50SP2(context);
      }
  
      @Override
      public void clearOrderQtyData() {
          this.orderQtyData = null;
      }
  
      public void setOrderQtyData(OrderQtyData orderQtyData) {
          this.orderQtyData = orderQtyData;
      }
  
      @XmlAttribute(name = "ComplianceID")
      @Override
      public String getComplianceID() {
          return complianceID;
      }
  
      @Override
      public void setComplianceID(String complianceID) {
          this.complianceID = complianceID;
      }
  
      @XmlAttribute(name = "SolFlag")
      @XmlJavaTypeAdapter(FixBooleanAdapter.class)
      @Override
      public Boolean getSolicitedFlag() {
          return solicitedFlag;
      }
  
      @Override
      public void setSolicitedFlag(Boolean solicitedFlag) {
          this.solicitedFlag = solicitedFlag;
      }
  
      @XmlAttribute(name = "Txt")
      @Override
      public String getText() {
          return text;
      }
  
      @Override
      public void setText(String text) {
          this.text = text;
      }
  
      @XmlAttribute(name = "EncTxtLen")
      @Override
      public Integer getEncodedTextLen() {
          return encodedTextLen;
      }
  
      @Override
      public void setEncodedTextLen(Integer encodedTextLen) {
          this.encodedTextLen = encodedTextLen;
      }
  
      @XmlAttribute(name = "EncTxt")
      @Override
      public byte[] getEncodedText() {
          return encodedText;
      }
  
      @Override
      public void setEncodedText(byte[] encodedText) {
          this.encodedText = encodedText;
          if (encodedTextLen == null) {
              encodedTextLen = new Integer(encodedText.length);
          }
      }
  
      // </editor-fold>
  
      // <editor-fold defaultstate="collapsed" desc="Protected Methods">
  
      @Override
      protected void setFragmentCompTagValue(Tag tag, ByteBuffer message)
      throws BadFormatMsgException, InvalidMsgException, TagNotPresentException {
          FragmentContext context = new FragmentContext(sessionCharset, messageEncoding, validateRequired);
          if (PARTIES_COMP_TAGS.contains(tag.tagNum)) {
              if (parties == null) {
                  parties = new Parties50SP2(context);
              }
              parties.decode(tag, message);
          }
          if (INSTRUMENT_COMP_TAGS.contains(tag.tagNum)) {
              if (instrument == null) {
                  instrument = new Instrument50SP2(context);
              }
              instrument.decode(tag, message);
          }
          if (FINANCING_DETAILS_COMP_TAGS.contains(tag.tagNum)) {
              if (financingDetails == null) {
                  financingDetails = new FinancingDetails50SP2(context);
              }
              financingDetails.decode(tag, message);
          }
          if (UNDERLYING_INSTRUMENT_COMP_TAGS.contains(tag.tagNum)) {
              if (noUnderlyings != null && noUnderlyings.intValue() > 0) {
                  message.reset();
                  underlyingInstruments = new UnderlyingInstrument[noUnderlyings.intValue()];
                  for (int i = 0; i < noUnderlyings.intValue(); i++) {
                      UnderlyingInstrument component = new UnderlyingInstrument50SP2(context);
                      component.decode(message);
                      underlyingInstruments[i] = component;
                  }
              }
          }
  