public class GroovyCategorySupport
extends java.lang.Object
Constructor and Description |
---|
GroovyCategorySupport() |
Modifier and Type | Method and Description |
---|---|
static java.util.List |
getCategoryMethods(java.lang.Class categorizedClass)
This method is used to pull all the new methods out of the local thread context.
|
static java.util.List |
getCategoryMethods(java.lang.Class categorizedClass,
java.lang.String name)
This method is used to pull all the new methods out of the local thread context with a particular name.
|
static java.lang.Object |
getClosestMatchingCategoryMethod(java.lang.Class sender,
MetaMethod orig,
MetaMethod element) |
static boolean |
hasCategoryInAnyThread() |
static java.lang.Object |
use(java.lang.Class categoryClass,
Closure closure)
Create a scope based on given categoryClass and invoke closure within that scope.
|
static java.lang.Object |
use(java.util.List categoryClasses,
Closure closure)
Create a scope based on given categoryClasses and invoke closure within that scope.
|
public static java.util.List getCategoryMethods(java.lang.Class categorizedClass, java.lang.String name)
categorizedClass
- a class subject to the category methods in the thread contextname
- the method name of interestpublic static java.util.List getCategoryMethods(java.lang.Class categorizedClass)
categorizedClass
- a class subject to the category methods in the thread contextpublic static java.lang.Object getClosestMatchingCategoryMethod(java.lang.Class sender, MetaMethod orig, MetaMethod element)
public static java.lang.Object use(java.lang.Class categoryClass, Closure closure)
categoryClass
- the class containing category methodsclosure
- the closure during which to make the category class methods availablepublic static java.lang.Object use(java.util.List categoryClasses, Closure closure)
categoryClasses
- the list of classes containing category methodsclosure
- the closure during which to make the category class methods availablepublic static boolean hasCategoryInAnyThread()