Class Type

java.lang.Object
uk.co.real_logic.sbe.xml.Type
Direct Known Subclasses:
CompositeType, EncodedDataType, EnumType, SetType

public abstract class Type extends Object
An SBE type. One of encodedDataType, compositeType, enumType, or setType per the SBE spec.
  • Constructor Details

    • Type

      public Type(Node node, String givenName, String referencedName)
      Construct a new Type from XML Schema. Called by subclasses to mostly set common fields
      Parameters:
      node - from the XML Schema Parsing.
      givenName - of this node, if null then the attributed name will be used.
      referencedName - of the type when created from a ref in a composite.
    • Type

      public Type(String name, Presence presence, String description, int sinceVersion, int deprecated, String semanticType)
      Construct a new Type from direct values.
      Parameters:
      name - of the type.
      presence - of the type.
      description - of the type or null.
      sinceVersion - for the type.
      deprecated - version in which this was deprecated.
      semanticType - of the type or null.
    • Type

      public Type(String name, String packageName, Presence presence, String description, int sinceVersion, int deprecated, String semanticType)
      Construct a new Type from direct values.
      Parameters:
      name - of the type.
      packageName - of the type.
      presence - of the type.
      description - of the type or null.
      sinceVersion - for the type
      deprecated - version in which this was deprecated.
      semanticType - of the type or null.
  • Method Details

    • name

      public String name()
      The name of the type.
      Returns:
      name of the Type.
    • referencedName

      public String referencedName()
      Get the name of the type field is from a reference.
      Returns:
      the name of the type field is from a reference.
    • presence

      public Presence presence()
      The Presence of the type.
      Returns:
      Presence of the type.
    • encodedLength

      public abstract int encodedLength()
      The encodedLength (in octets) of the Type.

      Overridden by subtypes. This returns 0 by default.

      Returns:
      encodedLength of the type in octets
    • description

      public String description()
      The description of the Type (if set) or null.
      Returns:
      description set by the type or null.
    • sinceVersion

      public int sinceVersion()
      The version since this was added to the template.
      Returns:
      version since this was added to the template.
    • sinceVersion

      public void sinceVersion(int version)
      Set the sinceVersion for the type.
      Parameters:
      version - to be set.
    • deprecated

      public int deprecated()
      Version in which type was deprecated. Only valid if greater than zero.
      Returns:
      version in which the type was deprecated.
    • semanticType

      public String semanticType()
      The FIX semanticType of the Type.
      Returns:
      FIX semanticType of the Type if set or null if not set.
    • isVariableLength

      public abstract boolean isVariableLength()
      Is the type variable length when encoded.
      Returns:
      true if the type is variable length when encoded.
    • offsetAttribute

      public int offsetAttribute()
      The offset attribute of the Type from the schema.
      Returns:
      the offset attribute value or -1 to indicate not set by the schema.
    • offsetAttribute

      public void offsetAttribute(int offsetAttribute)
      Set the offset attribute of the Type from the schema.
      Parameters:
      offsetAttribute - to set.
    • packageName

      public String packageName()
      The packageName attribute of the Type from the schema.
      Returns:
      the packageName attribute value or null, if not explicitly defined by the schema.