grails.util
Class ClosureToMapPopulator

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by grails.util.ClosureToMapPopulator
All Implemented Interfaces:
groovy.lang.GroovyObject

public class ClosureToMapPopulator
extends groovy.lang.GroovyObjectSupport

A simple class that takes method invocations and property setters and populates the arguments of these into the supplied map ignoring null values.

Since:
1.2
Author:
Graeme Rocher

Constructor Summary
ClosureToMapPopulator()
           
ClosureToMapPopulator(Map theMap)
           
 
Method Summary
 Object invokeMethod(String name, Object o)
           
 Map populate(groovy.lang.Closure callable)
           
 void setProperty(String name, Object o)
           
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosureToMapPopulator

public ClosureToMapPopulator(Map theMap)

ClosureToMapPopulator

public ClosureToMapPopulator()
Method Detail

populate

public Map populate(groovy.lang.Closure callable)

setProperty

public void setProperty(String name,
                        Object o)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class groovy.lang.GroovyObjectSupport

invokeMethod

public Object invokeMethod(String name,
                           Object o)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class groovy.lang.GroovyObjectSupport


Copyright (c) 2005-2009 The Grails project