Uses of Class
groovy.lang.Closure

Packages that use Closure
groovy.lang Core Groovy language classes for implementing data structures, closures, metadata and so forth. 
groovy.mock GroovyMock is a mock testing library for Groovy objects. 
groovy.model An MVC model package for working with user interfaces and data structures and arbitrary Java and Groovy objects  
groovy.sql Groovy helper classes for working with SQL data as Groovy objects  
groovy.swing.impl Implementation classes for the Swing GroovyMarkup builder  
groovy.util Various Groovy utilities for working with nodes, builders, logging, JUnit test cases, text expressions, Ant tasks or JMX MBeans. 
groovy.util.slurpersupport   
groovy.xml.streamingmarkupsupport   
org.codehaus.groovy.runtime Runtime classes for Groovy - whether the dynamic interpreter is being used, the compiler or the bytecode generator. 
 

Uses of Closure in groovy.lang
 

Methods in groovy.lang that return Closure
 Closure Closure.asWritable()
           
 Closure Closure.curry(Object[] arguments)
          Support for closure currying
 Closure ClosureException.getClosure()
           
 Closure IncorrectClosureArgumentsException.getClosure()
           
 

Methods in groovy.lang with parameters of type Closure
 void EmptyRange.step(int step, Closure closure)
           
 void IntRange.step(int step, Closure closure)
           
 void ObjectRange.step(int step, Closure closure)
           
 void ProxyMetaClass.use(Closure closure)
          Use the ProxyMetaClass for the given Closure.
 void ProxyMetaClass.use(GroovyObject object, Closure closure)
          Use the ProxyMetaClass for the given Closure.
 

Constructors in groovy.lang with parameters of type Closure
ClosureException(Closure closure, Throwable cause)
           
IncorrectClosureArgumentsException(Closure closure, Object arguments, Class[] expected)
           
 

Uses of Closure in groovy.mock
 

Constructors in groovy.mock with parameters of type Closure
ClosureConstraintMatcher(Closure closure)
           
 

Uses of Closure in groovy.model
 

Methods in groovy.model with parameters of type Closure
 DefaultTableColumn DefaultTableModel.addClosureColumn(Object headerValue, Closure readClosure, Closure writeClosure, Class type)
          Adds a closure based column to the table
 

Constructors in groovy.model with parameters of type Closure
ClosureModel(ValueModel sourceModel, Closure readClosure)
           
ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure)
           
ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure, Class type)
           
 

Uses of Closure in groovy.sql
 

Methods in groovy.sql with parameters of type Closure
 void GroovyResultSet.eachRow(Closure closure)
          Call the closure once for each row in the result set.
 DataSet DataSet.findAll(Closure where)
           
 void DataSet.each(Closure closure)
           
 DataSet DataSet.createView(Closure criteria)
           
 void Sql.query(String sql, Closure closure)
          Performs the given SQL query calling the closure with the result set
 void Sql.query(String sql, List params, Closure closure)
          Performs the given SQL query with parameters calling the closure with the result set
 void Sql.query(GString gstring, Closure closure)
          Performs the given SQL query calling the closure with the result set
 void Sql.queryEach(String sql, Closure closure)
          Deprecated. please use eachRow instead
 void Sql.eachRow(String sql, Closure closure)
          Performs the given SQL query calling the closure with each row of the result set
 void Sql.queryEach(String sql, List params, Closure closure)
          Deprecated. please use eachRow instead
 void Sql.eachRow(String sql, List params, Closure closure)
          Performs the given SQL query calling the closure with the result set
 void Sql.eachRow(GString gstring, Closure closure)
          Performs the given SQL query calling the closure with the result set
 void Sql.queryEach(GString gstring, Closure closure)
          Deprecated. please use eachRow instead
 void Sql.call(String sql, List params, Closure closure)
          Performs a stored procedure call with the given parameters.
 void Sql.call(GString gstring, Closure closure)
          Performs a stored procedure call with the given parameters, calling the closure once with all result objects.
 void Sql.withStatement(Closure configureStatement)
          Allows a closure to be passed in to configure the JDBC statements before they are executed to do things like set the query size etc.
 

Constructors in groovy.sql with parameters of type Closure
DataSet(DataSet parent, Closure where)
           
 

