Class XTCEArgument

  • All Implemented Interfaces:
    Comparable

    public class XTCEArgument
    extends XTCETypedObject
    This class serves as a convenient container for representing Telecommand Arguments in the XTCE data model by abstracting the mechanics of assembling Argument attributes that are derived from XTCE related rules of processing, which can include processing of Argument, Member, and Type elements. This class endeavors to generate a minimum of additional data, storing almost entirely references to objects already created in other parts of the data model. An exception to this is the list of Aliases, which requires some logic to arrive at. This one time creation of the alias information is expected to increase performance by reducing redundant need to deduce the information. If aliases are not used on the project, then this will have minimal to no impact on the processing times.
    Author:
    David Overeem
    • Method Detail

      • getTypeReferenceFullPath

        public final String getTypeReferenceFullPath()
        Retrieves the fully qualified XTCE path reference to the type that describes this argument.
        Returns:
        String containing the path or an empty string if there is an error case and there is no type reference.
      • getShortDescription

        public final String getShortDescription()
        Retrieves the "effective" Short Description of this Argument or Member in the XTCE data model. The "effective" Short Description is defined as the shortDescription attribute that first appears on the Argument element, and if not present, then it can fall back to the shortDescription attribute that is on the Argument Type element, and eventually fall back to returning an empty string if neither of these contains a shortDescription attribute.
        Returns:
        String containing the Short Description of this Argument or Member, or an empty string if there is none. This function endeavors to never return null.
      • getLongDescription

        public final String getLongDescription()
        Retrieves the "effective" Long Description of this Argument or Member in the XTCE data model. The "effective" Long Description is defined as the LongDescription element that first appears on the Argument element, and if not present, then it can fall back to the LongDescription element that is on the Argument Type element, and eventually fall back to returning an empty string if neither of these contains a LongDescription element.
        Returns:
        String containing the Long Description of this Argument or Member, or an empty string if there is none. This function endeavors to never return null.
      • getDescription

        public final String getDescription()
        Retrieves the preferred effective description of this Argument or Member in the XTCE data model. This method prefers the shortDescription attribute on the primary element and then the Long Description element of the primary element. In the event at that are not present or empty, it will attempt to get the shortDescription atrribute from the type element and if that is not present or empty, the Long Description element. Members will also get from the type element.
        Returns:
        String containing a single description text item for this Argument or Member, generally suitable for display tables. The String will never be null.
      • getInitialValue

        public String getInitialValue()
        Accessor to retrieve the "initial" or "default" value of the Argument or Member represented by this object, considering the XTCE data model rules. This method first examines whether there is an initialValue attribute on the Argument element (cannot appear on the Member element) and if not present, then it looks for this attribute on the Argument Type element.
        Overrides:
        getInitialValue in class XTCETypedObject
        Returns:
        The initial or default value of the Argument, or an empty string. This method endeavors to never return a null string.
      • isMember

        public final boolean isMember()
        Accessor to determine if this XTCEArgument object represents a Member element in the XTCE data model.
        Returns:
        boolean indicating if this is a Member element object in the XTCE data model.
      • isArgument

        public final boolean isArgument()
        Accessor to determine if this XTCEArgument object represents a Argument element in the XTCE data model.
        Returns:
        boolean indicating if this is a Argument element object in the XTCE data model.
      • toXml

        public String toXml()
                     throws XTCEDatabaseException
        Retrieve a string of the XML text for this Argument element.
        Returns:
        String containing the XML as formatted text.
        Throws:
        XTCEDatabaseException - in the event that the elements being marshaled from the JAXB internal classes cannot make a valid document. Check the exception message for causality information.
      • typeToXml

        public String typeToXml()
                         throws XTCEDatabaseException
        Retrieve an XML string that represents this argument object's "type" element. This method overrides the one provided in XTCETypedObject because the element name and class name for Argument Types do not align in XTCE 1.2. From ArgumentTypeSetType: (name = "StringArgumentType", type = StringDataType.class), (name = "EnumeratedArgumentType", type = EnumeratedDataType.class), (name = "IntegerArgumentType", type = ArgumentTypeSetType.IntegerArgumentType.class), (name = "BinaryArgumentType", type = BinaryDataType.class), (name = "FloatArgumentType", type = ArgumentTypeSetType.FloatArgumentType.class), (name = "BooleanArgumentType", type = BooleanDataType.class), (name = "RelativeTimeAgumentType", type = RelativeTimeDataType.class), (name = "AbsoluteTimeArgumentType", type = AbsoluteTimeDataType.class), (name = "ArrayArgumentType", type = ArrayDataTypeType.class), (name = "AggregateArgumentType", type = AggregateDataType.class)
        Overrides:
        typeToXml in class XTCETypedObject
        Returns:
        String containing the XML fragment.
        Throws:
        XTCEDatabaseException - in the event that the XML could not be marshaled to the string.