Class FIXUtil

java.lang.Object
com.epam.fix.validation.engine.utils.FIXUtil

public final class FIXUtil extends Object
  • Field Details

  • Method Details

    • getValblockdefs

      public List<Valblockdef> getValblockdefs()
      Gets val blocks.
    • getAllTags

      public int[] getAllTags()
      Gets tags.
    • isHeader

      public boolean isHeader(int tag)
    • isTrailer

      public boolean isTrailer(int tag)
    • getFieldDef

      public Fielddef[] getFieldDef()
      Gets fields.
    • getConditionalCache

      public Map<String,IConditionalMessage> getConditionalCache()
      Gets conditional cache.
    • getTagsByMsgType

      public List<Integer> getTagsByMsgType(String messageType)
      Gets tags for message.
      Parameters:
      messageType - the message type of message
    • getFieldsByMessageType

      public List<Fielddef> getFieldsByMessageType(String messageType)
      Gets fields for message.
      Parameters:
      messageType - the message type of message
    • getVersion

      public FIXVersion getVersion()
      Gets fix version.
    • getVersionContainer

      public com.epam.fixengine.configuration.FIXVersionContainer getVersionContainer()
    • getFieldDefByTag

      public Fielddef getFieldDefByTag(int tag)
      Gets field.
      Parameters:
      tag - the tag
    • getFieldDefByName

      public Fielddef getFieldDefByName(String name)
      Gets field.
      Parameters:
      name - the field name
    • getFieldTagByName

      public int getFieldTagByName(String name)
      Gets field tag.
      Parameters:
      name - the field name
    • getFieldTypeByFieldName

      public String getFieldTypeByFieldName(String name)
      Gets field type by field name.
      Parameters:
      name - the field name
    • getFieldTypeByFieldTag

      public String getFieldTypeByFieldTag(int tag)
      Gets field type by field tag.
      Parameters:
      tag - the filed tag.
    • findGroup

      public Group findGroup(String msgType, int startTagId)
      Find group by start tag.
      Parameters:
      msgType - the message type.
      startTagId - the start tag if repeating group.
    • getGroupContent

      public List<Object> getGroupContent(String msgType, int startTagId)
      Get repeating group content.
      Parameters:
      msgType - the message type.
      startTagId - the start tag if repeating group.
    • getGroupFieldDefs

      public List<Fielddef> getGroupFieldDefs(String msgType, int startTagId)
      Get all field defs in repeating group.
      Parameters:
      msgType - the message type.
      startTagId - the start tag if repeating group.
    • getMessageFieldDefHier

      public List<Object> getMessageFieldDefHier(String msgType)
      Get message type field def hierarchy.
      Parameters:
      msgType - the message type.
    • isTagDefinedForMessage

      public boolean isTagDefinedForMessage(String msgType, int tagNum)
      Method isTagDefinedForMessage, verifies whether the tag is present in a message by type of message.
      Parameters:
      msgType - the message type
      tagNum - the num of tag
      Returns:
      true if presents, otherwise false
    • getRequiredTagsForMessage

      public Set<Integer> getRequiredTagsForMessage(String msgType)
      Method getRequiredTagsForMessage returns array of required tags, or empty array if message does not have required tags.
      Parameters:
      msgType - the type of message
      Returns:
      int[] Array of required tags
      Throws:
      MessageDefinitionsException - if message does not exist
    • isTagDefinedForMessageOrBlock

      public boolean isTagDefinedForMessageOrBlock(String shortName, int tagNum)
      Verifies whether the tag is defines for message by type of message
      Parameters:
      shortName - the type of message
      tagNum - the tag
      Returns:
      true if defines, otherwise false
    • hasRequiredTagInMessage

      public boolean hasRequiredTagInMessage(List<?> list, FIXFieldList fieldList)
      Checks if fields list of message contains tags from block
      Parameters:
      list - the list of field of block
      fieldList - the field list of message
      Returns:
      true if contains in otherwise false
    • hasRequiredTagInMessage

      public boolean hasRequiredTagInMessage(List<?> list, FIXFieldList fieldList, boolean withInternalGroup)
    • getGroupTagsWithInternalGroups

      public Map<Integer,Field> getGroupTagsWithInternalGroups(String msgType, int groupTag, FIXFieldList fieldList)
      Gets group tags, the returned result includes the inner groups.
      Parameters:
      msgType - the message type
      groupTag - the group tag
      fieldList - the list of fields
    • getGroupTagsWithOutInternalGroups

      public Map<Integer,Field> getGroupTagsWithOutInternalGroups(String msgType, int tag, FIXFieldList fieldList)
      Gets group tags, the returned result does not include the inner groups.
      Parameters:
      msgType - the message type
      tag - the tag
      fieldList - the list of fields
    • getGroupsTags

      public Map<Integer,Field> getGroupsTags(String msgType, int groupTag, FIXFieldList fieldList, boolean withInternalGroup)
      Gets group tags.
      Parameters:
      msgType - the message type
      groupTag - the group tag
      fieldList - the list of fields
      withInternalGroup - if flag is true the inner groups will be included
    • isKnownTag

      public boolean isKnownTag(int tag)
      Checks if tag exist.
      Parameters:
      tag - the tag
    • isGroupTag

      public boolean isGroupTag(String msgType, int groupTag)
      Checks if group groupTag defined for message type msgType
      Parameters:
      groupTag - the group tag
      msgType - the message type
    • getStartTagForGroup

      public int getStartTagForGroup(String msgType, int tag)
      Returns start tag for group by goup tag.
      Parameters:
      msgType - Type of message.
      tag - Tag of Group length.
      Returns:
      Start field tag of group, if msgType does not exist return -1
    • getMessageDefUtils

      public MessageDefinitionsUtils getMessageDefUtils()
      Method getDefUtils returns the defUtils of this FixUtils object.
      Returns:
      the defUtils (type MessageDefUtils) of this FixUtils object.
    • getBlockDefUtils

      public BlockDefinitionsUtils getBlockDefUtils()
      Method getBlockDefUtils returns the blockDefUtils of this FixUtils object.
      Returns:
      the blockDefUtils (type BlockDefUtils) of this FixUtils object.
    • getFixdic

      public com.epam.fix.dictionary.Dictionaries getFixdic()
      Method getFixdic returns the fixdic of this FixUtils object.
      Returns:
      the fixdic (type Fixdic) of this FixUtils object.
    • getSmhDef

      public Blockdef getSmhDef()
      Method getSmhDef returns the smhDef of this FixUtils object.
      Returns:
      the smhDef (type Blockdef) of this FixUtils object.
    • getSmtDef

      public Blockdef getSmtDef()
      Method getSmtDef returns the smtDef of this FixUtils object.
      Returns:
      the smtDef (type Blockdef) of this FixUtils object.
    • getFieldDefsHier

      public List<Object> getFieldDefsHier(List<?> fieldsWithGroupsAndBlocks)
      Gets the collection of field defs.
      Parameters:
      fieldsWithGroupsAndBlocks - the collection with fields, groups and blocks
    • getFieldDefs

      public List<Fielddef> getFieldDefs(List<?> fieldsWithGroupsAndBlocks, boolean useGroupTags)
      Gets the collection of field defs.
      Parameters:
      fieldsWithGroupsAndBlocks - the collection with fields, groups and blocks
      useGroupTags - the flag provides to include the fields of group to result collection
    • getFieldDefsWithNewAlghorithm

      public List<Fielddef> getFieldDefsWithNewAlghorithm(List<?> fieldsWithGroupsAndBlocks, boolean useGroupTags)
    • getFieldsTags

      public List<Integer> getFieldsTags(List<?> list)
      Returns list of tags of fields from input list.
      Parameters:
      list - Input list
      Returns:
      List of tags of fields
    • getFields

      public List<Field> getFields(List<?> list)
      Returns list of tags of fields from input list.
      Parameters:
      list - Input list
      Returns:
      List of tags of fields
    • getFields

      public List<Field> getFields(String messageType)
      Returns list of tags of fields from input list.
      Parameters:
      messageType - the type of FIX Message.
      Returns:
      List of tags of fields
    • getTagInfoAboutGroup

      public GroupTagInfo getTagInfoAboutGroup(List<Object> fieldOrDescrOrAlias, int tag)
    • countLengthForGroupUnit

      public int countLengthForGroupUnit(FIXField[] message, int indexOfGroupTags, int startGroupTag, FIXField lengthOfGroupTag, Set<Integer> stackOfGroupsTag, String messageType, int rootGroupStartTag)
      Counts the group length.
      Parameters:
      message - the message
      indexOfGroupTags - the index of group tag
      startGroupTag - the start group tag
      lengthOfGroupTag - the length of group tag
      stackOfGroupsTag - the group tags
      messageType - the message type
      rootGroupStartTag - the root group start tag
    • countLengthForGroupUnit

      public int countLengthForGroupUnit(FIXFieldList message, int indexOfGroupTags, int startGroupTag, FIXField lengthOfGroupTag, Set<Integer> stackOfGroupsTag, String messageType, int rootGroupStartTag)
      Counts the group length.
      Parameters:
      message - the message
      indexOfGroupTags - the index of group tag
      startGroupTag - the start group tag
      lengthOfGroupTag - the length of group tag
      stackOfGroupsTag - the group tags
      messageType - the message type
      rootGroupStartTag - the root group start tag
    • countLengthForOneGroupUnit

      public int countLengthForOneGroupUnit(FIXField[] message, int indexOfGroupTags, int startGroupTag, FIXField lengthOfGroupTag, Set<Integer> stackOfGroupsTag, String messageType, int rootGroupStartTag)
      Counts the group length.
      Parameters:
      message - the message
      indexOfGroupTags - the index of group tag
      startGroupTag - the start group tag
      lengthOfGroupTag - the length of group tag
      stackOfGroupsTag - the group tags
      messageType - the message type
      rootGroupStartTag - the root group start tag
    • countLengthForOneGroupUnit

      public int countLengthForOneGroupUnit(FIXFieldList message, int indexOfGroupTags, int startGroupTag, FIXField lengthOfGroupTag, Set<Integer> stackOfGroupsTag, String messageType, int rootGroupStartTag)
      Counts the group length.
      Parameters:
      message - the message
      indexOfGroupTags - the index of group tag
      startGroupTag - the start group tag
      lengthOfGroupTag - the length of group tag
      stackOfGroupsTag - the group tags
      messageType - the message type
      rootGroupStartTag - the root group start tag
    • getField

      public Field getField(String msgType, Integer tag)
      Gets the field.
      Parameters:
      msgType - the message type
      tag - the tag
      Returns:
      field if tag occurred otherwise nl
    • isRequiredTag

      public boolean isRequiredTag(String msgType, Integer tag)
      Checks if tag is required for message type.
      Parameters:
      msgType - the message type
      tag - the tag
    • getGroupsCache

      public GroupsCache getGroupsCache(String msgType)
    • isMessageContainField

      public boolean isMessageContainField(String messageType, int tag)
      Checks if message body contain tag. Note: tags from group ignored.
      Parameters:
      messageType - the message type
      tag - the tag
    • getValblockdef

      public Valblockdef getValblockdef(String idRef)
      Gets valblockdef by idRef.
      Parameters:
      idRef - the id ref name
      Returns:
      Valblockdef
    • descrToHtmlStr

      public static String descrToHtmlStr(Descr descr) throws Exception
      Throws:
      Exception
    • commentToHtmlStr

      public static String commentToHtmlStr(Comment comment) throws Exception
      Throws:
      Exception