Uses of Closure in groovy.swing.impl
 

Methods in groovy.swing.impl that return Closure
 Closure DefaultAction.getClosure()
           
 

Methods in groovy.swing.impl with parameters of type Closure
 void DefaultAction.setClosure(Closure closure)
           
 

Uses of Closure in groovy.util
 

Methods in groovy.util with parameters of type Closure
protected  void BuilderSupport.setClosureDelegate(Closure closure, Object node)
          A strategy method to allow derived builders to use builder-trees and switch in different kinds of builders.
protected  String GroovyTestCase.shouldFail(Closure code)
          Asserts that the given code closure fails when it is evaluated
protected  String GroovyTestCase.shouldFail(Class clazz, Closure code)
          Asserts that the given code closure fails when it is evaluated and that a particular exception is thrown.
 void OrderBy.add(Closure closure)
           
 

Constructors in groovy.util with parameters of type Closure
BuilderSupport(Closure nameMappingClosure, BuilderSupport proxyBuilder)
           
ClosureComparator(Closure closure)
           
OrderBy(Closure closure)
           
 

Uses of Closure in groovy.util.slurpersupport
 

Methods in groovy.util.slurpersupport with parameters of type Closure
 void Node.replaceNode(Closure replacementClosure, GPathResult result)
           
protected abstract  void GPathResult.replaceNode(Closure newValue)
           
abstract  GPathResult GPathResult.find(Closure closure)
           
abstract  GPathResult GPathResult.findAll(Closure closure)
           
 GPathResult Attribute.find(Closure closure)
           
 GPathResult Attribute.findAll(Closure closure)
           
protected  void Attribute.replaceNode(Closure newValue)
           
 GPathResult NoChildren.find(Closure closure)
           
 GPathResult NoChildren.findAll(Closure closure)
           
protected  void NoChildren.replaceNode(Closure newValue)
           
 GPathResult NodeChild.find(Closure closure)
           
 GPathResult NodeChild.findAll(Closure closure)
           
protected  void NodeChild.replaceNode(Closure newValue)
           
 

Constructors in groovy.util.slurpersupport with parameters of type Closure
FilteredAttributes(GPathResult parent, Closure closure, Map namespaceTagHints)
           
FilteredNodeChildren(GPathResult parent, Closure closure, Map namespaceTagHints)
           
 

Uses of Closure in groovy.xml.streamingmarkupsupport
 

Fields in groovy.xml.streamingmarkupsupport declared as Closure
protected  Closure Builder.Built.root
           
 

Methods in groovy.xml.streamingmarkupsupport with parameters of type Closure
 Object BaseMarkupBuilder.bind(Closure root)
           
abstract  Object Builder.bind(Closure root)
           
 

Constructors in groovy.xml.streamingmarkupsupport with parameters of type Closure
Builder.Built(Closure root, Map namespaceTagMap)
           
 

Uses of Closure in org.codehaus.groovy.runtime
 

Subclasses of Closure in org.codehaus.groovy.runtime
 class CurriedClosure
          Represents wrapper around a Closure to support currying
 class IteratorClosureAdapter
          A closure which stores calls in a List so that method calls can be iterated over in a 'yield' style way
 class MethodClosure
          Represents a method on an object using a closure which can be invoked at any time
 

Methods in org.codehaus.groovy.runtime that return Closure
 Closure Invoker.getMethodPointer(Object object, String methodName)
          Returns the method pointer for the given object name
static Closure InvokerHelper.getMethodPointer(Object object, String methodName)
          Returns the method pointer for the given object name
static Closure MetaClassHelper.getMethodPointer(Object object, String methodName)
          Returns a callable object for the given method name on the object.
static Closure ScriptBytecodeAdapter.getMethodPointer(Object object, String methodName)
          Returns the method pointer for the given object name
 

Methods in org.codehaus.groovy.runtime with parameters of type Closure
 void ClassExtender.addMethod(String name, Closure closure)
           
static Object DefaultGroovyMethods.identity(Object self, Closure closure)
          Allows the closure to be called for the object reference self
static void DefaultGroovyMethods.use(Object self, Class categoryClass, Closure closure)
          Scoped use method
