Package groovy.util

Class ObjectGraphBuilder.DefaultRelationNameResolver

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String resolveChildRelationName​(java.lang.String parentName, java.lang.Object parent, java.lang.String childName, java.lang.Object child)
      Handles the common English regular plurals with the following rules.
      java.lang.String resolveParentRelationName​(java.lang.String parentName, java.lang.Object parent, java.lang.String childName, java.lang.Object child)
      Follow the most conventional pattern, returns the parentName unchanged.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultRelationNameResolver

        public DefaultRelationNameResolver()
    • Method Detail

      • resolveChildRelationName

        public java.lang.String resolveChildRelationName​(java.lang.String parentName,
                                                         java.lang.Object parent,
                                                         java.lang.String childName,
                                                         java.lang.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
      • resolveParentRelationName

        public java.lang.String resolveParentRelationName​(java.lang.String parentName,
                                                          java.lang.Object parent,
                                                          java.lang.String childName,
                                                          java.lang.Object child)
        Follow the most conventional pattern, returns the parentName unchanged.
        Specified by:
        resolveParentRelationName 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