Package groovy.util

Class AbstractFactory

    • Constructor Detail

      • AbstractFactory

        public AbstractFactory()
    • Method Detail

      • isLeaf

        public boolean isLeaf()
        Specified by:
        isLeaf in interface Factory
        Returns:
        true if no child closures should be processed
      • isHandlesNodeChildren

        public boolean isHandlesNodeChildren()
        Description copied from interface: Factory
        Does this factory "Own" it's child closure.
        Specified by:
        isHandlesNodeChildren in interface Factory
        Returns:
        true if the factory should have onContentClosure() called, false if the builder should handle it
      • onFactoryRegistration

        public void onFactoryRegistration​(FactoryBuilderSupport builder,
                                          java.lang.String registeredName,
                                          java.lang.String group)
        Description copied from interface: Factory
        Called when a factory is registered to a builder
        Specified by:
        onFactoryRegistration in interface Factory
        Parameters:
        builder - the build the factory has been registered to
        registeredName - the name the factory has been registered under
      • onHandleNodeAttributes

        public boolean onHandleNodeAttributes​(FactoryBuilderSupport builder,
                                              java.lang.Object node,
                                              java.util.Map attributes)
        Specified by:
        onHandleNodeAttributes in interface Factory
        Parameters:
        builder - the FactoryBuilder
        node - the node (returned from newINstance) to consider the attributes for
        attributes - the attributes, a mutable set
        Returns:
        true if the factory builder should use standard bean property matching for the remaining attributes
      • onNodeChildren

        public boolean onNodeChildren​(FactoryBuilderSupport builder,
                                      java.lang.Object node,
                                      Closure childContent)
        Description copied from interface: Factory
        Only called if it isLeaf is false and isHandlesNodeChildren is true
        Specified by:
        onNodeChildren in interface Factory
        Parameters:
        builder - the FactoryBuilder
        node - the node (returned from newINstance) to consider the attributes for
        childContent - the child content closure of the builder
        Returns:
        true if the factory builder should apply default node processing to the content child
      • onNodeCompleted

        public void onNodeCompleted​(FactoryBuilderSupport builder,
                                    java.lang.Object parent,
                                    java.lang.Object node)
        Specified by:
        onNodeCompleted in interface Factory
        Parameters:
        builder - the FactoryBuilder
        parent - the parent node (null if 'root')
        node - the node just completed