static void DefaultGroovyMethods.use(Object self, List categoryClassList, Closure closure)
          Scoped use method with list of categories
static Collection DefaultGroovyMethods.unique(Collection self, Closure closure)
          A convenience method for making a collection unique using a closure as a comparator (by Michael Baehr)
static void DefaultGroovyMethods.each(Object self, Closure closure)
          Allows objects to be iterated through using a closure
static void DefaultGroovyMethods.eachWithIndex(Object self, Closure closure)
          Allows object to be iterated through a closure with a counter
static void DefaultGroovyMethods.each(Collection self, Closure closure)
          Allows objects to be iterated through using a closure
static void DefaultGroovyMethods.each(Map self, Closure closure)
          Allows a Map to be iterated through using a closure.
static boolean DefaultGroovyMethods.every(Object self, Closure closure)
          Iterates over every element of a collection, and check whether a predicate is valid for all elements.
static boolean DefaultGroovyMethods.any(Object self, Closure closure)
          Iterates over every element of a collection, and check whether a predicate is valid for at least one element
static List DefaultGroovyMethods.collect(Object self, Closure closure)
          Iterates through this object transforming each object into a new value using the closure as a transformer, returning a list of transformed values.
static Collection DefaultGroovyMethods.collect(Object self, Collection collection, Closure closure)
          Iterates through this object transforming each object into a new value using the closure as a transformer and adding it to the collection, returning the resulting collection.
static List DefaultGroovyMethods.collect(Collection self, Closure closure)
          Iterates through this collection transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static Collection DefaultGroovyMethods.collect(Collection self, Collection collection, Closure closure)
          Iterates through this collection transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static Collection DefaultGroovyMethods.collect(Map self, Collection collection, Closure closure)
          Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static List DefaultGroovyMethods.collect(Map self, Closure closure)
          Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static Object DefaultGroovyMethods.find(Object self, Closure closure)
          Finds the first value matching the closure condition
static Object DefaultGroovyMethods.find(Collection self, Closure closure)
          Finds the first value matching the closure condition
static Object DefaultGroovyMethods.find(Map self, Closure closure)
          Finds the first value matching the closure condition
static List DefaultGroovyMethods.findAll(Object self, Closure closure)
          Finds all values matching the closure condition
static List DefaultGroovyMethods.findAll(Collection self, Closure closure)
          Finds all values matching the closure condition
static Map DefaultGroovyMethods.findAll(Map self, Closure closure)
          Finds all entries matching the closure condition.
static Map DefaultGroovyMethods.groupBy(Collection self, Closure closure)
          Groups all collection members into groups determined by the supplied mapping closure.
protected static Object DefaultGroovyMethods.callClosureForMapEntry(Closure closure, Map.Entry entry)
           
static Object DefaultGroovyMethods.inject(Collection self, Object value, Closure closure)
          Iterates through the given collection, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static Object DefaultGroovyMethods.inject(Object[] self, Object value, Closure closure)
          Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static Object DefaultGroovyMethods.sum(Collection self, Closure closure)
          Sums the result of apply a closure to each item of a collection.
static Object DefaultGroovyMethods.min(Collection self, Closure closure)
          Selects the minimum value found in the collection using the given closure as a comparator
static Object DefaultGroovyMethods.max(Collection self, Closure closure)
          Selects the maximum value found in the collection using the given closure as a comparator
static String DefaultGroovyMethods.replaceAll(String self, String regex, Closure closure)
          Replaces all occurrencies of a captured group by the result of a closure on that text.
static List DefaultGroovyMethods.sort(Collection self, Closure closure)
          A convenience method for sorting a Collection using a closure as a comparator
static Object DefaultGroovyMethods.asType(Closure cl, Class clazz)
           
static void DefaultGroovyMethods.reverseEach(List self, Closure closure)
          Iterate over each element of the list in the reverse order.
static void DefaultGroovyMethods.times(Number self, Closure closure)
          Iterates a number of times
static void DefaultGroovyMethods.upto(Number self, Number to, Closure closure)
          Iterates from this number up to the given number
