Package groovy.util

Class ObjectGraphBuilder.DefaultRelationNameResolver

    • Constructor Detail

      • DefaultRelationNameResolver

        public DefaultRelationNameResolver()
    • Method Detail

      • resolveChildRelationName

        public String resolveChildRelationName​(String parentName,
                                               Object parent,
                                               String childName,
                                               Object child)
        Handles the common English regular plurals with the following rules.
        • If childName ends in {consonant}y, replace 'y' with "ies". For example, allergy to allergies.
        • Otherwise, append 's'. For example, monkey to monkeys; employee to employees.
        If the property does not exist then it will return childName unchanged.
        Specified by:
        resolveChildRelationName in interface ObjectGraphBuilder.RelationNameResolver
        Parameters:
        parentName - the name of the parent node
        parent - the parent node
        childName - the name of the child node
        child - the child node
        See Also:
        English_plural