Package org.xtce.toolkit
Class XTCEContainerContentModelBase
- java.lang.Object
-
- org.xtce.toolkit.XTCEContainerContentModelBase
-
- Direct Known Subclasses:
XTCEContainerContentModel,XTCETelecommandContentModel
public abstract class XTCEContainerContentModelBase extends Object
The base class for the XTCE Container Content models captures the common elements when processing both TM and TC containers.- Author:
- David Overeem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classXTCEContainerContentModelBase.RunningStartBitThis class is a holder for the running start bit so that it can be updated in a reference that is passed down several functions deep.
-
Field Summary
Fields Modifier and Type Field Description protected StringcontainerDescription_protected StringcontainerName_protected List<XTCEContainerContentEntry>contentList_protected List<XTCEContainerEntryValue>contentValues_protected booleanexhaustedBinaryBitSupply_protected booleanshowAllConditions_protected List<XTCESpaceSystem>spaceSystems_protected longtotalContainerSize_protected ArrayList<String>warnings_
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longaddArrayEntryDescription(ArrayParameterRefEntryType refEntry, XTCEContainerContentEntry contentEntry)protected voidaddIncludeCondition(ComparisonType compare, XTCENamedObject container, XTCEContainerContentEntry content)protected voidaddIncludeConditions(SequenceEntryType entry, XTCENamedObject container, XTCEContainerContentEntry content)protected longaddRepeatEntryDescription(SequenceEntryType refEntry, XTCEContainerContentEntry contentEntry)protected voidaddStartBit(SequenceEntryType pRefEntry, XTCEContainerContentEntry contentEntry, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit)protected voidapplyBinaryValue(XTCEContainerContentEntry entry)protected voidapplyRestriction(ComparisonType compare, XTCENamedObject container)protected voidapplyRestrictions(XTCENamedObject container, MatchCriteriaType restrictions, String parentSpaceSystemPath)protected voidapplyUserValue(XTCEContainerContentEntry entry)protected voidcheckForOverlaps(long totalSizeInBits)protected longdynamicCountFromUserValue(XTCENamedObject item, String form)BitSetencodeContainer()Encode a raw binary BitSet from the processed container content model for potential file or wire transmission.protected longevaluateContainerReferenceLocation(SequenceEntryType cRefEntry, XTCEContainerContentEntry contentEntry, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit)protected voidevaluateIncludeConditions(XTCEContainerContentEntry content)BitSetextractRawValue(XTCEContainerContentEntry currentEntry)Extracts the raw binary value from a container where the binary of the container has been provided to this object.protected XTCETMContainerfindContainer(String containerRef, XTCENamedObject currentContainer)protected XTCEParameterfindParameter(String parameterRef, XTCENamedObject currentContainer)protected XTCETelecommandfindTelecommand(String metaCommandRef, XTCENamedObject currentContainer)longgetBytesRequired()Retrieve the number of bytes necessary to capture the number of bits in this container.List<XTCEContainerContentEntry>getContentList()Accessor to retrieve the container content in a pre-processed series of rows that can be iterated through.StringgetDescription()Accessor to retrieve a description of the container that this model represents.StringgetName()Accessor to retrieve the name of the container that this model represents.longgetTotalSize()Retrieve the total size/length of this container in bits.List<XTCEContainerEntryValue>getUserValues()Retrieve the current applied list of user values.List<String>getWarnings()Accessor to retrieve the list of warnings when processing this container.protected booleanisEntryConditionSatisfied(XTCEContainerContentEntry entry)protected booleanisEntryNeedingStartBit(XTCEContainerContentEntry currentEntry)booleanisProcessingCompatible(BitSet rawBits)Retrieve the compatibility of this container with the raw bits provided by the caller to determine if this is the right model object to match the binary.booleanisValid()Retrieve the container processing validity guess flag.protected voidprocessEndOfContainer(BinaryDataEncodingType dataEncoding, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit, long containerStartIndex)protected voidreorderItemsByStartBit()voidsetShowAllConditionals(boolean flag)Sets the user preference for showing the depth into conditional containers and aggregate members, including repeats, when the entry item is not currently included by the include condition logic.
-
-
-
Field Detail
-
exhaustedBinaryBitSupply_
protected boolean exhaustedBinaryBitSupply_
-
contentList_
protected List<XTCEContainerContentEntry> contentList_
-
contentValues_
protected List<XTCEContainerEntryValue> contentValues_
-
spaceSystems_
protected List<XTCESpaceSystem> spaceSystems_
-
totalContainerSize_
protected long totalContainerSize_
-
showAllConditions_
protected boolean showAllConditions_
-
containerName_
protected String containerName_
-
containerDescription_
protected String containerDescription_
-
-
Method Detail
-
getName
public String getName()
Accessor to retrieve the name of the container that this model represents.- Returns:
- String containing a name or an empty string if no name is used.
-
getDescription
public String getDescription()
Accessor to retrieve a description of the container that this model represents.- Returns:
- String containing a description or an empty string if none used.
-
getWarnings
public List<String> getWarnings()
Accessor to retrieve the list of warnings when processing this container.- Returns:
- List of strings containing the warning messages.
-
isValid
public final boolean isValid()
Retrieve the container processing validity guess flag. In the event that this flag is false, there will always be a warning message to retrieve from getWarnings().- Returns:
- boolean indicating if there were issues encountered during the processing that suggest that this data is not usable.
-
getContentList
public List<XTCEContainerContentEntry> getContentList()
Accessor to retrieve the container content in a pre-processed series of rows that can be iterated through.- Returns:
- List of XTCEContainerContentEntry objects.
-
getUserValues
public List<XTCEContainerEntryValue> getUserValues()
Retrieve the current applied list of user values.- Returns:
- List of XTCEContainerEntryValue objects.
-
getTotalSize
public final long getTotalSize()
Retrieve the total size/length of this container in bits.- Returns:
- long containing the bit length of the container
-
getBytesRequired
public final long getBytesRequired()
Retrieve the number of bytes necessary to capture the number of bits in this container. When the number of bits is not divisible evenly by 8, then the number of bytes returned may have 1-7 unused bits at the end.- Returns:
- long containing the minimum number of bytes needed to store the data bits for this container.
-
setShowAllConditionals
public void setShowAllConditionals(boolean flag)
Sets the user preference for showing the depth into conditional containers and aggregate members, including repeats, when the entry item is not currently included by the include condition logic.- Parameters:
flag- boolean indicating if the depth should be shown even when the conditional is evaluated to not being present in the container.
-
isProcessingCompatible
public final boolean isProcessingCompatible(BitSet rawBits) throws XTCEDatabaseException
Retrieve the compatibility of this container with the raw bits provided by the caller to determine if this is the right model object to match the binary.- Parameters:
rawBits- BitSet containing the raw binary bits of a container.- Returns:
- boolean indicating if this container matches the supplied binary based on the inheritance model restrictions.
- Throws:
XTCEDatabaseException- thrown in the event that the container contents cannot be processed. In the event that the container has already been processed, which is usually the case, then this method cannot throw.
-
encodeContainer
public final BitSet encodeContainer() throws XTCEDatabaseException
Encode a raw binary BitSet from the processed container content model for potential file or wire transmission. The binary will be encoded first from the values processed with a binary or user value set input provided when processing this container or the default/initial values in the database for parameters that do not have an assigned value during container processing.- Returns:
- BitSet containing the raw bits representing this container and the values of the parameters.
- Throws:
XTCEDatabaseException- thrown in the event that the container contents cannot be processed. In the event that the container has already been processed, which is usually the case, then this method cannot throw.
-
extractRawValue
public BitSet extractRawValue(XTCEContainerContentEntry currentEntry) throws XTCEDatabaseException
Extracts the raw binary value from a container where the binary of the container has been provided to this object.- Parameters:
currentEntry- XTCEContainerContentEntry representing the item that is desired for extraction on this object.- Returns:
- BitSet which is intended to represent the raw bits.
- Throws:
XTCEDatabaseException- thrown in the event one of three things occurs. First, the binary is not provided to this object so nothing can be extracted. Second, in the event that the calculated starting bit for this item exceeds the length of the binary provided. Third if the length of the item exceeds the length of the binary provided.
-
isEntryNeedingStartBit
protected boolean isEntryNeedingStartBit(XTCEContainerContentEntry currentEntry)
-
isEntryConditionSatisfied
protected boolean isEntryConditionSatisfied(XTCEContainerContentEntry entry)
-
reorderItemsByStartBit
protected void reorderItemsByStartBit()
-
addArrayEntryDescription
protected long addArrayEntryDescription(ArrayParameterRefEntryType refEntry, XTCEContainerContentEntry contentEntry)
-
addRepeatEntryDescription
protected long addRepeatEntryDescription(SequenceEntryType refEntry, XTCEContainerContentEntry contentEntry)
-
dynamicCountFromUserValue
protected long dynamicCountFromUserValue(XTCENamedObject item, String form)
-
applyRestrictions
protected void applyRestrictions(XTCENamedObject container, MatchCriteriaType restrictions, String parentSpaceSystemPath)
-
applyRestriction
protected void applyRestriction(ComparisonType compare, XTCENamedObject container)
-
addIncludeConditions
protected void addIncludeConditions(SequenceEntryType entry, XTCENamedObject container, XTCEContainerContentEntry content)
-
addIncludeCondition
protected void addIncludeCondition(ComparisonType compare, XTCENamedObject container, XTCEContainerContentEntry content)
-
evaluateIncludeConditions
protected void evaluateIncludeConditions(XTCEContainerContentEntry content)
-
findParameter
protected XTCEParameter findParameter(String parameterRef, XTCENamedObject currentContainer) throws XTCEDatabaseException
- Throws:
XTCEDatabaseException
-
findContainer
protected XTCETMContainer findContainer(String containerRef, XTCENamedObject currentContainer) throws XTCEDatabaseException
- Throws:
XTCEDatabaseException
-
findTelecommand
protected XTCETelecommand findTelecommand(String metaCommandRef, XTCENamedObject currentContainer) throws XTCEDatabaseException
- Throws:
XTCEDatabaseException
-
applyBinaryValue
protected void applyBinaryValue(XTCEContainerContentEntry entry)
-
applyUserValue
protected void applyUserValue(XTCEContainerContentEntry entry)
-
addStartBit
protected void addStartBit(SequenceEntryType pRefEntry, XTCEContainerContentEntry contentEntry, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit)
-
evaluateContainerReferenceLocation
protected long evaluateContainerReferenceLocation(SequenceEntryType cRefEntry, XTCEContainerContentEntry contentEntry, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit)
-
processEndOfContainer
protected void processEndOfContainer(BinaryDataEncodingType dataEncoding, XTCEContainerContentModelBase.RunningStartBit currentStartBit, long containerStartBit, long containerStartIndex)
-
checkForOverlaps
protected void checkForOverlaps(long totalSizeInBits)
-
-