Package grails.util

Class DomainBuilder

java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Binding
groovy.util.FactoryBuilderSupport
groovy.util.ObjectGraphBuilder
grails.util.DomainBuilder
All Implemented Interfaces:
groovy.lang.GroovyObject

public class DomainBuilder extends groovy.util.ObjectGraphBuilder

Allows the construction of object graphs of domain classes. Example:


      def builder = new DomainBuilder()

        def company = builder.company(name: 'ACME') {
            employee(name: 'Duke', employeeId: 1) {
                address(street: '123 Groovy Rd')
            }
            employee(name: 'George', employeeId: 2)
        }
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class groovy.util.ObjectGraphBuilder

    groovy.util.ObjectGraphBuilder.ChildPropertySetter, groovy.util.ObjectGraphBuilder.ClassNameResolver, groovy.util.ObjectGraphBuilder.DefaultChildPropertySetter, groovy.util.ObjectGraphBuilder.DefaultClassNameResolver, groovy.util.ObjectGraphBuilder.DefaultIdentifierResolver, groovy.util.ObjectGraphBuilder.DefaultNewInstanceResolver, groovy.util.ObjectGraphBuilder.DefaultReferenceResolver, groovy.util.ObjectGraphBuilder.DefaultRelationNameResolver, groovy.util.ObjectGraphBuilder.IdentifierResolver, groovy.util.ObjectGraphBuilder.NewInstanceResolver, groovy.util.ObjectGraphBuilder.ReferenceResolver, groovy.util.ObjectGraphBuilder.ReflectionClassNameResolver, groovy.util.ObjectGraphBuilder.RelationNameResolver
  • Field Summary

    Fields inherited from class groovy.util.ObjectGraphBuilder

    CLASSNAME_RESOLVER_KEY, CLASSNAME_RESOLVER_REFLECTION, CLASSNAME_RESOLVER_REFLECTION_ROOT, LAZY_REF, NODE_CLASS, NODE_NAME, OBJECT_ID

    Fields inherited from class groovy.util.FactoryBuilderSupport

    attributeDelegates, autoRegistrationComplete, autoRegistrationRunning, CHILD_BUILDER, CURRENT_BUILDER, CURRENT_FACTORY, CURRENT_NAME, CURRENT_NODE, explicitMethods, explicitProperties, methodMissingDelegate, OWNER, PARENT_BUILDER, PARENT_CONTEXT, PARENT_FACTORY, PARENT_NAME, PARENT_NODE, postInstantiateDelegates, postNodeCompletionDelegates, preInstantiateDelegates, propertyMissingDelegate, registrationGroup, registrationGroupName, SCRIPT_CLASS_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class groovy.util.ObjectGraphBuilder

    getBeanFactoryName, getChildPropertySetter, getClassLoader, getClassNameResolver, getNewInstanceResolver, getRelationNameResolver, isLazyReferencesAllowed, postInstantiate, preInstantiate, resolveFactory, setBeanFactoryName, setChildPropertySetter, setClassLoader, setClassNameResolver, setIdentifierResolver, setLazyReferencesAllowed, setNewInstanceResolver, setReferenceResolver, setRelationNameResolver

    Methods inherited from class groovy.util.FactoryBuilderSupport

    addAttributeDelegate, addDisposalClosure, addPostInstantiateDelegate, addPostNodeCompletionDelegate, addPreInstantiateDelegate, autoRegisterNodes, build, build, build, checkExplicitMethod, checkValueIsNull, checkValueIsType, checkValueIsTypeNotString, createNode, dispatchNodeCall, dispathNodeCall, dispose, getAttributeDelegates, getChildBuilder, getContext, getContextAttribute, getContexts, getContinuationData, getCurrent, getCurrentBuilder, getCurrentFactory, getCurrentName, getDisposalClosures, getExplicitMethods, getExplicitProperties, getFactories, getLocalExplicitMethods, getLocalExplicitProperties, getLocalFactories, getMethodMissingDelegate, getName, getNameMappingClosure, getParentContext, getParentFactory, getParentName, getParentNode, getPostInstantiateDelegates, getPostNodeCompletionDelegates, getPreInstantiateDelegates, getProperty, getPropertyMissingDelegate, getProxyBuilder, getRegistrationGroupItems, getRegistrationGroups, getVariable, getVariables, handleNodeAttributes, invokeMethod, invokeMethod, newContext, nodeCompleted, popContext, postNodeCompletion, registerBeanFactory, registerBeanFactory, registerExplicitMethod, registerExplicitMethod, registerExplicitProperty, registerExplicitProperty, registerFactory, registerFactory, removeAttributeDelegate, removePostInstantiateDelegate, removePostNodeCompletionDelegate, removePreInstantiateDelegate, reset, resolveExplicitMethod, resolveExplicitProperty, restoreFromContinuationData, setClosureDelegate, setMethodMissingDelegate, setNameMappingClosure, setNodeAttributes, setParent, setProperty, setPropertyMissingDelegate, setProxyBuilder, setVariable, withBuilder, withBuilder, withBuilder

    Methods inherited from class groovy.lang.Binding

    hasVariable, removeVariable

    Methods inherited from class groovy.lang.GroovyObjectSupport

    getMetaClass, setMetaClass

    Methods inherited from class java.lang.Object

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

    • DomainBuilder

      public DomainBuilder()