Package org.xtce.toolkit
Class XTCETelecommand
- java.lang.Object
-
- org.xtce.toolkit.XTCENamedObject
-
- org.xtce.toolkit.XTCETelecommand
-
- All Implemented Interfaces:
Comparable
public class XTCETelecommand extends XTCENamedObject
This class serves as a convenient container for representing Telecommands from the XTCE data model by abstracting the mechanics of assembling the Argument and 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. The two key exceptions to this are the Aliases and the TC Arguments. These are preprocessed during construction of the object for later convenience. At present, Aliases do not apply through the inheritance chain. The author is not sure if they should or not.- Author:
- David Overeem
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XTCEArgumentgetArgument(String name)Retrieve a named Argument object from this Telecommand object.List<XTCEArgument>getArguments()Retrieve the list of XTCEArgument objects that were constructed for this XTCETelecommand, which includes all inherited Argument elements, in addition to those defined with this XTCETelecommand.CommandMetaDataType.MetaCommandSet.BlockMetaCommandgetBlockMetaCommandReference()Retrieve a reference to the underlying BlockMetaCommand element in the XTCE data model.XTCETCContainergetCommandContainer()Retrieve a reference to the underlying CommandContainer element within a MetaCommand element.StringgetDescription()Retrieves the preferred effective description of this Telecommand in the XTCE data model.StringgetInheritancePath()Retrieve the inheritance path for this MetaCommand element.StringgetLongDescription()Retrieve the Long Description element text content.MetaCommandTypegetMetaCommandReference()Retrieve a reference to the underlying MetaCommand element in the XTCE data model.StringgetShortDescription()Retrieve the short description attribute.booleanisAbstract()Retrieve the abstract attribute flag for this XTCETelecommand.booleanisBlockMetaCommand()Retrieve whether or not this XTCETelecommand represents a BlockMetaCommand element in the underlying XTCE data model.booleanisMetaCommand()Retrieve whether or not this XTCETelecommand represents a MetaCommand element in the underlying XTCE data model.voidsetLongDescription(String description)Set the long description element text content.voidsetShortDescription(String description)Set the short description attribute.StringtoXml()Retrieve an XML string that represents this MetaCommand element.-
Methods inherited from class org.xtce.toolkit.XTCENamedObject
compareTo, equals, getAlias, getAliasSet, getAncillaryData, getAncillaryData, getFullPath, getName, getPrimaryLongDescription, getPrimaryShortDescription, getSpaceSystemName, getSpaceSystemPath, hashCode, populateAliasListFromReference, setPrimaryLongDescription, setPrimaryShortDescription
-
-
-
-
Method Detail
-
getInheritancePath
public final String getInheritancePath()
Retrieve the inheritance path for this MetaCommand element. The "inheritance path" is different from the SpaceSystem locating path in that it represents the parent MetaCommand elements leading to this element through the BaseContainer element in the XTCE data model. This does not apply to BlockMetaCommand elements.- Returns:
- String containing the inheritance path to this telecommand.
- See Also:
isMetaCommand(),isBlockMetaCommand()
-
isMetaCommand
public final boolean isMetaCommand()
Retrieve whether or not this XTCETelecommand represents a MetaCommand element in the underlying XTCE data model.- Returns:
- boolean true if this object represents a MetaCommand element or false if it represents a BlockMetaCommand element.
-
isBlockMetaCommand
public final boolean isBlockMetaCommand()
Retrieve whether or not this XTCETelecommand represents a BlockMetaCommand element in the underlying XTCE data model.- Returns:
- boolean true if this object represents a BlockMetaCommand element or false if it represents a MetaCommand element.
-
getMetaCommandReference
public final MetaCommandType getMetaCommandReference()
Retrieve a reference to the underlying MetaCommand element in the XTCE data model.- Returns:
- MetaCommandType object if this XTCETelecommand object represents a MetaCommand element in the XTCE data model, or null if it represents the other case of a BlockMetaCommand element.
- See Also:
isMetaCommand(),isBlockMetaCommand()
-
getBlockMetaCommandReference
public final CommandMetaDataType.MetaCommandSet.BlockMetaCommand getBlockMetaCommandReference()
Retrieve a reference to the underlying BlockMetaCommand element in the XTCE data model.- Returns:
- BlockMetaCommand object if this XTCETelecommand object represents a BlockMetaCommand element in the XTCE data model, or null if it represents the other case of a MetaCommand element.
- See Also:
isMetaCommand(),isBlockMetaCommand()
-
getCommandContainer
public final XTCETCContainer getCommandContainer()
Retrieve a reference to the underlying CommandContainer element within a MetaCommand element.- Returns:
- XTCETCContainer object or null if there is no CommandContainer element for this XTCETelecommand, which will always be the case if the object represents a BlockMetaCommand element.
- See Also:
isMetaCommand(),isBlockMetaCommand()
-
getArgument
public final XTCEArgument getArgument(String name) throws XTCEDatabaseException
Retrieve a named Argument object from this Telecommand object.- Parameters:
name- String containing the name of the Argument to retrieve.- Returns:
- XTCEArgument object that represents the named requested argument that is a part of this Telecommand object.
- Throws:
XTCEDatabaseException- in the event that the argument does not exist in the scope of this telecommand.
-
getArguments
public final List<XTCEArgument> getArguments()
Retrieve the list of XTCEArgument objects that were constructed for this XTCETelecommand, which includes all inherited Argument elements, in addition to those defined with this XTCETelecommand.- Returns:
- List of XTCEArgument objects, or an empty list is there are no Arguments. This list will never be null.
-
isAbstract
public final boolean isAbstract()
Retrieve the abstract attribute flag for this XTCETelecommand. The abstract flag indicates that this XTCETelecommand is based on a representation of a MetaCommand element in the XTCE data model and that it is not intended to be instantiated for transmission, rather used as a BaseMetaCommand for a specific telecommand.- Returns:
- boolean indicating if this XTCETelecommand object represents an abstract MetaCommand element in the XTCE data model.
-
getShortDescription
public final String getShortDescription()
Retrieve the short description attribute.- Returns:
- String containing the short description or an empty string. The return value will never be null.
-
setShortDescription
public final void setShortDescription(String description)
Set the short description attribute.- Parameters:
description- String containing the new description, which can be empty or null, which in either case will remove the short description attribute for brevity on the XML document.
-
getLongDescription
public final String getLongDescription()
Retrieve the Long Description element text content.- Returns:
- String containing the long description or an empty string. The return value will never be null.
-
setLongDescription
public final void setLongDescription(String description)
Set the long description element text content.- Parameters:
description- String containing the new description, which can be empty or null, which in either case will remove the long description element for brevity on the XML document.
-
getDescription
public final String getDescription()
Retrieves the preferred effective description of this Telecommand in the XTCE data model. This method prefers the shortDescription attribute if it exists. If it does not, then the LongDescription element will be returned if present.- Returns:
- String containing a single description text item for this Container, generally suitable for display tables. The String will never be null.
-
toXml
public final String toXml() throws XTCEDatabaseException
Retrieve an XML string that represents this MetaCommand 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.
-
-