Package org.xtce.toolkit
Class XTCETypedObject
- java.lang.Object
-
- org.xtce.toolkit.XTCENamedObject
-
- org.xtce.toolkit.XTCETypedObject
-
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
XTCEArgument,XTCEParameter
public abstract class XTCETypedObject extends XTCENamedObject
The XTCETypedObject class extends the basic XTCENamedObject class to serve by capturing the named objects that have specific type element associated with them, such as Parameter, Arguments, and Members.- Author:
- David Overeem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXTCETypedObject.EngineeringTypeEnumeration representing the Calibrated/Engineering type of an item in the XTCE data model.static classXTCETypedObject.RawTypeEnumeration representing the Raw/Encoding type of an item in the XTCE data model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DescriptionType.AncillaryDataSet.AncillaryData>getAncillaryData()Accessor to retrieve the list of AncillaryData elements from the XTCE model that apply to this typed object, but it a Parameter, Argument, or Member.List<DescriptionType.AncillaryDataSet.AncillaryData>getAncillaryData(String nameGlob)Accessor to retrieve only a partial list of AncillaryData elements from the XTCE data for this typed object where the name attribute of the AncillaryData element must either exactly match a string or a glob style pattern.StringgetChangeThreshold()Accessor to retrieve the changeThreshold attribute from the encoding of this Parameter, Argument, or Member, which is sometimes viewed as an "aperture" or minimum "observability" for change.List<ContextCalibratorType>getContextCalibrators()Retrieves the List of ContextCalibratorType elements from the JAXB generated classes that is attached to this type.CalibratorTypegetDefaultCalibrator()Retrieves the default CalibratorType from the JAXB generated classes that is attached to this type, or null if this type has no default Calibrator.XTCETypedObject.EngineeringTypegetEngineeringType()Accessor to return a descriptive name for the Engineering or Operator type of this Parameter, Argument, or Member represented by this object.StringgetEngineeringTypeString()Accessor to return a descriptive name for the Engineering or Operator type of this Parameter, Argument, or Member represented by this object.List<ValueEnumerationType>getEnumerations()Retrieves the enumerations for the Parameter, Argument, or Member represented by this type.protected StringgetInitialValue()Accessor to retrieve the "initial" or "default" value of the type represented by this object, considering the XTCE data model rules.StringgetRawBitOrder()Accessor to determine the bit ordering from the encoding node of the Type that describes this Parameter, Argument, or Member element.StringgetRawSizeInBits()Retrieves the size in bits of the raw encoded value for this type of Parameter, Argument, or Member.XTCETypedObject.RawTypegetRawType()Retrieves a short name for the raw encoding type of this named and typed object in the XTCE data model.StringgetRawTypeString()Retrieves a short name for the raw encoding type of this named and typed object in the XTCE data model.NameDescriptionTypegetTypeReference()Accessor to retrieve a reference to the Parameter or Argument Type object that is kept as a reference for this typed and named object.StringgetUnits()Retrieve the units of measure and the nature/description for this named and typed object in the XTCE data model.XTCEValidRangegetValidRange()Accessor to retrieve the ValidRange element information from this named and typed object in the XTCE data model.booleanhasContextCalibrators()Method to determine if this typed object has a list of context calibrators.booleanhasDefaultCalibrator()Method to determine if this typed object has a default calibrator.booleanisValid()Accessor to determine if this named and types object is valid in the XTCE document.StringtypeToXml()Retrieve an XML string that represents this typed object's "type" element.-
Methods inherited from class org.xtce.toolkit.XTCENamedObject
compareTo, equals, getAlias, getAliasSet, getFullPath, getName, getPrimaryLongDescription, getPrimaryShortDescription, getSpaceSystemName, getSpaceSystemPath, hashCode, populateAliasListFromReference, setPrimaryLongDescription, setPrimaryShortDescription
-
-
-
-
Method Detail
-
getTypeReference
public final NameDescriptionType getTypeReference()
Accessor to retrieve a reference to the Parameter or Argument Type object that is kept as a reference for this typed and named object.- Returns:
- NameDescriptionType object that serves as the base class for the varies Parameter and Argument Types. It will need to be downcast to access certain attributes.
-
isValid
public final boolean isValid()
Accessor to determine if this named and types object is valid in the XTCE document.- Returns:
- boolean indicating if this is a valid named and typed object based on whether the type is null.
-
getAncillaryData
public List<DescriptionType.AncillaryDataSet.AncillaryData> getAncillaryData()
Accessor to retrieve the list of AncillaryData elements from the XTCE model that apply to this typed object, but it a Parameter, Argument, or Member. This accessor filters duplicates in preference for those that are defined on the named object. Duplicate is determined when both the name attribute and the value are the same.- Overrides:
getAncillaryDatain classXTCENamedObject- Returns:
- List of AncillaryData elements that apply. The caller cannot differentiate from this function if those came from the named object or the typed object.
-
getAncillaryData
public List<DescriptionType.AncillaryDataSet.AncillaryData> getAncillaryData(String nameGlob)
Accessor to retrieve only a partial list of AncillaryData elements from the XTCE data for this typed object where the name attribute of the AncillaryData element must either exactly match a string or a glob style pattern. Since the name attribute of an AncillaryData element does not qualify uniqueness, multiple results can still be retrieved when doing an exact match.- Overrides:
getAncillaryDatain classXTCENamedObject- Parameters:
nameGlob- String containing a precise name or a glob style pattern to match against the name attribute of the AncillaryData elements.- Returns:
- List of AncillaryData elements that match. The list can be empty but it will never be null.
-
getUnits
public final String getUnits()
Retrieve the units of measure and the nature/description for this named and typed object in the XTCE data model. Not all types have an associated unit. Arrays, Structures/Aggregates, do not. TODO: Add Absolute/Relative time unit support. This function currently only supports 1 Unit element in the UnitSet element of the XTCE data model.- Returns:
- String containing the units:description, e.g. meters:distance for this object, or an empty string in the event that there are no Unit elements defined.
-
getInitialValue
protected String getInitialValue()
Accessor to retrieve the "initial" or "default" value of the type represented by this object, considering the XTCE data model rules.- Returns:
- The initial or default value of the type, or an empty string. This method endeavors to never return a null string.
-
getChangeThreshold
public String getChangeThreshold()
Accessor to retrieve the changeThreshold attribute from the encoding of this Parameter, Argument, or Member, which is sometimes viewed as an "aperture" or minimum "observability" for change. The changeThreshold attribute is only applicable for integer and float encoding types. Other types should generally be assumed that ANY change is observable.- Returns:
- String containing the value or an empty string if the value is not set or is not applicable. This function endeavors to never return a null value.
-
getValidRange
public final XTCEValidRange getValidRange()
Accessor to retrieve the ValidRange element information from this named and typed object in the XTCE data model.- Returns:
- XTCEValidRange containing the information gathered.
-
getEngineeringTypeString
public final String getEngineeringTypeString()
Accessor to return a descriptive name for the Engineering or Operator type of this Parameter, Argument, or Member represented by this object. The Type element is not a perfect mapping to the return value of this function. The possible values are:- ENUMERATED - Represents Enumerated Type
- SIGNED - Represents Integer Type with signed="true"
- UNSIGNED - Represents Integer Type with signed="false"
- FLOAT32 - Represents Float Type with sizeInBits="32"
- FLOAT64 - Represents Float Type with sizeInBits="64"
- FLOAT128 - Represents Float Type with sizeInBits="128"
- STRUCTURE - Represents an Aggregate Type
- BINARY - Represents a Binary Type
- BOOLEAN - Represents a Boolean Type
- STRING - Represents a String Type
- TIME - Represents an Absolute Time Type
- DURATION - Represents a Relative Time Type
- ARRAY - Represents an Array Type
- Returns:
- String containing the abstracted name of the Engineering or Operator type associated with this Parameter, Argument, or Member, or an empty string if that is not located. This function endeavors to never return a null value.
-
getEngineeringType
public final XTCETypedObject.EngineeringType getEngineeringType()
Accessor to return a descriptive name for the Engineering or Operator type of this Parameter, Argument, or Member represented by this object. The Type element is not a perfect mapping to the return value of this function. The possible values are:- ENUMERATED - Represents Enumerated Type
- SIGNED - Represents Integer Type with signed="true"
- UNSIGNED - Represents Integer Type with signed="false"
- FLOAT32 - Represents Float Type with sizeInBits="32"
- FLOAT64 - Represents Float Type with sizeInBits="64"
- FLOAT128 - Represents Float Type with sizeInBits="128"
- STRUCTURE - Represents an Aggregate Type
- BINARY - Represents a Binary Type
- BOOLEAN - Represents a Boolean Type
- STRING - Represents a String Type
- TIME - Represents an Absolute Time Type
- DURATION - Represents a Relative Time Type
- ARRAY - Represents an Array Type
- Returns:
- EngineeringType enumeration containing the abstracted name of the Engineering or Operator type associated with this Parameter, Argument, or Member.
-
getRawTypeString
public final String getRawTypeString()
Retrieves a short name for the raw encoding type of this named and typed object in the XTCE data model. Currently recognized raw encoding types consist of:- unsigned - Unsigned Integer
- signMagnitude - Signed Integer using high bit to indicate sign
- onesComplement - Signed Integer using ones complement formula
- twosComplement - Signed Integer using twos complement formula
- BCD - Binary Coded Data
- packedBCD - Packed Binary Coded Data
- binary - Plain binary data field
- IEEE754_1985 - Most common floating point encoding approximation
- MILSTD_1750A - MIL Standard floating point encoding approximation
- UTF-8 - 8 Bit String Encoding
- UTF-16 - 16 Bit String Encoding (wide characters)
- Returns:
- String containing the short type name. The function endeavors to never return null. If no type is recognized, it will return an empty string.
-
getRawType
public final XTCETypedObject.RawType getRawType()
Retrieves a short name for the raw encoding type of this named and typed object in the XTCE data model. Currently recognized raw encoding types consist of:- unsigned - Unsigned Integer
- signMagnitude - Signed Integer using high bit to indicate sign
- onesComplement - Signed Integer using ones complement formula
- twosComplement - Signed Integer using twos complement formula
- BCD - Binary Coded Data
- packedBCD - Packed Binary Coded Data
- binary - Plain binary data field
- IEEE754_1985 - Most common floating point encoding approximation
- MILSTD_1750A - MIL Standard floating point encoding approximation
- UTF-8 - 8 Bit String Encoding
- UTF-16 - 16 Bit String Encoding (wide characters)
- Returns:
- RawType enumeration containing the short type name. The function endeavors to never return null.
-
getRawBitOrder
public final String getRawBitOrder()
Accessor to determine the bit ordering from the encoding node of the Type that describes this Parameter, Argument, or Member element.- Returns:
- String containing "mostSignificantBitFirst" or the opposite, "leastSignificantBitFirst". The returned string will never be null.
-
getRawSizeInBits
public final String getRawSizeInBits()
Retrieves the size in bits of the raw encoded value for this type of Parameter, Argument, or Member.- Returns:
- String containing the number of bits or the word "dynamic" if the count is variable. String can also be empty if this type is not valid. In that case, the user should test for validity of this type using the isValid() method.
-
getEnumerations
public final List<ValueEnumerationType> getEnumerations()
Retrieves the enumerations for the Parameter, Argument, or Member represented by this type. This method currently provides direct access to the JAXB List of ValueEnumerationType objects because it is not apparent that wrapping this with anything makes any added value. There is no corresponding setter method because the direct reference can be modified.- Returns:
- List of ValueEnumerationType objects. The return will be null in the event that the underlying type is not an Enumerated Type, which can be tested with the getEngineeringType() method.
-
getDefaultCalibrator
public final CalibratorType getDefaultCalibrator()
Retrieves the default CalibratorType from the JAXB generated classes that is attached to this type, or null if this type has no default Calibrator.- Returns:
- CalibratorType containing the Default Calibrator element for this type, or a null pointer if there is not a default calibrator.
-
hasDefaultCalibrator
public final boolean hasDefaultCalibrator()
Method to determine if this typed object has a default calibrator.- Returns:
- boolean true if a default calibrator exists or false if not.
-
getContextCalibrators
public final List<ContextCalibratorType> getContextCalibrators()
Retrieves the List of ContextCalibratorType elements from the JAXB generated classes that is attached to this type.- Returns:
- List of ContextCalibratorType elements for this type, or a null pointer if there aren't any context calibrators.
-
hasContextCalibrators
public final boolean hasContextCalibrators()
Method to determine if this typed object has a list of context calibrators.- Returns:
- boolean true if a list exists or false if not.
-
typeToXml
public String typeToXml() throws XTCEDatabaseException
Retrieve an XML string that represents this typed object's "type" element.- Returns:
- String containing the XML fragment.
- Throws:
XTCEDatabaseException- in the event that the XML could not be marshaled to the string.
-
-