@Override
	public String toString() {
		String fieldNameText = fieldName == null ? "" : "\tfieldName: " + fieldName + "\n";

		//@formatter:off
		return "{\n" +
			"\tdataType: " + dataType.getName() + "\n" +
			fieldNameText +
			"\tfunction: " + function.getName() + "\n" +
			"\taddress: " + address + "\n" +
			"\tcontext: " + context.getPlainText() + "\n" +
		"}";
		//@formatter:on
	}
A preview of how the reference was used
Ghidra/Features/Base/src/main/java/ghidra/app/services/DataTypeReference.java