Package uk.co.real_logic.sbe.xml
Class Type
java.lang.Object
uk.co.real_logic.sbe.xml.Type
- Direct Known Subclasses:
CompositeType,EncodedDataType,EnumType,SetType
An SBE type. One of encodedDataType, compositeType, enumType, or setType per the SBE spec.
-
Constructor Summary
ConstructorsConstructorDescriptionType(String name, String packageName, Presence presence, String description, int sinceVersion, int deprecated, String semanticType) Construct a new Type from direct values.Type(String name, Presence presence, String description, int sinceVersion, int deprecated, String semanticType) Construct a new Type from direct values.Construct a new Type from XML Schema. -
Method Summary
Modifier and TypeMethodDescriptionintVersion in which type was deprecated.The description of the Type (if set) or null.abstract intThe encodedLength (in octets) of the Type.abstract booleanIs the type variable length when encoded.name()The name of the type.intThe offset attribute of theTypefrom the schema.voidoffsetAttribute(int offsetAttribute) Set the offset attribute of theTypefrom the schema.The packageName attribute of theTypefrom the schema.presence()ThePresenceof the type.Get the name of the type field is from a reference.The FIX semanticType of the Type.intThe version since this was added to the template.voidsinceVersion(int version) Set the sinceVersion for the type.
-
Constructor Details
-
Type
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 typedeprecated- version in which this was deprecated.semanticType- of the type or null.
-
-
Method Details
-
name
The name of the type.- Returns:
- name of the Type.
-
referencedName
Get the name of the type field is from a reference.- Returns:
- the name of the type field is from a reference.
-
presence
ThePresenceof the type.- Returns:
Presenceof 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
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
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 theTypefrom 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 theTypefrom the schema.- Parameters:
offsetAttribute- to set.
-
packageName
The packageName attribute of theTypefrom the schema.- Returns:
- the packageName attribute value or null, if not explicitly defined by the schema.
-