Package ghidra.program.model.data
Class StructureDataType
- java.lang.Object
-
- ghidra.program.model.data.DataTypeImpl
-
- ghidra.program.model.data.GenericDataType
-
- ghidra.program.model.data.CompositeDataTypeImpl
-
- ghidra.program.model.data.StructureDataType
-
- All Implemented Interfaces:
Composite,DataType,Structure,java.io.Serializable,java.util.EventListener,javax.swing.event.ChangeListener
public class StructureDataType extends CompositeDataTypeImpl implements Structure
Basic implementation of the structure data type- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.program.model.data.Composite
Composite.AlignmentType, Composite.NamedAlignment
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<DataTypeComponentImpl>componentsprotected intnumComponentsprotected static java.util.Comparator<java.lang.Object>offsetComparatorprotected intstructLength-
Fields inherited from class ghidra.program.model.data.CompositeDataTypeImpl
aligned, currentAlignment, externalAlignment, packingValue
-
Fields inherited from class ghidra.program.model.data.GenericDataType
packed
-
Fields inherited from class ghidra.program.model.data.DataTypeImpl
categoryPath, defaultSettings, name
-
Fields inherited from interface ghidra.program.model.data.Composite
DEFAULT_ALIGNMENT_VALUE, NOT_PACKING
-
Fields inherited from interface ghidra.program.model.data.DataType
CONFLICT_SUFFIX, DEFAULT, NO_LAST_CHANGE_TIME, NO_SOURCE_SYNC_TIME, VOID
-
-
Constructor Summary
Constructors Constructor Description StructureDataType(CategoryPath path, java.lang.String name, int length)Construct a new structure with the given name and number of undefined bytesStructureDataType(CategoryPath path, java.lang.String name, int length, DataTypeManager dtm)StructureDataType(CategoryPath path, java.lang.String name, int length, UniversalID universalID, SourceArchive sourceArchive, long lastChangeTime, long lastChangeTimeInSourceArchive, DataTypeManager dtm)Construct a new structure with the given name and number of undefined bytesStructureDataType(java.lang.String name, int length)Construct a new structure with the given name and number of undefined bytesStructureDataType(java.lang.String name, int length, DataTypeManager dtm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataTypeComponentadd(DataType dataType, int length, java.lang.String componentName, java.lang.String comment)Adds a new datatype to the end of this composite.voidadd(DataType dataType, int length, java.lang.String componentName, java.lang.String comment, int numCopies)protected booleanadjustComponents()Adjust the alignment, packing and padding of components within this structure based upon the current alignment and packing attributes for this structure.voidadjustInternalAlignment()Adjusts the internal alignment of components within this composite based on the current settings of the internal alignment, packing, alignment type and minimum alignment value.voidclearComponent(int index)clears the defined component at the given component index.voidclearFlexibleArrayComponent()Remove the optional trailing flexible array component associated with this structure.DataTypeclone(DataTypeManager dtm)Returns a new instance of this DataType with its universalID and SourceArchive identity retained.DataTypecopy(DataTypeManager dtm)Returns a new instance of this DataType with a new identity.voiddataTypeAlignmentChanged(DataType dt)The overall (external) alignment changed for the specified data type.voiddataTypeDeleted(DataType dt)Informs this dataType that the given dataType has been deleted.voiddataTypeNameChanged(DataType dt, java.lang.String oldName)Informs this data type that its name has changed from the indicated old name.voiddataTypeReplaced(DataType oldDt, DataType newDt)Informs this data type that the given oldDT has been replaced with newDT
TODO: This method is reserved for internal DB use and should be removed from the public DataType interface!!voiddataTypeSizeChanged(DataType dt)Notification that the given dataType's size has changed.voiddelete(int index)Deletes the ComponentDataType at the given indexvoiddelete(int[] ordinals)Deletes the components at the given ordinal positions.voiddeleteAll()Remove all components from this structure, effectively setting the length to zero.voiddeleteAtOffset(int offset)Deletes the datatype at the specified offset in this structure.booleandependsOn(DataType dt)Returns true if this dataType depends on the existence of the given dataType.protected voiddumpComponents(java.lang.StringBuilder buffer, java.lang.String pad)Dump all components for use inCompositeDataTypeImpl.toString()representation.DataTypeComponentgetComponent(int index)Returns the component of this structure with the indicated ordinal.DataTypeComponentgetComponentAt(int offset)Gets the immediate child component that contains the byte at the given offset.DataTypeComponent[]getComponents()Returns a list of all components that make up this data type excluding any trailing flexible array component if present.DataTypeComponentgetDataTypeAt(int offset)Returns the primitive Data Type that is at this offset.java.lang.StringgetDefaultLabelPrefix()Returns the appropriate string to use as the default label prefix in the absence of any data.DataTypeComponent[]getDefinedComponents()Returns the list of components that are defined.DataTypeComponentgetFlexibleArrayComponent()Get the optional trailing flexible array component associated with this structure.intgetLength()Get the length (number of 8-bit bytes) of this DataType.intgetNumComponents()Gets the number of component data types in this data type excluding any trailing flexible array component if present.intgetNumDefinedComponents()Returns the number of non-undefined components in this composite.protected intgetNumUndefinedBytes(int index)Gets the number of Undefined bytes beginning at the indicated component index.java.lang.StringgetRepresentation(MemBuffer buf, Settings settings, int length)Get bytes from memory in a printable format for this type.voidgrowStructure(int amount)Increases the size of the structure by the given amount by adding undefined datatypes at the end of the structure.booleanhasFlexibleArrayComponent()Determine if a trailing flexible array component has been defined.DataTypeComponentinsert(int index, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)Inserts a new datatype at the specified ordinal position in this composite.voidinsert(int ordinal, DataType dataType, int length, java.lang.String name, java.lang.String comment, int numCopies)DataTypeComponentinsertAtOffset(int offset, DataType dataType, int length)Inserts a new datatype at the specified offset into this structure.DataTypeComponentinsertAtOffset(int offset, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)Inserts a new datatype at the specified offset into this structure.booleanisEquivalent(DataType dataType)Returns true if the given dataType is equivalent to this dataType.booleanisNotYetDefined()Indicates if type has not yet been defined.voidpack(int packingSize)voidrealign()Updates the composite to any changes in the data organization.DataTypeComponentreplace(int index, DataType dataType, int length)Replaces the component at the given component index with a new component of the indicated data type.DataTypeComponentreplace(int index, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)Replaces the component at the given component index with a new component of the indicated data type.DataTypeComponentreplaceAtOffset(int offset, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)Replaces the component at the specified byte offset with a new component of the indicated data type.voidreplaceWith(DataType dataType)Replaces the internal components of this structure with components of the given structure.DataTypeComponentsetFlexibleArrayComponent(DataType flexType, java.lang.String name, java.lang.String comment)Set the optional trailing flexible array component associated with this structure.protected voidshiftOffsets(DataTypeComponentImpl dtc, int deltaOrdinal, int deltaOffset)-
Methods inherited from class ghidra.program.model.data.CompositeDataTypeImpl
add, add, add, checkAncestry, getAlignment, getDescription, getMinimumAlignment, getMnemonic, getPackingValue, getValue, insert, insert, isDefaultAligned, isDynamicallySized, isInternallyAligned, isMachineAligned, isPartOf, notifyAlignmentChanged, setDataAlignmentInfo, setDescription, setInternallyAligned, setMinimumAlignment, setName, setPackingValue, setToDefaultAlignment, setToMachineAlignment, setValue, toString, validateDataType
-
Methods inherited from class ghidra.program.model.data.GenericDataType
setCategoryPath, setNameAndCategory
-
Methods inherited from class ghidra.program.model.data.DataTypeImpl
addParent, equals, getCategoryPath, getDataOrganization, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getName, getParents, getPathName, getSettingsDefinitions, getSourceArchive, getUniversalID, getValueClass, hashCode, isDeleted, notifyDeleted, notifyNameChanged, notifyReplaced, notifySizeChanged, removeParent, setDefaultSettings, setLastChangeTime, setLastChangeTimeInSourceArchive, setSourceArchive, stateChanged
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ghidra.program.model.data.Composite
add, getMinimumAlignment, getPackingValue, isDefaultAligned, isInternallyAligned, isMachineAligned, isPartOf, setDescription, setInternallyAligned, setMinimumAlignment, setPackingValue, setToDefaultAlignment, setToMachineAlignment
-
Methods inherited from interface ghidra.program.model.data.DataType
addParent, getAlignment, getCategoryPath, getDataTypeManager, getDataTypePath, getDefaultAbbreviatedLabelPrefix, getDefaultLabelPrefix, getDefaultOffcutLabelPrefix, getDefaultSettings, getDescription, getDisplayName, getDocs, getLastChangeTime, getLastChangeTimeInSourceArchive, getMnemonic, getName, getParents, getPathName, getSettingsDefinitions, getSourceArchive, getUniversalID, getValue, getValueClass, isDeleted, isDynamicallySized, removeParent, setCategoryPath, setDefaultSettings, setLastChangeTime, setLastChangeTimeInSourceArchive, setName, setNameAndCategory, setSourceArchive
-
-
-
-
Field Detail
-
offsetComparator
protected static java.util.Comparator<java.lang.Object> offsetComparator
-
structLength
protected int structLength
-
numComponents
protected int numComponents
-
components
protected java.util.List<DataTypeComponentImpl> components
-
-
Constructor Detail
-
StructureDataType
public StructureDataType(java.lang.String name, int length)Construct a new structure with the given name and number of undefined bytes- Parameters:
name- the name of the new structurelength- the initial size of the structure
-
StructureDataType
public StructureDataType(java.lang.String name, int length, DataTypeManager dtm)
-
StructureDataType
public StructureDataType(CategoryPath path, java.lang.String name, int length)
Construct a new structure with the given name and number of undefined bytes- Parameters:
path- the category path indicating where this data type is located.name- the name of the new structurelength- the initial size of the structure
-
StructureDataType
public StructureDataType(CategoryPath path, java.lang.String name, int length, DataTypeManager dtm)
-
StructureDataType
public StructureDataType(CategoryPath path, java.lang.String name, int length, UniversalID universalID, SourceArchive sourceArchive, long lastChangeTime, long lastChangeTimeInSourceArchive, DataTypeManager dtm)
Construct a new structure with the given name and number of undefined bytes- Parameters:
path- the category path indicating where this data type is located.name- the name of the new structurelength- the initial size of the structuredataTypeManager- the data type manager associated with this data type. This can be null. Also, the data type manager may not contain this actual data type.
-
-
Method Detail
-
getRepresentation
public java.lang.String getRepresentation(MemBuffer buf, Settings settings, int length)
Description copied from interface:DataTypeGet bytes from memory in a printable format for this type.- Specified by:
getRepresentationin interfaceDataType- Parameters:
buf- the data.settings- the settings to use for the representation.length- the number of bytes to represent.- Returns:
- the representation of the data in this format, never null.
-
isNotYetDefined
public boolean isNotYetDefined()
Description copied from interface:DataTypeIndicates if type has not yet been defined. Such types will always return a size of 1. (example: empty structure)- Specified by:
isNotYetDefinedin interfaceDataType- Overrides:
isNotYetDefinedin classDataTypeImpl- Returns:
- true if this type is not yet defined.
-
getComponentAt
public DataTypeComponent getComponentAt(int offset)
Description copied from interface:StructureGets the immediate child component that contains the byte at the given offset.- Specified by:
getComponentAtin interfaceStructure- Parameters:
offset- the byte offset into this data type- Returns:
- the immediate child component.
-
getDataTypeAt
public DataTypeComponent getDataTypeAt(int offset)
Description copied from interface:StructureReturns the primitive Data Type that is at this offset. This is useful for prototypes that have components that are made up of other components- Specified by:
getDataTypeAtin interfaceStructure- Parameters:
offset- the byte offset into this data type.- Returns:
- the primitive data type at the offset.
-
getLength
public int getLength()
Description copied from interface:DataTypeGet the length (number of 8-bit bytes) of this DataType.
-
delete
public void delete(int index)
Description copied from interface:StructureDeletes the ComponentDataType at the given index
-
delete
public void delete(int[] ordinals)
Description copied from interface:CompositeDeletes the components at the given ordinal positions.
Note: For an aligned structure the delete will have no effect if the ordinal position is a component that provides alignment padding.
-
shiftOffsets
protected void shiftOffsets(DataTypeComponentImpl dtc, int deltaOrdinal, int deltaOffset)
-
getComponent
public DataTypeComponent getComponent(int index)
Description copied from interface:StructureReturns the component of this structure with the indicated ordinal. If the specified ordinal equalsStructure.getNumComponents()the defined flexible array component will be returned, otherwise an out of bounds exception will be thrown. Use ofStructure.getFlexibleArrayComponent()is preferred for obtaining this special trailing component.- Specified by:
getComponentin interfaceComposite- Specified by:
getComponentin interfaceStructure- Parameters:
index- the component's ordinal (zero based).- Returns:
- the data type component.
-
getNumComponents
public int getNumComponents()
Description copied from interface:StructureGets the number of component data types in this data type excluding any trailing flexible array component if present.- Specified by:
getNumComponentsin interfaceComposite- Specified by:
getNumComponentsin interfaceStructure- Returns:
- the number of components that make up this data prototype
-
getNumDefinedComponents
public int getNumDefinedComponents()
Description copied from interface:StructureReturns the number of non-undefined components in this composite. For example, say a structure has an int (4 bytes) at offset 0 and another int at offset 8. This structure would have 6 total components (one for each undefined between the two ints), but only 2 defined components. Any trailing flexible array component will not be included in this count.- Specified by:
getNumDefinedComponentsin interfaceStructure- Returns:
- the number of non-undefined components in this composite
-
insertAtOffset
public DataTypeComponent insertAtOffset(int offset, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)
Description copied from interface:StructureInserts a new datatype at the specified offset into this structure.- Specified by:
insertAtOffsetin interfaceStructure- Parameters:
offset- the byte offset into the structure where the new datatype is to be inserted.dataType- the datatype to insert.length- the length to associate with the dataType;componentName- the field name to associate with this component.comment- the comment to associate with this component.- Returns:
- the componentDataType created.
-
insertAtOffset
public DataTypeComponent insertAtOffset(int offset, DataType dataType, int length)
Description copied from interface:StructureInserts a new datatype at the specified offset into this structure.- Specified by:
insertAtOffsetin interfaceStructure- Parameters:
offset- the byte offset into the structure where the new datatype is to be inserted.dataType- the datatype to insert.- Returns:
- the componentDataType created.
-
add
public DataTypeComponent add(DataType dataType, int length, java.lang.String componentName, java.lang.String comment)
Description copied from interface:CompositeAdds a new datatype to the end of this composite.- Specified by:
addin interfaceComposite- Specified by:
addin interfaceStructure- Parameters:
dataType- the datatype to add.length- the length to associate with the datatype.componentName- the field name to associate with this component.comment- the comment to associate with this component.- Returns:
- the componentDataType created.
- See Also:
Composite.add(ghidra.program.model.data.DataType, int, java.lang.String, java.lang.String)
-
add
public void add(DataType dataType, int length, java.lang.String componentName, java.lang.String comment, int numCopies)
-
growStructure
public void growStructure(int amount)
Description copied from interface:StructureIncreases the size of the structure by the given amount by adding undefined datatypes at the end of the structure.- Specified by:
growStructurein interfaceStructure- Parameters:
amount- the amount by which to grow the structure.
-
insert
public DataTypeComponent insert(int index, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)
Description copied from interface:CompositeInserts a new datatype at the specified ordinal position in this composite.
Note: For an aligned structure the ordinal position will get adjusted automatically to provide the proper alignment.- Specified by:
insertin interfaceComposite- Specified by:
insertin interfaceStructure- Parameters:
index- the ordinal where the new datatype is to be inserted.dataType- the datatype to insert.length- the length to associate with the datatype.componentName- the field name to associate with this component.comment- the comment to associate with this component.- Returns:
- the componentDataType created.
- See Also:
Composite.insert(int, ghidra.program.model.data.DataType, int, java.lang.String, java.lang.String)
-
insert
public void insert(int ordinal, DataType dataType, int length, java.lang.String name, java.lang.String comment, int numCopies)
-
deleteAtOffset
public void deleteAtOffset(int offset)
Description copied from interface:StructureDeletes the datatype at the specified offset in this structure.- Specified by:
deleteAtOffsetin interfaceStructure- Parameters:
offset- the byte offset into the structure where the datatype is to be deleted.
-
isEquivalent
public boolean isEquivalent(DataType dataType)
Description copied from interface:DataTypeReturns true if the given dataType is equivalent to this dataType. The precise meaning of "equivalent" is dataType dependent.- Specified by:
isEquivalentin interfaceDataType- Parameters:
dataType- the dataType being tested for equivalence.- Returns:
- true if the if the given dataType is equivalent to this dataType.
-
dataTypeSizeChanged
public void dataTypeSizeChanged(DataType dt)
Description copied from interface:DataTypeNotification that the given dataType's size has changed. DataTypes may need to make internal changes in response.
TODO: This method is reserved for internal DB use and should be removed from the public DataType interface!!- Specified by:
dataTypeSizeChangedin interfaceDataType- Parameters:
dt- the dataType that has changed.
-
dataTypeAlignmentChanged
public void dataTypeAlignmentChanged(DataType dt)
Description copied from interface:CompositeThe overall (external) alignment changed for the specified data type. In other words, the data type has a different alignment when placed inside other structures.- Specified by:
dataTypeAlignmentChangedin interfaceComposite- Parameters:
dt- the data type whose alignment changed.
-
copy
public DataType copy(DataTypeManager dtm)
Description copied from interface:DataTypeReturns a new instance of this DataType with a new identity. Note: for built-in DataType's, clone and copy should have the same affect.
-
clone
public DataType clone(DataTypeManager dtm)
Description copied from interface:DataTypeReturns a new instance of this DataType with its universalID and SourceArchive identity retained. Note: for built-in DataType's, clone and copy should have the same affect.
-
clearComponent
public void clearComponent(int index)
Description copied from interface:Structureclears the defined component at the given component index. Clearing a component causes a defined component to be replaced with a number of undefined dataTypes to offset the removal of the defined dataType.- Specified by:
clearComponentin interfaceStructure- Parameters:
index- the index of the component to clear.
-
replaceWith
public void replaceWith(DataType dataType)
Replaces the internal components of this structure with components of the given structure.- Specified by:
replaceWithin interfaceDataType- Overrides:
replaceWithin classDataTypeImpl- Parameters:
dataType- the structure to get the component information from.- Throws:
java.lang.IllegalArgumentException- if any of the component data types are not allowed to replace a component in this composite data type. For example, suppose dt1 contains dt2. Therefore it is not valid to replace a dt2 component with dt1 since this would cause a cyclic dependency.- See Also:
DataType.replaceWith(ghidra.program.model.data.DataType)
-
dataTypeDeleted
public void dataTypeDeleted(DataType dt)
Description copied from interface:DataTypeInforms this dataType that the given dataType has been deleted.
TODO: This method is reserved for internal DB use and should be removed from the public DataType interface!!- Specified by:
dataTypeDeletedin interfaceDataType- Parameters:
dt- the dataType that has been deleted.
-
dataTypeReplaced
public void dataTypeReplaced(DataType oldDt, DataType newDt)
Description copied from interface:DataTypeInforms this data type that the given oldDT has been replaced with newDT
TODO: This method is reserved for internal DB use and should be removed from the public DataType interface!!- Specified by:
dataTypeReplacedin interfaceDataType- Parameters:
oldDt- old data typenewDt- new data type
-
getDefinedComponents
public DataTypeComponent[] getDefinedComponents()
Description copied from interface:StructureReturns the list of components that are defined. (As opposed to "filler" undefined bytes.). Any trailing flexible array component will be omitted.- Specified by:
getDefinedComponentsin interfaceStructure
-
getComponents
public DataTypeComponent[] getComponents()
Description copied from interface:StructureReturns a list of all components that make up this data type excluding any trailing flexible array component if present.- Specified by:
getComponentsin interfaceComposite- Specified by:
getComponentsin interfaceStructure- Returns:
- an array containing the components
-
replace
public DataTypeComponent replace(int index, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)
Description copied from interface:StructureReplaces the component at the given component index with a new component of the indicated data type.- Specified by:
replacein interfaceStructure- Parameters:
index- the index where the datatype is to be replaced.dataType- the datatype to insert.length- the length to associate with the dataType;componentName- the field name to associate with this component.comment- the comment to associate with this component.- Returns:
- the new componentDataType at the index.
-
replace
public DataTypeComponent replace(int index, DataType dataType, int length)
Description copied from interface:StructureReplaces the component at the given component index with a new component of the indicated data type.
-
replaceAtOffset
public DataTypeComponent replaceAtOffset(int offset, DataType dataType, int length, java.lang.String componentName, java.lang.String comment)
Description copied from interface:StructureReplaces the component at the specified byte offset with a new component of the indicated data type.- Specified by:
replaceAtOffsetin interfaceStructure- Parameters:
offset- the byte offset into the structure where the datatype is to be replaced.dataType- the datatype to insert.length- the length to associate with the dataType;componentName- the field name to associate with this component.comment- the comment to associate with this component.- Returns:
- the new componentDataType at the index.
-
getNumUndefinedBytes
protected int getNumUndefinedBytes(int index)
Gets the number of Undefined bytes beginning at the indicated component index. Undefined bytes that have a field name or comment specified are also included.- Parameters:
index- the component index to begin checking at.- Returns:
- the number of contiguous undefined bytes
-
dataTypeNameChanged
public void dataTypeNameChanged(DataType dt, java.lang.String oldName)
Description copied from interface:DataTypeInforms this data type that its name has changed from the indicated old name.
TODO: This method is reserved for internal DB use and should be removed from the public DataType interface!!- Specified by:
dataTypeNameChangedin interfaceDataType- Parameters:
dt- the data type whose name changedoldName- the data type's old name
-
dependsOn
public boolean dependsOn(DataType dt)
Description copied from interface:DataTypeReturns true if this dataType depends on the existence of the given dataType. For example byte[] depends on byte. If byte were deleted, then byte[] would also be deleted.
-
deleteAll
public void deleteAll()
Description copied from interface:StructureRemove all components from this structure, effectively setting the length to zero.
-
getDefaultLabelPrefix
public java.lang.String getDefaultLabelPrefix()
Description copied from interface:DataTypeReturns the appropriate string to use as the default label prefix in the absence of any data.- Specified by:
getDefaultLabelPrefixin interfaceDataType- Overrides:
getDefaultLabelPrefixin classDataTypeImpl- Returns:
- the default label prefix or null if none specified.
-
realign
public void realign()
Description copied from interface:CompositeUpdates the composite to any changes in the data organization. If the composite is not internally aligned, this method does nothing.
-
pack
public void pack(int packingSize) throws InvalidInputException- Specified by:
packin interfaceStructure- Throws:
InvalidInputException
-
adjustComponents
protected boolean adjustComponents()
Adjust the alignment, packing and padding of components within this structure based upon the current alignment and packing attributes for this structure. This method should be called to basically fix up the layout of the internal components of the structure after other code has changed the attributes of the structure.
When switching between internally aligned and unaligned this method corrects the component ordinal numbering also.- Returns:
- true if the structure was changed by this method.
-
adjustInternalAlignment
public void adjustInternalAlignment()
Description copied from class:CompositeDataTypeImplAdjusts the internal alignment of components within this composite based on the current settings of the internal alignment, packing, alignment type and minimum alignment value. This method should be called whenever any of the above settings are changed or whenever a components data type is changed or a component is added or removed.- Specified by:
adjustInternalAlignmentin classCompositeDataTypeImpl
-
hasFlexibleArrayComponent
public boolean hasFlexibleArrayComponent()
Description copied from interface:StructureDetermine if a trailing flexible array component has been defined.- Specified by:
hasFlexibleArrayComponentin interfaceStructure- Returns:
- true if trailing flexible array component has been defined.
-
getFlexibleArrayComponent
public DataTypeComponent getFlexibleArrayComponent()
Description copied from interface:StructureGet the optional trailing flexible array component associated with this structure.- Specified by:
getFlexibleArrayComponentin interfaceStructure- Returns:
- optional trailing flexible array component associated with this structure or null if not present.
-
setFlexibleArrayComponent
public DataTypeComponent setFlexibleArrayComponent(DataType flexType, java.lang.String name, java.lang.String comment)
Description copied from interface:StructureSet the optional trailing flexible array component associated with this structure.- Specified by:
setFlexibleArrayComponentin interfaceStructure- Parameters:
flexType- the flexible array dataType (example: for 'char[0]' the type 'char' should be specified)name- component field name or null for default namecomment- component comment- Returns:
- updated flexible array component
-
clearFlexibleArrayComponent
public void clearFlexibleArrayComponent()
Description copied from interface:StructureRemove the optional trailing flexible array component associated with this structure.- Specified by:
clearFlexibleArrayComponentin interfaceStructure
-
dumpComponents
protected void dumpComponents(java.lang.StringBuilder buffer, java.lang.String pad)Description copied from class:CompositeDataTypeImplDump all components for use inCompositeDataTypeImpl.toString()representation.- Overrides:
dumpComponentsin classCompositeDataTypeImpl- Parameters:
buffer- string bufferpad- padding to be used with each component output line
-
-