private static LocationReference createReferenceFromDefinedData(Data data,
			FieldMatcher fieldMatcher) {
		Address dataAddress = data.getMinAddress();
		if (fieldMatcher.isIgnored()) {
			// no field to match; include the hit
			return new LocationReference(dataAddress, data.getPathName());
		}

		DataType dt = data.getDataType();
		if (dt instanceof Pointer) {
			// For defined data, do not include pointer types when we have a field name.  A
			// pointer to the base composite type is not a direct usage of the given field.find
			return null;
		}

		DataType baseDt = getBaseDataType(data.getDataType());
		if (matchesEnumField(data, baseDt, fieldMatcher)) {
			return new LocationReference(dataAddress, fieldMatcher.getDisplayText());
		}

		DataTypeComponent component = getDataTypeComponent(baseDt, fieldMatcher);
		if (component == null) {
			return null;  // not in composite
		}

		Address componentAddress;
		try {
			componentAddress = dataAddress.addNoWrap(component.getOffset());
			return new LocationReference(componentAddress,
				data.getPathName() + "." + fieldMatcher.getFieldName());
		}
		catch (AddressOverflowException e) {
			// shouldn't happen
			Msg.error(ReferenceUtils.class, "Unable to create address for sub-component of " +
				data.getPathName() + " at " + dataAddress, e);
		}
		return null;
	}
Searches defined data for types that match, according to the given predicate.

@param accumulator the results accumulator
@param program the program
@param dataMatcher the predicate that determines a successful match
@param fieldMatcher the field matcher; will be ignored if it contains null values
@param monitor the task monitor used to track progress and cancel the work
@throws CancelledException if the operation was cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java