Annotation Interface FieldMapping
Indicates that the tagged java field corresponds to a field in a Ghidra structure.
If the name of the java field does not match the Ghidra structure field name, the
fieldName()
property can be used to manually specify the Ghidra field name.
The type of the tagged java field can be a java primitive, or a
structure mapped
class.
Supported java primitive types:
- long, int, short, byte
- char
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
Overrides the field name that is matched in the structure.int
Allows override the length of the structure fieldboolean
Marks this field as optional.Class<? extends FieldReadFunction>
Optional function that will deserialize the tagged field.Specifies the name of a setter method that will be used to assign the deserialized value to the java field.Override the signedness of the underlying numeric field.
-
Element Details
-
fieldName
String[] fieldNameOverrides the field name that is matched in the structure.Can be a single name, or a list of names that will be used to find the structure field. The name is case-insensitive.
- Returns:
- name, or list of names (case insensitive), of the structure field to map, or unset to use the java field's name
- Default:
- {""}
-
optional
boolean optionalMarks this field as optional.When marked optional, if a binding between the tagged java field and a structure field is not successfully found, this field definition will be skipped.
- Returns:
- boolean flag, if true this field is optional, if false or unset, the field is required
- Default:
- false
-
setter
String setterSpecifies the name of a setter method that will be used to assign the deserialized value to the java field.If unset, a "void setFieldname(field_type)" method will be searched for.
If no setter method is present, the field's value will be directly assigned.
- Returns:
- optional name of a setter method
- Default:
- ""
-
readFunc
Class<? extends FieldReadFunction> readFuncOptional function that will deserialize the tagged field.- Returns:
FieldReadFunction
- Default:
- ghidra.app.util.bin.format.golang.structmapping.FieldReadFunction.class
-
length
int lengthAllows override the length of the structure field- Returns:
- length of the structure field, or unset to use the field's data type
- Default:
- -1
-
signedness
Signedness signednessOverride the signedness of the underlying numeric field.- Returns:
Signedness
enum, or unset to use the data type's normal signedness
- Default:
- Unspecified
-