public boolean needsReferenceForParserArgument(String propertyName, TypeReference argumentType) {
        return argumentType.asComplexTypeReference()
            .map(complexTypeReference -> {
                // Check if this is a local field.
                // FIXME: shouldn't this look onto the argumentType? this is nowhere used...
                return thisType.asComplexTypeDefinition()
                    .map(
                        complexTypeDefinition -> complexTypeDefinition.getPropertyFieldByName(propertyName)
                            .map(TypedField.class::cast)
                            .map(TypedField::getType)
                            .filter(NonSimpleTypeReference.class::isInstance)
                            .map(NonSimpleTypeReference.class::cast)
                            .map(NonSimpleTypeReference::getTypeDefinition)
                            .map(typeDefinition -> !(typeDefinition instanceof EnumTypeDefinition))
                            .orElse(false)
                    )
                    .orElse(false);
            })
            .orElse(false);
    }
Determines if a parser argument needs to be passed as a reference.
<p>This method is a bit confusing: it checks if the argument type is
complex and then checks if one of the properties of the complex type
definition has the same name as the property name given as argument. If
such a property exists and its type is not an enum, then the argument
needs to be passed as a reference.
<p>This method is implemented as it is because the information the
{@link ComplexTypeDefinition} provides is not sufficient to determine
whether an argument needs to be passed as a reference: the information
about the fields of the complex type does not contain information about
the type of the field. Instead, it contains information about the type
definition of the field, which does not necessarily reflect the type of
the field in the context of the given property.
<p>This method is a bit broken because it does not consider the type
of the argument. Instead, it only looks at the type of the property.
This is problematic because the type of the argument could be a
reference to a type that is not a complex type, but still needs to be
passed as a reference. This is not the case here, because we only
consider complex types.
@param propertyName the name of the property
@param argumentType the type of the parser argument
@return whether the parser argument needs to be passed as a reference
code-generation/language-python/src/main/java/org/apache/plc4x/language/python/PythonLanguageTemplateHelper.java