Package org.codehaus.groovy.runtime
Class GroovyCategorySupport.ThreadCategoryInfo
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,GroovyCategorySupport.CategoryMethodList>
org.codehaus.groovy.runtime.GroovyCategorySupport.ThreadCategoryInfo
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,GroovyCategorySupport.CategoryMethodList>
- Enclosing class:
- GroovyCategorySupport
public static class GroovyCategorySupport.ThreadCategoryInfo
extends HashMap<String,GroovyCategorySupport.CategoryMethodList>
Category methods active on one thread, keyed by method name.
Each
use pushes a scope and pops it when the closure
finishes. Getters and setters are also indexed by property name.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCategoryMethods(String name) Returns the category methods registered undernamewhile a scope is active.<T> TOpens a scope, installs the public static methods of each class incategoryClasses, and callsclosure.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
ThreadCategoryInfo
public ThreadCategoryInfo()
-
-
Method Details
-
use
Opens a scope, installs the public static methods of each class incategoryClasses, and callsclosure. The scope is closed on the way out, including when the closure throws. A method is installed only when it is public and static and has at least one parameter; the first parameter type is the receiver. Methods inherited from superclasses are installed too, stopping beforeObject.- Type Parameters:
T- return type ofclosure- Parameters:
categoryClasses- classes that supply category methods, applied in orderclosure- called while those methods are visible- Returns:
- the value returned by
closure
-
getCategoryMethods
Returns the category methods registered undernamewhile a scope is active.- Parameters:
name- method name to look up- Returns:
- the list for
name, or null when this thread is not insideuseor no method of that name is registered
-