Package org.xtce.toolkit
Class XTCEParameter
- java.lang.Object
-
- org.xtce.toolkit.XTCENamedObject
-
- org.xtce.toolkit.XTCETypedObject
-
- org.xtce.toolkit.XTCEParameter
-
- All Implemented Interfaces:
Comparable
public class XTCEParameter extends XTCETypedObject
This class serves as a convenient container for representing TM and TC Parameters in the XTCE data model by abstracting the mechanics of assembling Parameter attributes that are derived from XTCE related rules of processing, which can include processing of Parameter, 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.xtce.toolkit.XTCETypedObject
XTCETypedObject.EngineeringType, XTCETypedObject.RawType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDataSource()Accessor to retrieve the dataSource attribute from the ParameterProperties element.StringgetDescription()Retrieves the preferred effective description of this Parameter or Member in the XTCE data model.StringgetInitialValue()Accessor to retrieve the "initial" or "default" value of the Parameter or Member represented by this object, considering the XTCE data model rules.StringgetLongDescription()Retrieves the "effective" Long Description of this Parameter or Member in the XTCE data model.AggregateDataType.MemberList.MembergetMemberReference()Retrieve the underlying Member element from the XTCE data model.ParameterSetType.ParametergetParameterReference()Retrieve the underlying Parameter element from the XTCE data model.StringgetShortDescription()Retrieves the "effective" Short Description of this Parameter or Member in the XTCE data model.StringgetSystemName()Accessor to retrieve the content of the SystemName element in the XTCE Parameter element.StringgetTypeReferenceFullPath()Retrieves the fully qualified XTCE path reference to the type that describes this parameter.booleanisMember()Accessor to determine if this XTCEParameter object represents a Member element in the XTCE data model.booleanisParameter()Accessor to determine if this XTCEParameter object represents a Parameter element in the XTCE data model.booleanisReadOnly()Accessor to determine if this Parameter or Member represented by this object is in a "Read Only" state, as defined by the readOnly attribute of the ParameterProperties element.booleanisSettable()Accessor to determine if this Parameter or Member represented by this object is in a "settable" state, as defined by the readOnly attribute of the ParameterProperties element.StringtoXml()Retrieve an XML string that represents this Parameter or Member element.-
Methods inherited from class org.xtce.toolkit.XTCETypedObject
getAncillaryData, getAncillaryData, getChangeThreshold, getContextCalibrators, getDefaultCalibrator, getEngineeringType, getEngineeringTypeString, getEnumerations, getRawBitOrder, getRawSizeInBits, getRawType, getRawTypeString, getTypeReference, getUnits, getValidRange, hasContextCalibrators, hasDefaultCalibrator, isValid, typeToXml
-
Methods inherited from class org.xtce.toolkit.XTCENamedObject
compareTo, equals, getAlias, getAliasSet, getFullPath, getName, getPrimaryLongDescription, getPrimaryShortDescription, getSpaceSystemName, getSpaceSystemPath, hashCode, populateAliasListFromReference, setPrimaryLongDescription, setPrimaryShortDescription
-
-
-
-
Method Detail
-
getTypeReferenceFullPath
public final String getTypeReferenceFullPath()
Retrieves the fully qualified XTCE path reference to the type that describes this parameter.- 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 Parameter or Member in the XTCE data model. The "effective" Short Description is defined as the shortDescription attribute that first appears on the Parameter element, and if not present, then it can fall back to the shortDescription attribute that is on the Parameter 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 Parameter 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 Parameter or Member in the XTCE data model. The "effective" Long Description is defined as the LongDescription element that first appears on the Parameter element, and if not present, then it can fall back to the LongDescription element that is on the Parameter 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 Parameter 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 Parameter 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 Parameter or Member, generally suitable for display tables. The String will never be null.
-
getDataSource
public final String getDataSource()
Accessor to retrieve the dataSource attribute from the ParameterProperties element. There is a special case in the XTCE schema of this toolkit. The ParameterProperties element is allowed to also appear on the Member elements, although that is non-standard until perhaps XTCE version 1.2.- Returns:
- String containing one of the valid values for the dataSource attribute, which can be "telemetered", "local", "derived", and "constant". This function will never return null. Although a default is not declared in XTCE, this function forces the default to be "telemetered".
-
getSystemName
public final String getSystemName()
Accessor to retrieve the content of the SystemName element in the XTCE Parameter element. There is a special case in the XTCE schema of this toolkit. The ParameterProperties element is allowed to also appear on the Member elements, although that is non-standard until perhaps XTCE version 1.2. As a result, it is possible for there to be a SystemName element in this toolkit for Member elements.- Returns:
- String containing the value of the SystemName element, or an empty string if that element is not present. The value will never be null.
-
getInitialValue
public String getInitialValue()
Accessor to retrieve the "initial" or "default" value of the Parameter or Member represented by this object, considering the XTCE data model rules. This method first examines whether there is an initialValue attribute on the Parameter element (cannot appear on the Member element) and if not present, then it looks for this attribute on the Parameter Type element.- Overrides:
getInitialValuein classXTCETypedObject- Returns:
- The initial or default value of the Parameter, or an empty string. This method endeavors to never return a null string.
-
isReadOnly
public final boolean isReadOnly()
Accessor to determine if this Parameter or Member represented by this object is in a "Read Only" state, as defined by the readOnly attribute of the ParameterProperties element. There is a special case in the XTCE schema of this toolkit. The ParameterProperties element is allowed to also appear on the Member elements, although that is non-standard until perhaps XTCE version 1.2. As a result, it is possible for there to be a ParameterProperties element in this toolkit for Member elements.- Returns:
- boolean indicating if this Parameter or Member is "read only".
-
isSettable
public final boolean isSettable()
Accessor to determine if this Parameter or Member represented by this object is in a "settable" state, as defined by the readOnly attribute of the ParameterProperties element. This method is the inverse of the isReadOnly() method. There is a special case in the XTCE schema of this toolkit. The ParameterProperties element is allowed to also appear on the Member elements, although that is non-standard until perhaps XTCE version 1.2. As a result, it is possible for there to be a ParameterProperties element in this toolkit for Member elements.- Returns:
- boolean indicating if this Parameter or Member is settable.
-
isMember
public final boolean isMember()
Accessor to determine if this XTCEParameter 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.
-
getMemberReference
public final AggregateDataType.MemberList.Member getMemberReference()
Retrieve the underlying Member element from the XTCE data model. Use the isMember() method to test whether this is a member before using this method.- Returns:
- Member element or a null in the event that this is not a Member of an aggregate.
-
isParameter
public final boolean isParameter()
Accessor to determine if this XTCEParameter object represents a Parameter element in the XTCE data model.- Returns:
- boolean indicating if this is a Parameter element object in the XTCE data model.
-
getParameterReference
public final ParameterSetType.Parameter getParameterReference()
Retrieve the underlying Parameter element from the XTCE data model. Use the isParameter() method to test whether this is a member before using this method.- Returns:
- Parameter element or a null in the event that this is not a Parameter.
-
toXml
public String toXml() throws XTCEDatabaseException
Retrieve an XML string that represents this Parameter or Member element.- Returns:
- String containing the XML fragment.
- 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.
-
-