static void DefaultGroovyMethods.upto(long self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(Long self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(float self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(Float self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(Double self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(BigInteger self, Number to, Closure closure)
           
static void DefaultGroovyMethods.upto(BigDecimal self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(Number self, Number to, Closure closure)
          Iterates from this number down to the given number
static void DefaultGroovyMethods.downto(long self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(Long self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(float self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(Float self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(double self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(Double self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(BigInteger self, Number to, Closure closure)
           
static void DefaultGroovyMethods.downto(BigDecimal self, Number to, Closure closure)
           
static void DefaultGroovyMethods.step(Number self, Number to, Number stepNumber, Closure closure)
          Iterates from this number up to the given number using a step increment
static void DefaultGroovyMethods.eachObject(File self, Closure closure)
          Iterates through the given file object by object
static void DefaultGroovyMethods.eachObject(ObjectInputStream ois, Closure closure)
          Iterates through the given object stream object by object.
static void DefaultGroovyMethods.eachLine(File self, Closure closure)
          Iterates through the given file line by line
static void DefaultGroovyMethods.eachLine(Reader self, Closure closure)
          Iterates through the given reader line by line.
static void DefaultGroovyMethods.splitEachLine(File self, String sep, Closure closure)
          Iterates through the given file line by line, splitting on the seperator
static void DefaultGroovyMethods.splitEachLine(Reader self, String sep, Closure closure)
          Iterates through the given reader line by line, splitting on the separator.
static void DefaultGroovyMethods.eachFile(File self, Closure closure)
          Invokes the closure for each file in the given directory
static void DefaultGroovyMethods.eachFileRecurse(File self, Closure closure)
          Invokes the closure for each file in the given directory and recursively.
static void DefaultGroovyMethods.eachDir(File self, Closure closure)
          Invokes the closure for each directory in the given directory, ignoring regular files.
static void DefaultGroovyMethods.eachFileMatch(File self, Object filter, Closure closure)
          Invokes the closure for each file matching the given filter in the given directory - calling the isCase() method used by switch statements.
static void DefaultGroovyMethods.runAfter(Timer timer, int delay, Closure closure)
          Allow simple syntax for using timers.
static void DefaultGroovyMethods.withReader(File file, Closure closure)
          Helper method to create a new BufferedReader for a file and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withOutputStream(File file, Closure closure)
          Helper method to create a new OutputStream for a file and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withInputStream(File file, Closure closure)
          Helper method to create a new InputStream for a file and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withWriter(File file, Closure closure)
          Helper method to create a new BufferedWriter for a file and then passes it into the closure and ensures it is closed again afterwords
static void DefaultGroovyMethods.withWriter(File file, String charset, Closure closure)
          Helper method to create a new BufferedWriter for a file in a specified encoding and then passes it into the closure and ensures it is closed again afterwords
static void DefaultGroovyMethods.withWriterAppend(File file, String charset, Closure closure)
          Helper method to create a new BufferedWriter for a file in a specified encoding in append mode and then passes it into the closure and ensures it is closed again afterwords
static void DefaultGroovyMethods.withPrintWriter(File file, Closure closure)
          Helper method to create a new PrintWriter for a file and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withWriter(Writer writer, Closure closure)
          Allows a writer to be used, calling the closure with the writer and then ensuring that the writer is closed down again irrespective of whether exceptions occur or the
static void DefaultGroovyMethods.withReader(Reader reader, Closure closure)
          Allows a Reader to be used, calling the closure with the reader and then ensuring that the reader is closed down again irrespective of whether exceptions occur or the
static void DefaultGroovyMethods.withStream(InputStream stream, Closure closure)
          Allows a InputStream to be used, calling the closure with the stream and then ensuring that the stream is closed down again irrespective of whether exceptions occur or the
static void DefaultGroovyMethods.eachLine(InputStream stream, Closure closure)
          Iterates through the given stream line by line
static void DefaultGroovyMethods.eachLine(URL url, Closure closure)
          Iterates through the lines read from the URL's associated input stream
static void DefaultGroovyMethods.withReader(URL url, Closure closure)
          Helper method to create a new BufferedReader for a URL and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withReader(InputStream in, Closure closure)
          Helper method to create a new BufferedReader for a stream and then passes it into the closure and ensures its closed again afterwords
static void DefaultGroovyMethods.withWriter(OutputStream stream, Closure closure)
          Allows an output stream to be used, calling the closure with the output stream and then ensuring that the output stream is closed down again irrespective of whether exceptions occur
static void DefaultGroovyMethods.withWriter(OutputStream stream, String charset, Closure closure)
          Allows an output stream to be used, calling the closure with the output stream and then ensuring that the output stream is closed down again irrespective of whether exceptions occur.
static void DefaultGroovyMethods.withStream(OutputStream os, Closure closure)
          Allows a OutputStream to be used, calling the closure with the stream and then ensuring that the stream is closed down again irrespective of whether exceptions occur.
static void DefaultGroovyMethods.eachByte(File self, Closure closure)
          Traverse through each byte of the specified File
static void DefaultGroovyMethods.eachByte(InputStream is, Closure closure)
          Traverse through each byte of the specified stream.
static void DefaultGroovyMethods.eachByte(URL url, Closure closure)
          Traverse through each byte of the specified URL
static void DefaultGroovyMethods.transformChar(Reader reader, Writer writer, Closure closure)
          Transforms the characters from a reader with a Closure and write them to a writer.
static void DefaultGroovyMethods.transformLine(Reader reader, Writer writer, Closure closure)
          Transforms the lines from a reader with a Closure and write them to a writer.
static void DefaultGroovyMethods.filterLine(Reader reader, Writer writer, Closure closure)
          Filter the lines from a reader and write them on the writer, according to a closure which returns true or false.
static Writable DefaultGroovyMethods.filterLine(File self, Closure closure)
          Filters the lines of a File and creates a Writeable in return to stream the filtered lines
static void DefaultGroovyMethods.filterLine(File self, Writer writer, Closure closure)
          Filter the lines from a File and write them on a writer, according to a closure which returns true or false
static Writable DefaultGroovyMethods.filterLine(Reader reader, Closure closure)
          Filter the lines of a Reader and create a Writable in return to stream the filtered lines.
static Writable DefaultGroovyMethods.filterLine(InputStream self, Closure predicate)
          Filter lines from an input stream using a closure predicate
static void DefaultGroovyMethods.filterLine(InputStream self, Writer writer, Closure predicate)
          Filters lines from an input stream, writing to a writer, using a closure which returns boolean and takes a line.
static void DefaultGroovyMethods.withStreams(Socket socket, Closure closure)
          Allows an InputStream and an OutputStream from a Socket to be used, calling the closure with the streams and then ensuring that the streams are closed down again irrespective of whether exceptions occur.
static Socket DefaultGroovyMethods.accept(ServerSocket serverSocket, Closure closure)
          Allow to pass a Closure to the accept methods of ServerSocket
static void DefaultGroovyMethods.eachMatch(String self, String regex, Closure closure)
          Process each regex group matched substring of the given string.
static void DefaultGroovyMethods.each(Matcher self, Closure closure)
          Process each matched substring of the given group matcher.
static int DefaultGroovyMethods.findIndexOf(Object self, Closure closure)
          Iterates over every element of the collection and return the index of the first object that matches the condition specified in the closure
static Thread DefaultGroovyStaticMethods.start(Thread self, Closure closure)
          Start a Thread with the given closure as a Runnable instance.
static Thread DefaultGroovyStaticMethods.startDaemon(Thread self, Closure closure)
          Start a daemon Thread with the given closure as a Runnable instance.
static void DefaultGroovyStaticMethods.sleep(Object object, long milliseconds, Closure onInterrupt)
          Sleep for so many milliseconds
static void GroovyCategorySupport.use(Class categoryClass, Closure closure)
          Create a scope based on given categoryClass and invoke closure within that scope.
static void GroovyCategorySupport.use(List categoryClasses, Closure closure)
          Create a scope based on given categoryClasses and invoke closure within that scope.
static Object MetaClassHelper.createListenerProxy(Class listenerType, String listenerMethodName, Closure closure)
           
 

Constructors in org.codehaus.groovy.runtime with parameters of type Closure
ClosureListener(String listenerMethodName, Closure closure)
           
ConvertedClosure(Closure closure)
          to create a ConvertedClosure object.
CurriedClosure(Closure uncurriedClosure, Object[] arguments)
           
 



Copyright © 2003-2007 The Codehaus. All Rights Reserved.