Documentation
¶
Index ¶
- func DrainAfterVisits(editor any, t java.Tree, ctx any) java.Tree
- func FirstEnclosing[T java.Tree](c *Cursor) (T, bool)
- func Init[T any](v *T) *T
- type AfterVisitor
- type AfterVisitsProvider
- type Cursor
- func (c *Cursor) ComputeMessageIfAbsent(key string, supplier func() any) any
- func (c *Cursor) GetMessage(key string) any
- func (c *Cursor) GetNearestMessage(key string) any
- func (c *Cursor) GetNearestMessageOrDefault(key string, defaultValue any) any
- func (c *Cursor) Parent() *Cursor
- func (c *Cursor) PollNearestMessage(key string) any
- func (c *Cursor) PutMessage(key string, value any)
- func (c *Cursor) PutMessageOnFirstEnclosing(match func(t java.Tree) bool, key string, value any)
- func (c *Cursor) Value() java.Tree
- type GoVisitor
- func (v *GoVisitor) AfterVisits() []AfterVisitor
- func (v *GoVisitor) Cursor() *Cursor
- func (v *GoVisitor) DoAfterVisit(other AfterVisitor)
- func (v *GoVisitor) PendingAfterVisits() []AfterVisitor
- func (v *GoVisitor) PreVisit(t java.Tree, p any) java.Tree
- func (v *GoVisitor) SetCursor(c *Cursor)
- func (v *GoVisitor) Visit(t java.Tree, p any) java.Tree
- func (v *GoVisitor) VisitAnnotation(ann *java.Annotation, p any) java.J
- func (v *GoVisitor) VisitArrayAccess(aa *java.ArrayAccess, p any) java.J
- func (v *GoVisitor) VisitArrayDimension(ad *java.ArrayDimension, p any) java.J
- func (v *GoVisitor) VisitArrayType(at *java.ArrayType, p any) java.J
- func (v *GoVisitor) VisitAssignment(assign *java.Assignment, p any) java.J
- func (v *GoVisitor) VisitAssignmentOperation(ao *java.AssignmentOperation, p any) java.J
- func (v *GoVisitor) VisitBinary(bin *java.Binary, p any) java.J
- func (v *GoVisitor) VisitBlock(block *java.Block, p any) java.J
- func (v *GoVisitor) VisitBreak(b *java.Break, p any) java.J
- func (v *GoVisitor) VisitCase(c *java.Case, p any) java.J
- func (v *GoVisitor) VisitChannel(ch *golang.Channel, p any) java.J
- func (v *GoVisitor) VisitCommClause(cc *golang.CommClause, p any) java.J
- func (v *GoVisitor) VisitCompilationUnit(cu *golang.CompilationUnit, p any) java.J
- func (v *GoVisitor) VisitComposite(c *golang.Composite, p any) java.J
- func (v *GoVisitor) VisitContinue(c *java.Continue, p any) java.J
- func (v *GoVisitor) VisitControlParentheses(cp *java.ControlParentheses, p any) java.J
- func (v *GoVisitor) VisitDeclarationBlock(db *golang.DeclarationBlock, p any) java.J
- func (v *GoVisitor) VisitDefer(d *golang.Defer, p any) java.J
- func (v *GoVisitor) VisitElse(el *java.Else, p any) java.J
- func (v *GoVisitor) VisitEmpty(empty *java.Empty, p any) java.J
- func (v *GoVisitor) VisitFallthrough(f *golang.Fallthrough, p any) java.J
- func (v *GoVisitor) VisitFieldAccess(fa *java.FieldAccess, p any) java.J
- func (v *GoVisitor) VisitForControl(control *java.ForControl, p any) java.J
- func (v *GoVisitor) VisitForEachControl(control *java.ForEachControl, p any) java.J
- func (v *GoVisitor) VisitForEachLoop(forEach *java.ForEachLoop, p any) java.J
- func (v *GoVisitor) VisitForLoop(forLoop *java.ForLoop, p any) java.J
- func (v *GoVisitor) VisitFuncType(ft *golang.FuncType, p any) java.J
- func (v *GoVisitor) VisitGoArrayType(at *golang.ArrayType, p any) java.J
- func (v *GoVisitor) VisitGoAssignmentOperation(a *golang.AssignmentOperation, p any) java.J
- func (v *GoVisitor) VisitGoBinary(b *golang.Binary, p any) java.J
- func (v *GoVisitor) VisitGoMethodDeclaration(md *golang.MethodDeclaration, p any) java.J
- func (v *GoVisitor) VisitGoMod(gm *golang.GoMod, p any) java.Tree
- func (v *GoVisitor) VisitGoModBlock(b *golang.GoModBlock, p any) java.Tree
- func (v *GoVisitor) VisitGoModDirective(d *golang.GoModDirective, p any) java.Tree
- func (v *GoVisitor) VisitGoModValue(val *golang.GoModValue, p any) java.Tree
- func (v *GoVisitor) VisitGoReturn(ret *golang.Return, p any) java.J
- func (v *GoVisitor) VisitGoStmt(g *golang.GoStmt, p any) java.J
- func (v *GoVisitor) VisitGoUnary(u *golang.Unary, p any) java.J
- func (v *GoVisitor) VisitGoVariadic(vr *golang.Variadic, p any) java.J
- func (v *GoVisitor) VisitGoto(g *golang.Goto, p any) java.J
- func (v *GoVisitor) VisitIdentifier(ident *java.Identifier, p any) java.J
- func (v *GoVisitor) VisitIf(ifStmt *java.If, p any) java.J
- func (v *GoVisitor) VisitImport(imp *java.Import, p any) java.J
- func (v *GoVisitor) VisitIndexList(il *golang.IndexList, p any) java.J
- func (v *GoVisitor) VisitInterfaceType(it *golang.InterfaceType, p any) java.J
- func (v *GoVisitor) VisitKeyValue(kv *golang.KeyValue, p any) java.J
- func (v *GoVisitor) VisitLabel(l *java.Label, p any) java.J
- func (v *GoVisitor) VisitLiteral(lit *java.Literal, p any) java.J
- func (v *GoVisitor) VisitMapType(mt *golang.MapType, p any) java.J
- func (v *GoVisitor) VisitMethodDeclaration(md *java.MethodDeclaration, p any) java.J
- func (v *GoVisitor) VisitMethodInvocation(mi *java.MethodInvocation, p any) java.J
- func (v *GoVisitor) VisitMultiAssignment(ma *golang.MultiAssignment, p any) java.J
- func (v *GoVisitor) VisitParameterizedType(pt *java.ParameterizedType, p any) java.J
- func (v *GoVisitor) VisitParentheses(paren *java.Parentheses, p any) java.J
- func (v *GoVisitor) VisitPointerType(pt *golang.PointerType, p any) java.J
- func (v *GoVisitor) VisitReturn(ret *java.Return, p any) java.J
- func (v *GoVisitor) VisitSend(s *golang.Send, p any) java.J
- func (v *GoVisitor) VisitSlice(s *golang.Slice, p any) java.J
- func (v *GoVisitor) VisitSpace(space java.Space, p any) java.Space
- func (v *GoVisitor) VisitStatementExpression(se *golang.StatementExpression, p any) java.J
- func (v *GoVisitor) VisitStatementWithInit(s *golang.StatementWithInit, p any) java.J
- func (v *GoVisitor) VisitStructType(st *golang.StructType, p any) java.J
- func (v *GoVisitor) VisitSwitch(sw *java.Switch, p any) java.J
- func (v *GoVisitor) VisitType(javaType java.JavaType, p any) java.JavaType
- func (v *GoVisitor) VisitTypeCast(tc *java.TypeCast, p any) java.J
- func (v *GoVisitor) VisitTypeDecl(td *golang.TypeDecl, p any) java.J
- func (v *GoVisitor) VisitTypeList(tl *golang.TypeList, p any) java.J
- func (v *GoVisitor) VisitTypeParameter(tp *java.TypeParameter, p any) java.J
- func (v *GoVisitor) VisitTypeParameters(tps *java.TypeParameters, p any) java.J
- func (v *GoVisitor) VisitUnary(unary *java.Unary, p any) java.J
- func (v *GoVisitor) VisitUnderlyingType(ut *golang.UnderlyingType, p any) java.J
- func (v *GoVisitor) VisitUnion(u *golang.Union, p any) java.J
- func (v *GoVisitor) VisitVariableDeclarations(vd *java.VariableDeclarations, p any) java.J
- func (v *GoVisitor) VisitVariableDeclarator(vd *java.VariableDeclarator, p any) java.J
- type JavaTypeVisitor
- func (v *JavaTypeVisitor) Visit(javaType java.JavaType, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitAnnotation(annotation *java.JavaTypeAnnotation, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitArray(array *java.JavaTypeArray, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitClass(class_ *java.JavaTypeClass, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitGenericTypeVariable(generic *java.JavaTypeGenericTypeVariable, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitIntersection(intersection *java.JavaTypeIntersection, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitList(javaTypes []java.JavaType, p any) []java.JavaType
- func (v *JavaTypeVisitor) VisitMethod(method *java.JavaTypeMethod, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitMultiCatch(multiCatch *java.JavaTypeMultiCatch, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitParameterized(parameterized *java.JavaTypeParameterized, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitPrimitive(primitive *java.JavaTypePrimitive, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitShallowClass(shallow *java.JavaTypeShallowClass, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitUnknown(unknown *java.JavaTypeUnknown, p any) java.JavaType
- func (v *JavaTypeVisitor) VisitVariable(variable *java.JavaTypeVariable, p any) java.JavaType
- type JavaTypeVisitorI
- type PendingAfterVisitsProvider
- type VisitorI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrainAfterVisits ¶
DrainAfterVisits applies any visitors that `editor` queued via GoVisitor.DoAfterVisit. After-visits can themselves queue more after-visits (transitive); this loops until no provider has anything left in its queue. Mirrors JavaVisitor's afterVisit drain semantics.
Returns the (possibly modified) tree. Callers should ALWAYS run this after the main editor.Visit so DoAfterVisit-queued follow-ups land. Pass `editor` as the recipe's TreeVisitor and the current tree + ctx.
func FirstEnclosing ¶
FirstEnclosing walks up the cursor chain to find the first ancestor matching the given type. The cursor itself is not considered — only ancestors.
func Init ¶
func Init[T any](v *T) *T
Init sets the Self field on a visitor to enable virtual dispatch, then returns the visitor. Works with any visitor struct that has an exported Self field (GoVisitor, JavaVisitor, XmlVisitor, etc.).
func (r *myRecipe) Editor() recipe.TreeVisitor {
return visitor.Init(&myVisitor{oldName: r.OldName})
}
Types ¶
type AfterVisitor ¶
AfterVisitor is the interface a follow-up visitor must satisfy to participate in DoAfterVisit. It's a structural alias for the recipe.TreeVisitor interface — duplicated here to avoid an import cycle between pkg/visitor and pkg/recipe.
type AfterVisitsProvider ¶
type AfterVisitsProvider interface {
AfterVisits() []AfterVisitor
DoAfterVisit(AfterVisitor)
}
AfterVisitsProvider is the structural interface a visitor implements to expose its DoAfterVisit queue. GoVisitor satisfies it; user-defined visitors that embed GoVisitor inherit the methods automatically.
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor tracks the path from root to the currently visited node and carries a per-frame message map so passes can stash state for ancestors / descendants. Mirrors org.openrewrite.Cursor in Java.
func BuildChain ¶
BuildChain constructs a cursor chain from a list of tree values, root first. Returns nil for an empty input. Used by the RPC layer to reconstruct the cursor from a Visit request's `cursor` field (a list of tree IDs whose values have already been fetched in order).
func (*Cursor) ComputeMessageIfAbsent ¶
ComputeMessageIfAbsent returns the value for the key on THIS frame, computing and storing it via the supplier if absent. Mirrors Java Cursor.computeMessageIfAbsent.
func (*Cursor) GetMessage ¶
GetMessage returns the value previously stored on THIS frame, or nil if no value exists. Does not walk up the parent chain. Mirrors Java Cursor.getMessage(String).
func (*Cursor) GetNearestMessage ¶
GetNearestMessage walks up the cursor chain (starting from this frame) returning the first matching value. Returns nil if no frame has a value for the key. Mirrors Java Cursor.getNearestMessage(String).
func (*Cursor) GetNearestMessageOrDefault ¶
GetNearestMessageOrDefault is GetNearestMessage with a fallback when no frame holds a value for the key.
func (*Cursor) PollNearestMessage ¶
PollNearestMessage walks up the chain like GetNearestMessage, but REMOVES the value from the frame where it was found. Returns nil if no frame had it. Mirrors Java Cursor.pollNearestMessage(String).
func (*Cursor) PutMessage ¶
PutMessage stores a value on this cursor's frame, keyed by name. Mirrors Java Cursor.putMessage(String, Object).
func (*Cursor) PutMessageOnFirstEnclosing ¶
PutMessageOnFirstEnclosing walks up looking for the first ancestor whose value matches the predicate, and stores the message on that frame. No-op if no ancestor matches. Mirrors Java Cursor.putMessageOnFirstEnclosing(Class, String, Object), generalized to a predicate so callers can match on any type or condition.
type GoVisitor ¶
type GoVisitor struct {
// Self must point to the outermost embedding struct for virtual dispatch.
// If nil, dispatches to the default implementations on GoVisitor itself.
Self interface{}
// contains filtered or unexported fields
}
GoVisitor traverses and optionally transforms an OpenRewrite LST. Embed GoVisitor in a struct and override visit methods to customize behavior. Set Self to the outer struct to enable virtual dispatch.
Cursor: GoVisitor maintains the current cursor as state. Recipes that need ancestor context call v.Cursor() inside any Visit* override (matches the JavaVisitor.getCursor() pattern). The RPC layer seeds an initial cursor via SetCursor before traversal begins.
After-visits: a visit method can queue follow-up visitors via DoAfterVisit. The recipe runner drains the queue once the main visit returns and re-applies each queued visitor (transitively — afters can queue afters). This mirrors JavaVisitor.doAfterVisit and is the canonical way to compose side-effects like "add an import" after the main edit.
func (*GoVisitor) AfterVisits ¶
func (v *GoVisitor) AfterVisits() []AfterVisitor
AfterVisits returns the queued follow-up visitors, then clears the queue. The recipe runner calls this once the main Visit returns and applies each visitor to the modified tree, looping until empty.
func (*GoVisitor) Cursor ¶
Cursor returns the current cursor (the path from root to the node currently being visited). Mirrors JavaVisitor.getCursor().
func (*GoVisitor) DoAfterVisit ¶
func (v *GoVisitor) DoAfterVisit(other AfterVisitor)
DoAfterVisit queues a follow-up visitor to run after the main visit completes. Mirrors JavaVisitor.doAfterVisit. Use this from inside any Visit* override to compose side-effects like adding an import:
svc := service.ImportServiceFor(cu)
v.DoAfterVisit(svc.AddImportVisitor("fmt", nil, false))
The recipe runner drains the queue after Visit returns; queued visitors can themselves queue more after-visitors (transitive).
func (*GoVisitor) PendingAfterVisits ¶ added in v0.0.9
func (v *GoVisitor) PendingAfterVisits() []AfterVisitor
PendingAfterVisits returns the currently queued follow-up visitors without clearing the queue. Helper APIs use this to keep convenience methods like MaybeAddImport idempotent before the drain runs.
func (*GoVisitor) PreVisit ¶
PreVisit is the per-node hook called by Visit() before dispatching to the type-specific Visit* method. The default implementation is the identity function. RPC senders/receivers override it to serialize/deserialize the cross-cutting `id`, `prefix`, and `markers` fields once per node, mirroring Java's JavaVisitor.preVisit pattern.
func (*GoVisitor) SetCursor ¶
SetCursor seeds the visitor with an initial cursor chain. The RPC layer calls this with the chain reconstructed from a Visit request's cursor IDs before invoking Visit. Recipes typically don't call this directly.
func (*GoVisitor) Visit ¶
Visit dispatches to the appropriate visit method based on the node's concrete type.
Lifecycle:
- cursor is pushed for `t`.
- PreVisit(t, p) is called via virtual dispatch — subclasses (e.g. RPC sender/receiver) override it to handle cross-cutting fields (id, prefix, markers) once per node.
- The type-specific Visit* method is dispatched via virtual dispatch on the (possibly modified) tree returned by PreVisit.
- cursor pops on return.
PreVisit returning nil short-circuits the visit — useful for receivers that get DELETE state from the wire.
func (*GoVisitor) VisitAnnotation ¶
func (*GoVisitor) VisitArrayAccess ¶
func (*GoVisitor) VisitArrayDimension ¶
func (*GoVisitor) VisitArrayType ¶
func (*GoVisitor) VisitAssignment ¶
func (*GoVisitor) VisitAssignmentOperation ¶
func (*GoVisitor) VisitCommClause ¶
func (*GoVisitor) VisitCompilationUnit ¶
func (*GoVisitor) VisitComposite ¶
func (*GoVisitor) VisitControlParentheses ¶
func (*GoVisitor) VisitDeclarationBlock ¶ added in v0.0.12
func (*GoVisitor) VisitElse ¶
VisitElse handles the synthetic *java.Else wrapper that JavaSender produces for RPC parity with Java's J.If.Else. The node never appears in a parsed Go AST — language-level recipes go through VisitIf instead — so the default implementation simply visits the body so traversal terminates correctly.
func (*GoVisitor) VisitFallthrough ¶
func (*GoVisitor) VisitFieldAccess ¶
func (*GoVisitor) VisitForControl ¶
func (*GoVisitor) VisitForEachControl ¶
func (*GoVisitor) VisitForEachLoop ¶
func (*GoVisitor) VisitForLoop ¶
func (*GoVisitor) VisitFuncType ¶
func (*GoVisitor) VisitGoArrayType ¶ added in v0.0.13
func (*GoVisitor) VisitGoAssignmentOperation ¶ added in v0.0.6
func (*GoVisitor) VisitGoBinary ¶ added in v0.0.6
func (*GoVisitor) VisitGoMethodDeclaration ¶ added in v0.0.12
func (*GoVisitor) VisitGoMod ¶ added in v0.0.10
func (*GoVisitor) VisitGoModBlock ¶ added in v0.0.10
func (*GoVisitor) VisitGoModDirective ¶ added in v0.0.10
func (*GoVisitor) VisitGoModValue ¶ added in v0.0.10
func (*GoVisitor) VisitGoReturn ¶ added in v0.0.11
func (*GoVisitor) VisitGoUnary ¶ added in v0.0.6
func (*GoVisitor) VisitGoVariadic ¶ added in v0.0.6
func (*GoVisitor) VisitIdentifier ¶
func (*GoVisitor) VisitIndexList ¶
func (*GoVisitor) VisitInterfaceType ¶
func (*GoVisitor) VisitKeyValue ¶
func (*GoVisitor) VisitMethodDeclaration ¶
func (*GoVisitor) VisitMethodInvocation ¶
func (*GoVisitor) VisitMultiAssignment ¶
func (*GoVisitor) VisitParameterizedType ¶
func (*GoVisitor) VisitParentheses ¶
func (*GoVisitor) VisitPointerType ¶
func (*GoVisitor) VisitStatementExpression ¶
func (*GoVisitor) VisitStatementWithInit ¶ added in v0.0.13
func (*GoVisitor) VisitStructType ¶
func (*GoVisitor) VisitTypeCast ¶
func (*GoVisitor) VisitTypeDecl ¶
func (*GoVisitor) VisitTypeList ¶
func (*GoVisitor) VisitTypeParameter ¶ added in v0.0.5
func (*GoVisitor) VisitTypeParameters ¶ added in v0.0.5
func (*GoVisitor) VisitUnderlyingType ¶ added in v0.0.5
func (*GoVisitor) VisitUnion ¶ added in v0.0.5
func (*GoVisitor) VisitVariableDeclarations ¶
func (*GoVisitor) VisitVariableDeclarator ¶
type JavaTypeVisitor ¶
type JavaTypeVisitor struct {
// Self must point to the outermost embedding struct for virtual dispatch.
Self JavaTypeVisitorI
}
JavaTypeVisitor traverses and optionally transforms JavaType instances. Mirrors org.openrewrite.java.JavaTypeVisitor in Java. Embed in a struct and override visit methods to customize behavior.
func (*JavaTypeVisitor) Visit ¶
Visit dispatches to the appropriate visit method based on concrete type.
func (*JavaTypeVisitor) VisitAnnotation ¶
func (v *JavaTypeVisitor) VisitAnnotation(annotation *java.JavaTypeAnnotation, p any) java.JavaType
func (*JavaTypeVisitor) VisitArray ¶
func (v *JavaTypeVisitor) VisitArray(array *java.JavaTypeArray, p any) java.JavaType
func (*JavaTypeVisitor) VisitClass ¶
func (v *JavaTypeVisitor) VisitClass(class_ *java.JavaTypeClass, p any) java.JavaType
func (*JavaTypeVisitor) VisitGenericTypeVariable ¶
func (v *JavaTypeVisitor) VisitGenericTypeVariable(generic *java.JavaTypeGenericTypeVariable, p any) java.JavaType
func (*JavaTypeVisitor) VisitIntersection ¶
func (v *JavaTypeVisitor) VisitIntersection(intersection *java.JavaTypeIntersection, p any) java.JavaType
func (*JavaTypeVisitor) VisitMethod ¶
func (v *JavaTypeVisitor) VisitMethod(method *java.JavaTypeMethod, p any) java.JavaType
func (*JavaTypeVisitor) VisitMultiCatch ¶
func (v *JavaTypeVisitor) VisitMultiCatch(multiCatch *java.JavaTypeMultiCatch, p any) java.JavaType
func (*JavaTypeVisitor) VisitParameterized ¶
func (v *JavaTypeVisitor) VisitParameterized(parameterized *java.JavaTypeParameterized, p any) java.JavaType
func (*JavaTypeVisitor) VisitPrimitive ¶
func (v *JavaTypeVisitor) VisitPrimitive(primitive *java.JavaTypePrimitive, p any) java.JavaType
func (*JavaTypeVisitor) VisitShallowClass ¶ added in v0.0.3
func (v *JavaTypeVisitor) VisitShallowClass(shallow *java.JavaTypeShallowClass, p any) java.JavaType
func (*JavaTypeVisitor) VisitUnknown ¶
func (v *JavaTypeVisitor) VisitUnknown(unknown *java.JavaTypeUnknown, p any) java.JavaType
func (*JavaTypeVisitor) VisitVariable ¶
func (v *JavaTypeVisitor) VisitVariable(variable *java.JavaTypeVariable, p any) java.JavaType
type JavaTypeVisitorI ¶
type JavaTypeVisitorI interface {
Visit(javaType java.JavaType, p any) java.JavaType
VisitAnnotation(annotation *java.JavaTypeAnnotation, p any) java.JavaType
VisitArray(array *java.JavaTypeArray, p any) java.JavaType
VisitClass(class_ *java.JavaTypeClass, p any) java.JavaType
VisitShallowClass(shallow *java.JavaTypeShallowClass, p any) java.JavaType
VisitGenericTypeVariable(generic *java.JavaTypeGenericTypeVariable, p any) java.JavaType
VisitIntersection(intersection *java.JavaTypeIntersection, p any) java.JavaType
VisitMethod(method *java.JavaTypeMethod, p any) java.JavaType
VisitMultiCatch(multiCatch *java.JavaTypeMultiCatch, p any) java.JavaType
VisitParameterized(parameterized *java.JavaTypeParameterized, p any) java.JavaType
VisitPrimitive(primitive *java.JavaTypePrimitive, p any) java.JavaType
VisitUnknown(unknown *java.JavaTypeUnknown, p any) java.JavaType
VisitVariable(variable *java.JavaTypeVariable, p any) java.JavaType
}
JavaTypeVisitorI defines all overridable visit methods for JavaType.
type PendingAfterVisitsProvider ¶ added in v0.0.9
type PendingAfterVisitsProvider interface {
PendingAfterVisits() []AfterVisitor
}
PendingAfterVisitsProvider is implemented by visitors that can expose their queued after-visits without draining them.
type VisitorI ¶
type VisitorI interface {
Visit(t java.Tree, p any) java.Tree
PreVisit(t java.Tree, p any) java.Tree
VisitCompilationUnit(cu *golang.CompilationUnit, p any) java.J
// go.mod nodes are Tree, not J (their tokens are not Java
// expressions), so these return java.Tree rather than java.J.
VisitGoMod(gm *golang.GoMod, p any) java.Tree
VisitGoModDirective(d *golang.GoModDirective, p any) java.Tree
VisitGoModBlock(b *golang.GoModBlock, p any) java.Tree
VisitGoModValue(val *golang.GoModValue, p any) java.Tree
VisitIdentifier(ident *java.Identifier, p any) java.J
VisitLiteral(lit *java.Literal, p any) java.J
VisitBinary(bin *java.Binary, p any) java.J
VisitBlock(block *java.Block, p any) java.J
VisitReturn(ret *java.Return, p any) java.J
VisitIf(ifStmt *java.If, p any) java.J
VisitElse(el *java.Else, p any) java.J
VisitAssignment(assign *java.Assignment, p any) java.J
VisitMethodDeclaration(md *java.MethodDeclaration, p any) java.J
VisitFieldAccess(fa *java.FieldAccess, p any) java.J
VisitMethodInvocation(mi *java.MethodInvocation, p any) java.J
VisitVariableDeclarations(vd *java.VariableDeclarations, p any) java.J
VisitDeclarationBlock(db *golang.DeclarationBlock, p any) java.J
VisitVariableDeclarator(vd *java.VariableDeclarator, p any) java.J
VisitImport(imp *java.Import, p any) java.J
VisitUnary(unary *java.Unary, p any) java.J
VisitAssignmentOperation(ao *java.AssignmentOperation, p any) java.J
VisitSwitch(sw *java.Switch, p any) java.J
VisitCase(c *java.Case, p any) java.J
VisitForLoop(forLoop *java.ForLoop, p any) java.J
VisitForControl(control *java.ForControl, p any) java.J
VisitForEachLoop(forEach *java.ForEachLoop, p any) java.J
VisitForEachControl(control *java.ForEachControl, p any) java.J
VisitBreak(b *java.Break, p any) java.J
VisitContinue(c *java.Continue, p any) java.J
VisitLabel(l *java.Label, p any) java.J
VisitGoStmt(g *golang.GoStmt, p any) java.J
VisitDefer(d *golang.Defer, p any) java.J
VisitSend(s *golang.Send, p any) java.J
VisitGoto(g *golang.Goto, p any) java.J
VisitFallthrough(f *golang.Fallthrough, p any) java.J
VisitEmpty(empty *java.Empty, p any) java.J
VisitAnnotation(ann *java.Annotation, p any) java.J
VisitArrayType(at *java.ArrayType, p any) java.J
VisitGoArrayType(at *golang.ArrayType, p any) java.J
VisitParentheses(paren *java.Parentheses, p any) java.J
VisitTypeCast(tc *java.TypeCast, p any) java.J
VisitControlParentheses(cp *java.ControlParentheses, p any) java.J
VisitArrayAccess(aa *java.ArrayAccess, p any) java.J
VisitParameterizedType(pt *java.ParameterizedType, p any) java.J
VisitTypeParameters(tps *java.TypeParameters, p any) java.J
VisitTypeParameter(tp *java.TypeParameter, p any) java.J
VisitIndexList(il *golang.IndexList, p any) java.J
VisitArrayDimension(ad *java.ArrayDimension, p any) java.J
VisitComposite(c *golang.Composite, p any) java.J
VisitKeyValue(kv *golang.KeyValue, p any) java.J
VisitSlice(s *golang.Slice, p any) java.J
VisitMapType(mt *golang.MapType, p any) java.J
VisitStatementExpression(se *golang.StatementExpression, p any) java.J
VisitPointerType(pt *golang.PointerType, p any) java.J
VisitChannel(ch *golang.Channel, p any) java.J
VisitFuncType(ft *golang.FuncType, p any) java.J
VisitTypeList(tl *golang.TypeList, p any) java.J
VisitUnion(u *golang.Union, p any) java.J
VisitUnderlyingType(ut *golang.UnderlyingType, p any) java.J
VisitTypeDecl(td *golang.TypeDecl, p any) java.J
VisitStructType(st *golang.StructType, p any) java.J
VisitInterfaceType(it *golang.InterfaceType, p any) java.J
VisitMultiAssignment(ma *golang.MultiAssignment, p any) java.J
VisitGoReturn(ret *golang.Return, p any) java.J
VisitGoMethodDeclaration(md *golang.MethodDeclaration, p any) java.J
VisitStatementWithInit(s *golang.StatementWithInit, p any) java.J
VisitCommClause(cc *golang.CommClause, p any) java.J
VisitGoUnary(u *golang.Unary, p any) java.J
VisitGoBinary(b *golang.Binary, p any) java.J
VisitGoAssignmentOperation(a *golang.AssignmentOperation, p any) java.J
VisitGoVariadic(v *golang.Variadic, p any) java.J
VisitSpace(space java.Space, p any) java.Space
VisitType(javaType java.JavaType, p any) java.JavaType
}
VisitorI defines all overridable visit methods.