Groovy Documentation

grails.util
[Java] Class ClosureToMapPopulator

java.lang.Object
  groovy.lang.GroovyObjectSupport
      grails.util.ClosureToMapPopulator

@SuppressWarnings({"unchecked","rawtypes"})
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.

Authors:
Graeme Rocher
Since:
1.2


Constructor Summary
ClosureToMapPopulator(java.util.Map theMap)

ClosureToMapPopulator()

 
Method Summary
java.lang.Object invokeMethod(java.lang.String name, java.lang.Object o)

java.util.Map populate(groovy.lang.Closure callable)

void setProperty(java.lang.String name, java.lang.Object o)

 
Methods inherited from class groovy.lang.GroovyObjectSupport
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

ClosureToMapPopulator

public ClosureToMapPopulator(java.util.Map theMap)


ClosureToMapPopulator

public ClosureToMapPopulator()


 
Method Detail

invokeMethod

@Override
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object o)


populate

public java.util.Map populate(groovy.lang.Closure callable)


setProperty

@Override
public void setProperty(java.lang.String name, java.lang.Object o)


 

Groovy Documentation