@GroovyASTTransformation(phase=CompilePhase.CONVERSION)
class ListenerListASTStubber
extends AbstractASTTransformation
Joint-compilation stubber for ListenerList. Emits placeholder
addXxxListener(L), removeXxxListener(L),
getXxxListeners(), plus a fireXxx(...) per public method
of the listener interface, so Java consumers can register listeners and
fire events against the joint-compilation stub.
The listener interface and its method set are read directly from the
field's generic type parameter at CONVERSION; for typical
classpath-resolvable listeners (e.g. java.beans.PropertyChangeListener)
this works the same way the full transform does. Same-unit Groovy
interfaces with their own transform-added members fall under the
Tier 3 cross-class limitation.
The full ListenerListASTTransformation at CANONICALIZATION removes stubber-tagged methods before its conflict check, so its "method already declared" errors continue to catch user conflicts but not stubber placeholders.
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Constructor and description |
|---|
ListenerListASTStubber() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
visit(ASTNode[] nodes, SourceUnit source) |
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.