@SuppressWarnings({ "rawtypes", "unchecked" })
	public void setOutputFuncClass(Class<? extends FieldOutputFunction> funcClass,
			String getterName) {

		if (funcClass != FieldOutputFunction.class) {
			this.outputFunc = ReflectionHelper.createInstance(funcClass, this);
			return;
		}

		if (getterName != null && !getterName.isBlank()) {
			Method getter =
				ReflectionHelper.requireGetter(fmi.getField().getDeclaringClass(), getterName);
			getter.setAccessible(true);
			this.outputFunc =
				(context, structure, unused) -> outputFuncWithGetter(getter, context, structure);
			return;
		}

		if (dataTypeName != null && !dataTypeName.isBlank()) {
			this.outputFunc = this::dataTypeNameOutputFunc;
			return;
		}

		Class<?> fieldType = fmi.getField().getType();
		if (ReflectionHelper.isPrimitiveType(fieldType)) {
			this.outputFunc = this::primitiveOutputFunc;
			return;
		}
		if (fieldType.isArray() && ReflectionHelper.isPrimitiveType(fieldType.getComponentType())) {
			this.outputFunc = this::arrayOutputFunc;
			return;
		}

		if (ReflectionHelper.hasStructureMapping(fieldType)) {
			this.outputFunc = this::nestedStructureOutputFunc;
			return;
		}

		throw new IllegalArgumentException("Invalid FieldOutput " + fmi.getField());
	}
Returns the value of this java field.

@param <R> type of the result value
@param structInstance object containing the field
@param expectedType expected class of the value 
@return value of the field, or null if the field's value is not of expected type
@throws IOException if error accessing java field
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldOutputInfo.java