Documentation
¶
Overview ¶
Code generated by hand for J interface conformance — keep in sync with the J types declared in j.go and go.go. Each J node satisfies the polymorphic accessors GetID / WithID / GetPrefix / GetMarkers, mirroring rewrite-java's J.getId() / J.withId() / J.getPrefix() / J.getMarkers().
WithID returns a fresh instance, which is what the visitor framework's pointer-identity change detection requires. Prefix/marker withers remain typed per node in j.go / go.go.
Index ¶
- Constants
- Variables
- func CollectSearchResultIDs(t Tree) []uuid.UUID
- func FindMarker[T any](markers Markers) *T
- func HasMarker[T any](markers Markers) bool
- func TypeSignature(t JavaType) string
- func UnwrapRightPadded[T any](padded []RightPadded[T]) []T
- type Annotation
- func (n *Annotation) GetID() uuid.UUID
- func (n *Annotation) GetMarkers() Markers
- func (n *Annotation) GetPrefix() Space
- func (n *Annotation) WithAnnotationType(annotationType Expression) *Annotation
- func (n *Annotation) WithArguments(arguments *Container[Expression]) *Annotation
- func (n *Annotation) WithID(id uuid.UUID) J
- func (n *Annotation) WithMarkers(markers Markers) *Annotation
- func (n *Annotation) WithPrefix(prefix Space) *Annotation
- type ArrayAccess
- type ArrayDimension
- func (n *ArrayDimension) GetID() uuid.UUID
- func (n *ArrayDimension) GetMarkers() Markers
- func (n *ArrayDimension) GetPrefix() Space
- func (n *ArrayDimension) WithID(id uuid.UUID) J
- func (n *ArrayDimension) WithMarkers(markers Markers) *ArrayDimension
- func (n *ArrayDimension) WithPrefix(prefix Space) *ArrayDimension
- type ArrayType
- type AssignOp
- type Assignment
- func (n *Assignment) GetID() uuid.UUID
- func (n *Assignment) GetMarkers() Markers
- func (n *Assignment) GetPrefix() Space
- func (n *Assignment) WithID(id uuid.UUID) J
- func (n *Assignment) WithMarkers(markers Markers) *Assignment
- func (n *Assignment) WithPrefix(prefix Space) *Assignment
- func (n *Assignment) WithVariable(variable Expression) *Assignment
- type AssignmentOperation
- func (n *AssignmentOperation) GetID() uuid.UUID
- func (n *AssignmentOperation) GetMarkers() Markers
- func (n *AssignmentOperation) GetPrefix() Space
- func (n *AssignmentOperation) WithID(id uuid.UUID) J
- func (n *AssignmentOperation) WithMarkers(markers Markers) *AssignmentOperation
- func (n *AssignmentOperation) WithPrefix(prefix Space) *AssignmentOperation
- func (n *AssignmentOperation) WithVariable(variable Expression) *AssignmentOperation
- type AssignmentOperator
- type Binary
- func (n *Binary) GetID() uuid.UUID
- func (n *Binary) GetMarkers() Markers
- func (n *Binary) GetPrefix() Space
- func (n *Binary) WithID(id uuid.UUID) J
- func (n *Binary) WithLeft(left Expression) *Binary
- func (n *Binary) WithMarkers(markers Markers) *Binary
- func (n *Binary) WithPrefix(prefix Space) *Binary
- func (n *Binary) WithRight(right Expression) *Binary
- type BinaryOperator
- type Block
- func (n *Block) GetID() uuid.UUID
- func (n *Block) GetMarkers() Markers
- func (n *Block) GetPrefix() Space
- func (n *Block) WithEnd(end Space) *Block
- func (n *Block) WithID(id uuid.UUID) J
- func (n *Block) WithMarkers(markers Markers) *Block
- func (n *Block) WithPrefix(prefix Space) *Block
- func (n *Block) WithStatements(statements []RightPadded[Statement]) *Block
- type Break
- type Case
- type ChanDir
- type ChanDirMarker
- type Channel
- type CommClause
- type Comment
- type CommentKind
- type CompilationUnit
- func (n *CompilationUnit) GetID() uuid.UUID
- func (n *CompilationUnit) GetMarkers() Markers
- func (n *CompilationUnit) GetPrefix() Space
- func (n *CompilationUnit) WithEOF(eof Space) *CompilationUnit
- func (n *CompilationUnit) WithID(id uuid.UUID) J
- func (n *CompilationUnit) WithImports(imports *Container[*Import]) *CompilationUnit
- func (n *CompilationUnit) WithMarkers(markers Markers) *CompilationUnit
- func (n *CompilationUnit) WithPackageDecl(pkg *RightPadded[*Identifier]) *CompilationUnit
- func (n *CompilationUnit) WithPrefix(prefix Space) *CompilationUnit
- func (n *CompilationUnit) WithStatements(statements []RightPadded[Statement]) *CompilationUnit
- type Composite
- type ConstDecl
- type Container
- type Continue
- type ControlParentheses
- func (n *ControlParentheses) GetID() uuid.UUID
- func (n *ControlParentheses) GetMarkers() Markers
- func (n *ControlParentheses) GetPrefix() Space
- func (n *ControlParentheses) WithID(id uuid.UUID) J
- func (n *ControlParentheses) WithMarkers(markers Markers) *ControlParentheses
- func (n *ControlParentheses) WithPrefix(prefix Space) *ControlParentheses
- type Defer
- type Else
- type Empty
- type Expression
- type Fallthrough
- type FieldAccess
- func (n *FieldAccess) GetID() uuid.UUID
- func (n *FieldAccess) GetMarkers() Markers
- func (n *FieldAccess) GetPrefix() Space
- func (n *FieldAccess) WithID(id uuid.UUID) J
- func (n *FieldAccess) WithMarkers(markers Markers) *FieldAccess
- func (n *FieldAccess) WithPrefix(prefix Space) *FieldAccess
- func (n *FieldAccess) WithTarget(target Expression) *FieldAccess
- type ForControl
- type ForEachControl
- func (n *ForEachControl) GetID() uuid.UUID
- func (n *ForEachControl) GetMarkers() Markers
- func (n *ForEachControl) GetPrefix() Space
- func (n *ForEachControl) WithID(id uuid.UUID) J
- func (n *ForEachControl) WithMarkers(markers Markers) *ForEachControl
- func (n *ForEachControl) WithPrefix(prefix Space) *ForEachControl
- type ForEachLoop
- func (n *ForEachLoop) GetID() uuid.UUID
- func (n *ForEachLoop) GetMarkers() Markers
- func (n *ForEachLoop) GetPrefix() Space
- func (n *ForEachLoop) WithBody(body *Block) *ForEachLoop
- func (n *ForEachLoop) WithID(id uuid.UUID) J
- func (n *ForEachLoop) WithMarkers(markers Markers) *ForEachLoop
- func (n *ForEachLoop) WithPrefix(prefix Space) *ForEachLoop
- type ForLoop
- func (n *ForLoop) GetID() uuid.UUID
- func (n *ForLoop) GetMarkers() Markers
- func (n *ForLoop) GetPrefix() Space
- func (n *ForLoop) WithBody(body *Block) *ForLoop
- func (n *ForLoop) WithID(id uuid.UUID) J
- func (n *ForLoop) WithMarkers(markers Markers) *ForLoop
- func (n *ForLoop) WithPrefix(prefix Space) *ForLoop
- type FullyQualified
- type FuncType
- type GenericMarker
- type GoExclude
- type GoProject
- type GoReplace
- type GoRequire
- type GoResolutionResult
- type GoResolvedDependency
- type GoRetract
- type GoStmt
- type Goto
- type GroupedImport
- type GroupedSpec
- type Identifier
- func (n *Identifier) GetID() uuid.UUID
- func (n *Identifier) GetMarkers() Markers
- func (n *Identifier) GetPrefix() Space
- func (n *Identifier) WithFieldType(ft *JavaTypeVariable) *Identifier
- func (n *Identifier) WithID(id uuid.UUID) J
- func (n *Identifier) WithMarkers(markers Markers) *Identifier
- func (n *Identifier) WithName(name string) *Identifier
- func (n *Identifier) WithPrefix(prefix Space) *Identifier
- func (n *Identifier) WithType(t JavaType) *Identifier
- type If
- func (n *If) GetID() uuid.UUID
- func (n *If) GetMarkers() Markers
- func (n *If) GetPrefix() Space
- func (n *If) WithCondition(condition Expression) *If
- func (n *If) WithID(id uuid.UUID) J
- func (n *If) WithMarkers(markers Markers) *If
- func (n *If) WithPrefix(prefix Space) *If
- func (n *If) WithThen(then *Block) *If
- type Import
- type ImportBlock
- type IndexList
- type InterfaceMethod
- type InterfaceType
- func (n *InterfaceType) GetID() uuid.UUID
- func (n *InterfaceType) GetMarkers() Markers
- func (n *InterfaceType) GetPrefix() Space
- func (n *InterfaceType) WithID(id uuid.UUID) J
- func (n *InterfaceType) WithMarkers(markers Markers) *InterfaceType
- func (n *InterfaceType) WithPrefix(prefix Space) *InterfaceType
- type J
- type JavaType
- type JavaTypeAnnotation
- type JavaTypeAnnotationArrayElementValue
- type JavaTypeAnnotationElementValue
- type JavaTypeAnnotationSingleElementValue
- type JavaTypeArray
- type JavaTypeClass
- type JavaTypeGenericTypeVariable
- type JavaTypeIntersection
- type JavaTypeMethod
- type JavaTypeMultiCatch
- type JavaTypeParameterized
- type JavaTypePrimitive
- type JavaTypeShallowClass
- type JavaTypeUnknown
- type JavaTypeVariable
- type KeyValue
- type Label
- type LeftPadded
- type Literal
- func (n *Literal) GetID() uuid.UUID
- func (n *Literal) GetMarkers() Markers
- func (n *Literal) GetPrefix() Space
- func (n *Literal) WithID(id uuid.UUID) J
- func (n *Literal) WithMarkers(markers Markers) *Literal
- func (n *Literal) WithPrefix(prefix Space) *Literal
- func (n *Literal) WithSource(source string) *Literal
- func (n *Literal) WithValue(value any) *Literal
- type LiteralKind
- type MapType
- type Marker
- type Markers
- func AddMarker(markers Markers, marker Marker) Markers
- func FoundSearchResult(markers Markers, description string) Markers
- func MarkupError(markers Markers, message string) Markers
- func MarkupInfo(markers Markers, message string) Markers
- func MarkupWarn(markers Markers, message string) Markers
- func MarkupWarnDetail(markers Markers, message, detail string) Markers
- type Markup
- type MarkupLevel
- type MethodDeclaration
- func (n *MethodDeclaration) GetID() uuid.UUID
- func (n *MethodDeclaration) GetMarkers() Markers
- func (n *MethodDeclaration) GetPrefix() Space
- func (n *MethodDeclaration) WithBody(body *Block) *MethodDeclaration
- func (n *MethodDeclaration) WithID(id uuid.UUID) J
- func (n *MethodDeclaration) WithLeadingAnnotations(anns []*Annotation) *MethodDeclaration
- func (n *MethodDeclaration) WithMarkers(markers Markers) *MethodDeclaration
- func (n *MethodDeclaration) WithName(name *Identifier) *MethodDeclaration
- func (n *MethodDeclaration) WithPrefix(prefix Space) *MethodDeclaration
- type MethodInvocation
- func (n *MethodInvocation) GetID() uuid.UUID
- func (n *MethodInvocation) GetMarkers() Markers
- func (n *MethodInvocation) GetPrefix() Space
- func (n *MethodInvocation) WithID(id uuid.UUID) J
- func (n *MethodInvocation) WithMarkers(markers Markers) *MethodInvocation
- func (n *MethodInvocation) WithName(name *Identifier) *MethodInvocation
- func (n *MethodInvocation) WithPrefix(prefix Space) *MethodInvocation
- type MultiAssignment
- func (n *MultiAssignment) GetID() uuid.UUID
- func (n *MultiAssignment) GetMarkers() Markers
- func (n *MultiAssignment) GetPrefix() Space
- func (n *MultiAssignment) WithID(id uuid.UUID) J
- func (n *MultiAssignment) WithMarkers(markers Markers) *MultiAssignment
- func (n *MultiAssignment) WithPrefix(prefix Space) *MultiAssignment
- type ParameterizedType
- func (n *ParameterizedType) GetID() uuid.UUID
- func (n *ParameterizedType) GetMarkers() Markers
- func (n *ParameterizedType) GetPrefix() Space
- func (n *ParameterizedType) WithID(id uuid.UUID) J
- func (n *ParameterizedType) WithMarkers(markers Markers) *ParameterizedType
- func (n *ParameterizedType) WithPrefix(prefix Space) *ParameterizedType
- type Parentheses
- type ParseError
- type ParseExceptionResult
- type PointerType
- type Return
- type RightPadded
- type SearchResult
- type SearchResultMarker
- type SelectStmt
- type Semicolon
- type Send
- type ShortVarDecl
- type Slice
- type SourceFile
- type Space
- type Statement
- type StatementExpression
- func (n *StatementExpression) GetID() uuid.UUID
- func (n *StatementExpression) GetMarkers() Markers
- func (n *StatementExpression) GetPrefix() Space
- func (n *StatementExpression) WithID(id uuid.UUID) J
- func (n *StatementExpression) WithMarkers(markers Markers) *StatementExpression
- func (n *StatementExpression) WithPrefix(prefix Space) *StatementExpression
- type StructTag
- type StructType
- type Switch
- type TrailingComma
- type Tree
- type TypeCast
- type TypeDecl
- func (n *TypeDecl) GetID() uuid.UUID
- func (n *TypeDecl) GetMarkers() Markers
- func (n *TypeDecl) GetPrefix() Space
- func (n *TypeDecl) WithID(id uuid.UUID) J
- func (n *TypeDecl) WithLeadingAnnotations(anns []*Annotation) *TypeDecl
- func (n *TypeDecl) WithMarkers(markers Markers) *TypeDecl
- func (n *TypeDecl) WithPrefix(prefix Space) *TypeDecl
- type TypeList
- type TypeSwitchGuard
- type Unary
- type UnaryOperator
- type VarKeyword
- type VariableDeclarations
- func (n *VariableDeclarations) GetID() uuid.UUID
- func (n *VariableDeclarations) GetMarkers() Markers
- func (n *VariableDeclarations) GetPrefix() Space
- func (n *VariableDeclarations) WithID(id uuid.UUID) J
- func (n *VariableDeclarations) WithLeadingAnnotations(anns []*Annotation) *VariableDeclarations
- func (n *VariableDeclarations) WithMarkers(markers Markers) *VariableDeclarations
- func (n *VariableDeclarations) WithPrefix(prefix Space) *VariableDeclarations
- type VariableDeclarator
- func (n *VariableDeclarator) GetID() uuid.UUID
- func (n *VariableDeclarator) GetMarkers() Markers
- func (n *VariableDeclarator) GetPrefix() Space
- func (n *VariableDeclarator) WithID(id uuid.UUID) J
- func (n *VariableDeclarator) WithMarkers(markers Markers) *VariableDeclarator
- func (n *VariableDeclarator) WithName(name *Identifier) *VariableDeclarator
- func (n *VariableDeclarator) WithPrefix(prefix Space) *VariableDeclarator
Constants ¶
const ( JavaTypeClassKind = "org.openrewrite.java.tree.JavaType$Class" JavaTypeShallowClassKind = "org.openrewrite.java.tree.JavaType$ShallowClass" JavaTypeParameterizedKind = "org.openrewrite.java.tree.JavaType$Parameterized" JavaTypeGenericTypeVariableKind = "org.openrewrite.java.tree.JavaType$GenericTypeVariable" JavaTypeArrayKind = "org.openrewrite.java.tree.JavaType$Array" JavaTypePrimitiveKind = "org.openrewrite.java.tree.JavaType$Primitive" JavaTypeMethodKind = "org.openrewrite.java.tree.JavaType$Method" JavaTypeVariableKind = "org.openrewrite.java.tree.JavaType$Variable" JavaTypeAnnotationKind = "org.openrewrite.java.tree.JavaType$Annotation" JavaTypeAnnotationSingleElementValueKind = "org.openrewrite.java.tree.JavaType$Annotation$SingleElementValue" JavaTypeAnnotationArrayElementValueKind = "org.openrewrite.java.tree.JavaType$Annotation$ArrayElementValue" JavaTypeMultiCatchKind = "org.openrewrite.java.tree.JavaType$MultiCatch" JavaTypeIntersectionKind = "org.openrewrite.java.tree.JavaType$Intersection" JavaTypeUnknownKind = "org.openrewrite.java.tree.JavaType$Unknown" )
Java class name constants for RPC deserialization.
Variables ¶
var EmptySpace = Space{}
EmptySpace is the zero-value Space with no whitespace or comments.
var SingleSpace = Space{Whitespace: " "}
SingleSpace is a Space containing exactly one space character.
var UnknownType = &JavaTypeUnknown{}
UnknownType is the singleton instance of JavaTypeUnknown.
Functions ¶
func CollectSearchResultIDs ¶
CollectSearchResultIDs walks the given tree and returns the IDs of every SearchResult and SearchResultMarker found in any node's Markers. The returned slice has stable insertion order; duplicates are dropped.
Implementation: reflection-based descent. Every LST node has a `Markers Markers` field, plus zero or more child fields that are themselves trees (or wrappers like RightPadded / LeftPadded / Container holding trees). A visitor-based walker would be cleaner but would require every concrete node type to opt in; reflection lets BatchVisit collect search markers without touching the 60+ node definitions.
func FindMarker ¶
FindMarker returns a pointer to the first marker of type T, or nil if not found.
func TypeSignature ¶
TypeSignature computes a string signature for a JavaType, used for list identity tracking in the RPC protocol. Mirrors DefaultJavaTypeSignatureBuilder in Java.
func UnwrapRightPadded ¶
func UnwrapRightPadded[T any](padded []RightPadded[T]) []T
UnwrapRightPadded extracts the elements from a slice of RightPadded wrappers.
Types ¶
type Annotation ¶
type Annotation struct {
ID uuid.UUID
Prefix Space
Markers Markers
AnnotationType Expression // NameTree — Identifier or FieldAccess
Arguments *Container[Expression] // nullable; tags always have one Literal
}
Annotation represents annotation metadata attached to a declaration. Mirrors org.openrewrite.java.tree.J.Annotation.
Java has first-class `@Annotation(args)` syntax. Go has no `@`, but has two analogous concepts that this type models uniformly:
Struct field tags. Each `key:"value"` pair in a struct field tag becomes one Annotation on the field's VariableDeclarations: AnnotationType = Identifier{Name: key}, Arguments = [Literal{Value: value}]. The printer renders the run of struct-tag annotations on a VariableDeclarations whose parent is a StructType as a single backtick-wrapped tag.
Source directives like `//go:noinline`, `//go:generate`, `//lint:ignore`. Each directive becomes one Annotation on the enclosing MethodDeclaration / TypeDecl / VariableDeclarations: AnnotationType = Identifier{Name: "go:noinline"}, Arguments = [Literal(args)] when the directive carries text after the keyword, else nil.
In both cases, AnnotationType is an Expression (typically Identifier; FieldAccess for qualified directives like `lint:ignore`).
Recipes use AnnotationService to inspect / match / mutate, mirroring Java's AnnotationService surface.
func (*Annotation) GetID ¶
func (n *Annotation) GetID() uuid.UUID
func (*Annotation) GetMarkers ¶
func (n *Annotation) GetMarkers() Markers
func (*Annotation) GetPrefix ¶
func (n *Annotation) GetPrefix() Space
func (*Annotation) WithAnnotationType ¶
func (n *Annotation) WithAnnotationType(annotationType Expression) *Annotation
func (*Annotation) WithArguments ¶
func (n *Annotation) WithArguments(arguments *Container[Expression]) *Annotation
func (*Annotation) WithMarkers ¶
func (n *Annotation) WithMarkers(markers Markers) *Annotation
func (*Annotation) WithPrefix ¶
func (n *Annotation) WithPrefix(prefix Space) *Annotation
type ArrayAccess ¶
type ArrayAccess struct {
ID uuid.UUID
Prefix Space
Markers Markers
Indexed Expression
Dimension *ArrayDimension
Type JavaType // the result type (nullable)
}
ArrayAccess represents an index expression like `a[i]` or `m[key]`.
func (*ArrayAccess) GetID ¶
func (n *ArrayAccess) GetID() uuid.UUID
func (*ArrayAccess) GetMarkers ¶
func (n *ArrayAccess) GetMarkers() Markers
func (*ArrayAccess) GetPrefix ¶
func (n *ArrayAccess) GetPrefix() Space
func (*ArrayAccess) WithMarkers ¶
func (n *ArrayAccess) WithMarkers(markers Markers) *ArrayAccess
func (*ArrayAccess) WithPrefix ¶
func (n *ArrayAccess) WithPrefix(prefix Space) *ArrayAccess
type ArrayDimension ¶
type ArrayDimension struct {
ID uuid.UUID
Prefix Space
Markers Markers
Index RightPadded[Expression] // Element = index expr, After = space before `]`
}
ArrayDimension represents the `[index]` part of an array access.
func (*ArrayDimension) GetID ¶
func (n *ArrayDimension) GetID() uuid.UUID
func (*ArrayDimension) GetMarkers ¶
func (n *ArrayDimension) GetMarkers() Markers
func (*ArrayDimension) GetPrefix ¶
func (n *ArrayDimension) GetPrefix() Space
func (*ArrayDimension) WithMarkers ¶
func (n *ArrayDimension) WithMarkers(markers Markers) *ArrayDimension
func (*ArrayDimension) WithPrefix ¶
func (n *ArrayDimension) WithPrefix(prefix Space) *ArrayDimension
type ArrayType ¶
type ArrayType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Dimension LeftPadded[Space] // Before = space before `[`, Element = space inside brackets before `]`; for `[N]T`, the length expr is stored separately
Length Expression // nil for slices (`[]T`), non-nil for arrays (`[N]T`)
ElementType Expression // the element type
Type JavaType // the array type (nullable)
}
ArrayType represents an array or slice type like `[]T`, `[N]T`.
func (*ArrayType) GetMarkers ¶
func (*ArrayType) WithMarkers ¶
func (*ArrayType) WithPrefix ¶
type AssignOp ¶
type AssignOp int
AssignOp distinguishes := from = in assignment contexts.
func ParseAssignOp ¶
ParseAssignOp converts a string to an AssignOp. Accepts both the Go enum names emitted by AssignOp.String() ("Equals", "Define") and the Java-side source-symbol spellings ("=", ":=").
type Assignment ¶
type Assignment struct {
ID uuid.UUID
Prefix Space
Markers Markers
Variable Expression
Value LeftPadded[Expression]
Type JavaType // the result type (nullable)
}
Assignment represents an assignment statement like `x = expr`.
func (*Assignment) GetID ¶
func (n *Assignment) GetID() uuid.UUID
func (*Assignment) GetMarkers ¶
func (n *Assignment) GetMarkers() Markers
func (*Assignment) GetPrefix ¶
func (n *Assignment) GetPrefix() Space
func (*Assignment) WithMarkers ¶
func (n *Assignment) WithMarkers(markers Markers) *Assignment
func (*Assignment) WithPrefix ¶
func (n *Assignment) WithPrefix(prefix Space) *Assignment
func (*Assignment) WithVariable ¶
func (n *Assignment) WithVariable(variable Expression) *Assignment
type AssignmentOperation ¶
type AssignmentOperation struct {
ID uuid.UUID
Prefix Space
Markers Markers
Variable Expression
Operator LeftPadded[AssignmentOperator]
Assignment Expression
Type JavaType // the result type (nullable)
}
AssignmentOperation represents a compound assignment like `x += expr`.
func (*AssignmentOperation) GetID ¶
func (n *AssignmentOperation) GetID() uuid.UUID
func (*AssignmentOperation) GetMarkers ¶
func (n *AssignmentOperation) GetMarkers() Markers
func (*AssignmentOperation) GetPrefix ¶
func (n *AssignmentOperation) GetPrefix() Space
func (*AssignmentOperation) WithID ¶ added in v0.0.3
func (n *AssignmentOperation) WithID(id uuid.UUID) J
func (*AssignmentOperation) WithMarkers ¶
func (n *AssignmentOperation) WithMarkers(markers Markers) *AssignmentOperation
func (*AssignmentOperation) WithPrefix ¶
func (n *AssignmentOperation) WithPrefix(prefix Space) *AssignmentOperation
func (*AssignmentOperation) WithVariable ¶
func (n *AssignmentOperation) WithVariable(variable Expression) *AssignmentOperation
type AssignmentOperator ¶
type AssignmentOperator int
const ( AddAssign AssignmentOperator = iota + 1 // += SubAssign // -= MulAssign // *= DivAssign // /= ModAssign // %= AndAssign // &= OrAssign // |= XorAssign // ^= ShlAssign // <<= ShrAssign // >>= AndNotAssign // &^= (Go-specific) )
func ParseAssignmentOperator ¶
func ParseAssignmentOperator(s string) AssignmentOperator
ParseAssignmentOperator converts a Java enum name to an AssignmentOperator.
func (AssignmentOperator) String ¶
func (op AssignmentOperator) String() string
String returns the Java enum name for this AssignmentOperator.
type Binary ¶
type Binary struct {
ID uuid.UUID
Prefix Space
Markers Markers
Left Expression
Operator LeftPadded[BinaryOperator]
Right Expression
Type JavaType // the result type (nullable)
}
Binary represents a binary expression like `a + b`.
func (*Binary) GetMarkers ¶
func (*Binary) WithLeft ¶
func (n *Binary) WithLeft(left Expression) *Binary
func (*Binary) WithMarkers ¶
func (*Binary) WithPrefix ¶
func (*Binary) WithRight ¶
func (n *Binary) WithRight(right Expression) *Binary
type BinaryOperator ¶
type BinaryOperator int
BinaryOperator represents the operator in a binary expression.
const ( Add BinaryOperator = iota + 1 Subtract Multiply Divide Modulo And Or BitwiseAnd BitwiseOr BitwiseXor LeftShift RightShift Equal NotEqual LessThan LessThanOrEqual GreaterThan GreaterThanOrEqual LogicalAnd LogicalOr AndNot // Go-specific: &^ )
func ParseBinaryOperator ¶
func ParseBinaryOperator(s string) BinaryOperator
ParseBinaryOperator converts a Java enum name to a BinaryOperator.
func (BinaryOperator) String ¶
func (op BinaryOperator) String() string
String returns the Java enum name for this BinaryOperator.
type Block ¶
type Block struct {
ID uuid.UUID
Prefix Space
Markers Markers
Statements []RightPadded[Statement]
End Space // whitespace before the closing brace
}
Block represents a brace-delimited block of statements.
func (*Block) GetMarkers ¶
func (*Block) WithMarkers ¶
func (*Block) WithPrefix ¶
func (*Block) WithStatements ¶
func (n *Block) WithStatements(statements []RightPadded[Statement]) *Block
type Break ¶
type Break struct {
ID uuid.UUID
Prefix Space
Markers Markers
Label *Identifier // nil if no label
}
Break represents a break statement with optional label.
func (*Break) GetMarkers ¶
func (*Break) WithMarkers ¶
func (*Break) WithPrefix ¶
type Case ¶
type Case struct {
ID uuid.UUID
Prefix Space
Markers Markers
Expressions Container[Expression] // empty for default case
Body []RightPadded[Statement] // statements after the colon
}
Case represents a case or default clause in a switch statement.
func (*Case) GetMarkers ¶
func (*Case) WithMarkers ¶
func (*Case) WithPrefix ¶
type ChanDirMarker ¶
ChanDirMarker stores whitespace around the direction operator in a channel type. For send channels (`chan <- T`), Before holds the space before `<-`. For recv channels (`<- chan T`), Before holds the space before `chan`.
func (ChanDirMarker) ID ¶
func (c ChanDirMarker) ID() uuid.UUID
type Channel ¶
Channel represents a channel type expression: `chan T`, `chan<- T`, `<-chan T`.
func (*Channel) GetMarkers ¶
func (*Channel) WithMarkers ¶
func (*Channel) WithPrefix ¶
type CommClause ¶
type CommClause struct {
ID uuid.UUID
Prefix Space
Markers Markers
Comm Statement // nil for default; the comm operation
Colon Space // space before `:`
Body []RightPadded[Statement] // statements after the colon
}
CommClause represents a communication clause in a select statement. `case <-ch:` or `case ch <- val:` or `case v := <-ch:` or `default:`.
func (*CommClause) GetID ¶
func (n *CommClause) GetID() uuid.UUID
func (*CommClause) GetMarkers ¶
func (n *CommClause) GetMarkers() Markers
func (*CommClause) GetPrefix ¶
func (n *CommClause) GetPrefix() Space
func (*CommClause) WithMarkers ¶
func (n *CommClause) WithMarkers(markers Markers) *CommClause
func (*CommClause) WithPrefix ¶
func (n *CommClause) WithPrefix(prefix Space) *CommClause
type Comment ¶
type Comment struct {
Kind CommentKind
Text string
Suffix string // whitespace after the comment, before the next token
Multiline bool
Markers Markers
}
Comment represents a comment in source code.
type CompilationUnit ¶
type CompilationUnit struct {
ID uuid.UUID
Prefix Space
Markers Markers
SourcePath string
PackageDecl *RightPadded[*Identifier] // `package main`
Imports *Container[*Import] // nil if no imports
Statements []RightPadded[Statement] // top-level declarations
EOF Space
}
CompilationUnit represents a Go source file.
func (*CompilationUnit) GetID ¶
func (n *CompilationUnit) GetID() uuid.UUID
func (*CompilationUnit) GetMarkers ¶
func (n *CompilationUnit) GetMarkers() Markers
func (*CompilationUnit) GetPrefix ¶
func (n *CompilationUnit) GetPrefix() Space
func (*CompilationUnit) WithEOF ¶
func (n *CompilationUnit) WithEOF(eof Space) *CompilationUnit
func (*CompilationUnit) WithImports ¶
func (n *CompilationUnit) WithImports(imports *Container[*Import]) *CompilationUnit
func (*CompilationUnit) WithMarkers ¶
func (n *CompilationUnit) WithMarkers(markers Markers) *CompilationUnit
func (*CompilationUnit) WithPackageDecl ¶
func (n *CompilationUnit) WithPackageDecl(pkg *RightPadded[*Identifier]) *CompilationUnit
func (*CompilationUnit) WithPrefix ¶
func (n *CompilationUnit) WithPrefix(prefix Space) *CompilationUnit
func (*CompilationUnit) WithStatements ¶
func (n *CompilationUnit) WithStatements(statements []RightPadded[Statement]) *CompilationUnit
type Composite ¶
type Composite struct {
ID uuid.UUID
Prefix Space
Markers Markers
TypeExpr Expression // nil for untyped composite literals
Elements Container[Expression] // Before = space before `{`, elements, last After = space before `}`
}
Composite represents a composite literal: `Type{elem1, elem2}`.
func (*Composite) GetMarkers ¶
func (*Composite) WithMarkers ¶
func (*Composite) WithPrefix ¶
type Container ¶
type Container[T any] struct { Before Space Elements []RightPadded[T] Markers Markers }
Container wraps a list of elements with surrounding whitespace, representing constructs like parenthesized argument lists or bracketed type parameters.
type Continue ¶
type Continue struct {
ID uuid.UUID
Prefix Space
Markers Markers
Label *Identifier // nil if no label
}
Continue represents a continue statement with optional label.
func (*Continue) GetMarkers ¶
func (*Continue) WithMarkers ¶
func (*Continue) WithPrefix ¶
type ControlParentheses ¶
type ControlParentheses struct {
ID uuid.UUID
Prefix Space
Markers Markers
Tree RightPadded[Expression] // Element = inner, After = space before `)`
}
ControlParentheses wraps an expression in parentheses for control flow.
func (*ControlParentheses) GetID ¶
func (n *ControlParentheses) GetID() uuid.UUID
func (*ControlParentheses) GetMarkers ¶
func (n *ControlParentheses) GetMarkers() Markers
func (*ControlParentheses) GetPrefix ¶
func (n *ControlParentheses) GetPrefix() Space
func (*ControlParentheses) WithID ¶ added in v0.0.3
func (n *ControlParentheses) WithID(id uuid.UUID) J
func (*ControlParentheses) WithMarkers ¶
func (n *ControlParentheses) WithMarkers(markers Markers) *ControlParentheses
func (*ControlParentheses) WithPrefix ¶
func (n *ControlParentheses) WithPrefix(prefix Space) *ControlParentheses
type Defer ¶
type Defer struct {
ID uuid.UUID
Prefix Space
Markers Markers
Expr Expression
}
Defer represents a `defer expr` statement.
func (*Defer) GetMarkers ¶
func (*Defer) WithMarkers ¶
func (*Defer) WithPrefix ¶
type Else ¶
Else represents an else clause of an if statement. This matches Java's J.If.Else for RPC wire format compatibility.
func (*Else) GetMarkers ¶
func (*Else) WithMarkers ¶
func (*Else) WithPrefix ¶
type Empty ¶
Empty represents an empty statement or expression placeholder.
func (*Empty) GetMarkers ¶
func (*Empty) WithPrefix ¶
type Expression ¶
type Expression interface {
J
// contains filtered or unexported methods
}
Expression is a J node that evaluates to a value.
type Fallthrough ¶
Fallthrough represents a `fallthrough` statement in a switch case.
func (*Fallthrough) GetID ¶
func (n *Fallthrough) GetID() uuid.UUID
func (*Fallthrough) GetMarkers ¶
func (n *Fallthrough) GetMarkers() Markers
func (*Fallthrough) GetPrefix ¶
func (n *Fallthrough) GetPrefix() Space
func (*Fallthrough) WithMarkers ¶
func (n *Fallthrough) WithMarkers(markers Markers) *Fallthrough
func (*Fallthrough) WithPrefix ¶
func (n *Fallthrough) WithPrefix(prefix Space) *Fallthrough
type FieldAccess ¶
type FieldAccess struct {
ID uuid.UUID
Prefix Space
Markers Markers
Target Expression
Name LeftPadded[*Identifier]
Type JavaType // the result type (nullable)
}
FieldAccess represents a field or method access like `obj.Field`.
func (*FieldAccess) GetID ¶
func (n *FieldAccess) GetID() uuid.UUID
func (*FieldAccess) GetMarkers ¶
func (n *FieldAccess) GetMarkers() Markers
func (*FieldAccess) GetPrefix ¶
func (n *FieldAccess) GetPrefix() Space
func (*FieldAccess) WithMarkers ¶
func (n *FieldAccess) WithMarkers(markers Markers) *FieldAccess
func (*FieldAccess) WithPrefix ¶
func (n *FieldAccess) WithPrefix(prefix Space) *FieldAccess
func (*FieldAccess) WithTarget ¶
func (n *FieldAccess) WithTarget(target Expression) *FieldAccess
type ForControl ¶
type ForControl struct {
ID uuid.UUID
Prefix Space
Markers Markers
Init *RightPadded[Statement] // nil for condition-only or infinite loops
Condition *RightPadded[Expression] // nil for infinite loops
Update *RightPadded[Statement] // nil when no update clause
}
ForControl holds the init, condition, and update of a for loop. When Init is non-nil, this is a 3-clause loop with semicolons; Init.After and Condition.After capture whitespace around semicolons. When Init is nil and Condition is non-nil, it's a condition-only loop (no semicolons). When both are nil, it's an infinite loop.
func (*ForControl) GetID ¶
func (n *ForControl) GetID() uuid.UUID
func (*ForControl) GetMarkers ¶
func (n *ForControl) GetMarkers() Markers
func (*ForControl) GetPrefix ¶
func (n *ForControl) GetPrefix() Space
func (*ForControl) WithMarkers ¶
func (n *ForControl) WithMarkers(markers Markers) *ForControl
func (*ForControl) WithPrefix ¶
func (n *ForControl) WithPrefix(prefix Space) *ForControl
type ForEachControl ¶
type ForEachControl struct {
ID uuid.UUID
Prefix Space
Markers Markers
Key *RightPadded[Expression] // nil for `for range expr`; After = space after key (including comma)
Value *RightPadded[Expression] // nil when no value; After = space before operator
Operator LeftPadded[AssignOp] // `:=` or `=`; Before = space before operator. Unused when Key is nil
Iterable Expression // expression after "range" keyword
}
ForEachControl holds the variable and iterable of a for-range loop. The "range" keyword is implicit (always present).
Structure: `for` [key] [`,` value] [`:=`|`=`] `range` iterable
- Key and Value may be nil (e.g., `for range expr {}`)
- When Key is non-nil, Operator contains `:=` or `=`
func (*ForEachControl) GetID ¶
func (n *ForEachControl) GetID() uuid.UUID
func (*ForEachControl) GetMarkers ¶
func (n *ForEachControl) GetMarkers() Markers
func (*ForEachControl) GetPrefix ¶
func (n *ForEachControl) GetPrefix() Space
func (*ForEachControl) WithMarkers ¶
func (n *ForEachControl) WithMarkers(markers Markers) *ForEachControl
func (*ForEachControl) WithPrefix ¶
func (n *ForEachControl) WithPrefix(prefix Space) *ForEachControl
type ForEachLoop ¶
type ForEachLoop struct {
ID uuid.UUID
Prefix Space
Markers Markers
Control ForEachControl
Body *Block
}
ForEachLoop represents a for-range loop: `for k, v := range expr { body }`
func (*ForEachLoop) GetID ¶
func (n *ForEachLoop) GetID() uuid.UUID
func (*ForEachLoop) GetMarkers ¶
func (n *ForEachLoop) GetMarkers() Markers
func (*ForEachLoop) GetPrefix ¶
func (n *ForEachLoop) GetPrefix() Space
func (*ForEachLoop) WithBody ¶
func (n *ForEachLoop) WithBody(body *Block) *ForEachLoop
func (*ForEachLoop) WithMarkers ¶
func (n *ForEachLoop) WithMarkers(markers Markers) *ForEachLoop
func (*ForEachLoop) WithPrefix ¶
func (n *ForEachLoop) WithPrefix(prefix Space) *ForEachLoop
type ForLoop ¶
ForLoop represents a classic for loop: `for init; cond; update { body }` Also covers condition-only `for cond {}` and infinite `for {}`.
func (*ForLoop) GetMarkers ¶
func (*ForLoop) WithMarkers ¶
func (*ForLoop) WithPrefix ¶
type FullyQualified ¶
FullyQualified is a JavaType with a fully qualified name.
type FuncType ¶
type FuncType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Parameters Container[Statement]
ReturnType Expression // nil if no return type
}
FuncType represents a function type expression: `func(int) string`.
func (*FuncType) GetMarkers ¶
func (*FuncType) WithMarkers ¶
func (*FuncType) WithPrefix ¶
type GenericMarker ¶
type GenericMarker struct {
Ident uuid.UUID
JavaType string // Original Java class name for round-trip fidelity
Data map[string]any
}
GenericMarker is a marker type for Java-side markers that the Go side doesn't have a native type for (e.g., RecipesThatMadeChanges, SearchResult). It preserves the marker data as opaque fields during RPC round-trips.
func (GenericMarker) ID ¶
func (m GenericMarker) ID() uuid.UUID
type GoProject ¶
GoProject identifies the Go project (logical grouping of go.mod + .go files) a source belongs to. Mirrors org.openrewrite.golang.marker.GoProject on the Java side.
func NewGoProject ¶
NewGoProject creates a GoProject marker with a new UUID.
type GoReplace ¶
GoReplace is one entry in the go.mod `replace` list. OldVersion is empty if the replace targets all versions of OldPath. NewVersion is empty if NewPath is a local filesystem path.
type GoRequire ¶
type GoRequire struct {
ModulePath string
Version string
Indirect bool // true if marked `// indirect`
}
GoRequire is one entry in the go.mod `require` list.
type GoResolutionResult ¶
type GoResolutionResult struct {
Ident uuid.UUID
ModulePath string
GoVersion string // empty if no `go` directive
Toolchain string // empty if no `toolchain` directive
Path string // path to the go.mod file
Requires []GoRequire
Replaces []GoReplace
Excludes []GoExclude
Retracts []GoRetract
ResolvedDependencies []GoResolvedDependency
}
GoResolutionResult mirrors org.openrewrite.golang.marker.GoResolutionResult on the Java side: the metadata parsed from a Go module's go.mod file. Attached as a Marker to a source representing a go.mod (in tests, to the test SourceSpec; at runtime, to whatever tree the Go parser produces for go.mod content).
func NewGoResolutionResult ¶
func NewGoResolutionResult(modulePath, goVersion, toolchain, path string) GoResolutionResult
NewGoResolutionResult creates a GoResolutionResult marker with a fresh UUID.
func (GoResolutionResult) FindRequire ¶
func (m GoResolutionResult) FindRequire(modulePath string) *GoRequire
FindRequire returns the require entry for a module, or nil.
func (GoResolutionResult) FindResolved ¶
func (m GoResolutionResult) FindResolved(modulePath string) *GoResolvedDependency
FindResolved returns the resolved dependency for a module, or nil.
func (GoResolutionResult) ID ¶
func (m GoResolutionResult) ID() uuid.UUID
type GoResolvedDependency ¶
type GoResolvedDependency struct {
ModulePath string
Version string
ModuleHash string // h1:... — empty if only the go.mod hash is recorded
GoModHash string
}
GoResolvedDependency is one entry from go.sum.
type GoRetract ¶
GoRetract is one entry in the go.mod `retract` list. VersionRange is the raw expression as written, e.g. "v1.0.0" or "[v1.0.0, v1.1.0]".
type GoStmt ¶
type GoStmt struct {
ID uuid.UUID
Prefix Space
Markers Markers
Expr Expression
}
Go represents a `go expr` statement (goroutine launch).
func (*GoStmt) GetMarkers ¶
func (*GoStmt) WithMarkers ¶
func (*GoStmt) WithPrefix ¶
type Goto ¶
type Goto struct {
ID uuid.UUID
Prefix Space
Markers Markers
Label *Identifier
}
Goto represents a `goto label` statement.
func (*Goto) GetMarkers ¶
func (*Goto) WithMarkers ¶
func (*Goto) WithPrefix ¶
type GroupedImport ¶
GroupedImport is a marker on an import Container indicating that imports are parenthesized: import ( ... ). It stores the whitespace between 'import' and '('.
func (GroupedImport) ID ¶
func (g GroupedImport) ID() uuid.UUID
type GroupedSpec ¶
GroupedSpec is a marker on TypeDecl (or VariableDeclarations) inside a grouped declaration, indicating the keyword (type/var/const) should not be printed.
func (GroupedSpec) ID ¶
func (g GroupedSpec) ID() uuid.UUID
type Identifier ¶
type Identifier struct {
ID uuid.UUID
Prefix Space
Markers Markers
Annotations []Tree // Java annotations on this identifier (empty in Go, received from Java)
Name string
Type JavaType // the type of this identifier (nullable)
FieldType *JavaTypeVariable // the variable type when this identifier refers to a field (nullable)
}
Identifier represents a name reference in source code.
func (*Identifier) GetID ¶
func (n *Identifier) GetID() uuid.UUID
func (*Identifier) GetMarkers ¶
func (n *Identifier) GetMarkers() Markers
func (*Identifier) GetPrefix ¶
func (n *Identifier) GetPrefix() Space
func (*Identifier) WithFieldType ¶
func (n *Identifier) WithFieldType(ft *JavaTypeVariable) *Identifier
func (*Identifier) WithMarkers ¶
func (n *Identifier) WithMarkers(markers Markers) *Identifier
func (*Identifier) WithName ¶
func (n *Identifier) WithName(name string) *Identifier
func (*Identifier) WithPrefix ¶
func (n *Identifier) WithPrefix(prefix Space) *Identifier
func (*Identifier) WithType ¶
func (n *Identifier) WithType(t JavaType) *Identifier
type If ¶
type If struct {
ID uuid.UUID
Prefix Space
Markers Markers
Init *RightPadded[Statement] // nil if no init; After = space before `;`
Condition Expression
ConditionCP *ControlParentheses // cached ControlParentheses from RPC round-trip
Then *Block
ElsePart *RightPadded[J] // nil if no else clause
}
If represents an if statement. In Go, if can have an init statement: `if init; cond { }`.
func (*If) GetMarkers ¶
func (*If) WithCondition ¶
func (n *If) WithCondition(condition Expression) *If
func (*If) WithMarkers ¶
func (*If) WithPrefix ¶
type Import ¶
type Import struct {
ID uuid.UUID
Prefix Space
Markers Markers
Alias *LeftPadded[*Identifier] // nil if no alias
Qualid Expression // typically *Literal for Go imports
}
Import represents a single import declaration.
func (*Import) GetMarkers ¶
func (*Import) WithMarkers ¶
func (*Import) WithPrefix ¶
type ImportBlock ¶
type ImportBlock struct {
Ident uuid.UUID
ClosePrevious bool // true if the previous block was grouped (need to print ")")
Before Space // space before the "import" keyword
Grouped bool // true if this block uses import (...)
GroupedBefore Space // space between "import" and "(" (only if Grouped)
}
ImportBlock is a marker on the first Import of a subsequent import block (2nd, 3rd, etc.) in files with multiple import declarations. It carries the information needed to print the block boundary.
func (ImportBlock) ID ¶
func (b ImportBlock) ID() uuid.UUID
type IndexList ¶
type IndexList struct {
ID uuid.UUID
Prefix Space
Markers Markers
Target Expression
Indices Container[Expression] // Before = space before `[`, Elements = type args, last After = space before `]`
}
IndexList represents a multi-index expression like `Map[int, string]` (generic instantiation with multiple type parameters). Single-index uses ArrayAccess; this is for 2+ indices.
func (*IndexList) GetMarkers ¶
func (*IndexList) WithMarkers ¶
func (*IndexList) WithPrefix ¶
type InterfaceMethod ¶
InterfaceMethod is a marker on MethodDeclaration indicating it's an interface method signature (no `func` keyword in the source).
func (InterfaceMethod) ID ¶
func (i InterfaceMethod) ID() uuid.UUID
type InterfaceType ¶
type InterfaceType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Body *Block // contains MethodDeclaration (no body) or type refs for embedded interfaces
}
InterfaceType represents an interface type expression: `interface { methods }`.
func (*InterfaceType) GetID ¶
func (n *InterfaceType) GetID() uuid.UUID
func (*InterfaceType) GetMarkers ¶
func (n *InterfaceType) GetMarkers() Markers
func (*InterfaceType) GetPrefix ¶
func (n *InterfaceType) GetPrefix() Space
func (*InterfaceType) WithMarkers ¶
func (n *InterfaceType) WithMarkers(markers Markers) *InterfaceType
func (*InterfaceType) WithPrefix ¶
func (n *InterfaceType) WithPrefix(prefix Space) *InterfaceType
type J ¶
type J interface {
Tree
GetID() uuid.UUID
WithID(uuid.UUID) J
GetPrefix() Space
GetMarkers() Markers
// contains filtered or unexported methods
}
J is the interface for all Java-like AST nodes that carry a prefix space. Mirrors org.openrewrite.java.tree.J — `getId`, `getPrefix`, `getMarkers` are polymorphic accessors so RPC senders, receivers, and other framework code can read the cross-cutting fields without per-type switches.
Concrete impls live in j_methods.go (keep in sync with the J types in j.go and go.go).
Mutation: the J interface exposes only the common ID wither. For prefix/markers, use the typed `WithPrefix(Space) *T` / `WithMarkers(Markers) *T` per-type methods — they return a *new* instance so the visitor framework's change-detection (pointer identity) works correctly. Framework code that needs to invoke those polymorphically (e.g. the RPC receiver's PreVisit) goes through reflection — see the `withPrefixViaReflection` helper in pkg/rpc.
In-place mutation of Prefix / Markers / ID is never safe because it would silently bypass RecipeScheduler's "did this recipe change the tree?" check.
type JavaType ¶
type JavaType interface {
// contains filtered or unexported methods
}
JavaType is the interface for all Java type representations used for type attribution.
type JavaTypeAnnotation ¶
type JavaTypeAnnotation struct {
Type FullyQualified
Values []JavaTypeAnnotationElementValue
}
JavaTypeAnnotation represents an annotation type reference.
type JavaTypeAnnotationArrayElementValue ¶
type JavaTypeAnnotationArrayElementValue struct {
Element JavaType
ConstantValues []any
ReferenceValues []JavaType
}
JavaTypeAnnotationArrayElementValue is an array of annotation element values.
func (*JavaTypeAnnotationArrayElementValue) GetElement ¶
func (a *JavaTypeAnnotationArrayElementValue) GetElement() JavaType
type JavaTypeAnnotationElementValue ¶
type JavaTypeAnnotationElementValue interface {
GetElement() JavaType
// contains filtered or unexported methods
}
JavaTypeAnnotationElementValue is the interface for annotation element values. One of *JavaTypeAnnotationSingleElementValue or *JavaTypeAnnotationArrayElementValue.
type JavaTypeAnnotationSingleElementValue ¶
type JavaTypeAnnotationSingleElementValue struct {
Element JavaType
ConstantValue any
ReferenceValue JavaType
}
JavaTypeAnnotationSingleElementValue is a single annotation element value (one constant or one reference). Java parser puts class literals and enum constants in ReferenceValue; only String/Number/Boolean/Character live in ConstantValue.
func (*JavaTypeAnnotationSingleElementValue) GetElement ¶
func (s *JavaTypeAnnotationSingleElementValue) GetElement() JavaType
type JavaTypeArray ¶
type JavaTypeArray struct {
ElemType JavaType
Annotations []FullyQualified
}
JavaTypeArray represents an array type.
type JavaTypeClass ¶
type JavaTypeClass struct {
FlagsBitMap int64
Kind string
FullyQualifiedName string
TypeParameters []JavaType
Supertype FullyQualified
OwningClass FullyQualified
Annotations []FullyQualified
Interfaces []FullyQualified
Members []*JavaTypeVariable
Methods []*JavaTypeMethod
}
JavaTypeClass represents a class, interface, enum, or annotation type.
func (*JavaTypeClass) GetFullyQualifiedName ¶
func (c *JavaTypeClass) GetFullyQualifiedName() string
type JavaTypeGenericTypeVariable ¶
JavaTypeGenericTypeVariable represents a generic type variable like T extends Comparable.
type JavaTypeIntersection ¶
type JavaTypeIntersection struct {
Bounds []JavaType
}
JavaTypeIntersection represents an intersection type (e.g., Serializable & Comparable).
type JavaTypeMethod ¶
type JavaTypeMethod struct {
DeclaringType FullyQualified
Name string
FlagsBitMap int64
ReturnType JavaType
ParameterNames []string
ParameterTypes []JavaType
ThrownExceptions []JavaType
Annotations []FullyQualified
DefaultValue []string
DeclaredFormalTypeNames []string
}
JavaTypeMethod represents a method type signature.
type JavaTypeMultiCatch ¶
type JavaTypeMultiCatch struct {
ThrowableTypes []JavaType
}
JavaTypeMultiCatch represents a multi-catch type (e.g., IOException | SQLException).
type JavaTypeParameterized ¶
type JavaTypeParameterized struct {
Type FullyQualified
TypeParameters []JavaType
}
JavaTypeParameterized represents a parameterized type like List<String>.
func (*JavaTypeParameterized) GetFullyQualifiedName ¶
func (p *JavaTypeParameterized) GetFullyQualifiedName() string
type JavaTypePrimitive ¶
type JavaTypePrimitive struct {
Keyword string
}
JavaTypePrimitive represents a primitive type like int, boolean, etc.
type JavaTypeShallowClass ¶ added in v0.0.3
type JavaTypeShallowClass struct {
JavaTypeClass
}
JavaTypeShallowClass mirrors Java's JavaType.ShallowClass — a Class instance that carries minimal metadata (kind, FQN, owning class) and otherwise behaves identically to JavaTypeClass. The wire format preserves the distinction; on the Go side the embedded JavaTypeClass supplies all fields and accessors.
type JavaTypeUnknown ¶
type JavaTypeUnknown struct{}
JavaTypeUnknown represents an unknown or unresolved type.
type JavaTypeVariable ¶
type JavaTypeVariable struct {
Name string
Owner JavaType
Type JavaType
Annotations []FullyQualified
}
JavaTypeVariable represents a variable type.
type KeyValue ¶
type KeyValue struct {
ID uuid.UUID
Prefix Space
Markers Markers
Key Expression
Value LeftPadded[Expression] // Before = space before `:`
}
KeyValue represents a `key: value` pair in composite literals.
func (*KeyValue) GetMarkers ¶
func (*KeyValue) WithMarkers ¶
func (*KeyValue) WithPrefix ¶
type Label ¶
type Label struct {
ID uuid.UUID
Prefix Space
Markers Markers
Name RightPadded[*Identifier] // After = space before ':'
Statement Statement
}
Label represents a labeled statement: `label: stmt`.
func (*Label) GetMarkers ¶
func (*Label) WithMarkers ¶
func (*Label) WithPrefix ¶
type LeftPadded ¶
LeftPadded wraps an element with preceding whitespace/comments. Used for operators and delimiters where whitespace appears before the element (e.g., the space before an operator in a binary expression).
type Literal ¶
type Literal struct {
ID uuid.UUID
Prefix Space
Markers Markers
Kind LiteralKind
Value any
Source string // the original source text of the literal
Type JavaType // the type of this literal (nullable)
}
Literal represents a literal value (string, number, boolean, etc.).
func (*Literal) GetMarkers ¶
func (*Literal) WithMarkers ¶
func (*Literal) WithPrefix ¶
func (*Literal) WithSource ¶
type LiteralKind ¶
type LiteralKind int
const ( BoolLiteral LiteralKind = iota IntLiteral FloatLiteral StringLiteral CharLiteral NilLiteral )
type MapType ¶
type MapType struct {
ID uuid.UUID
Prefix Space
Markers Markers
OpenBracket Space // space before `[`
Key RightPadded[Expression] // After = space before `]`
Value Expression
}
MapType represents a map type expression: `map[K]V`.
func (*MapType) GetMarkers ¶
func (*MapType) WithMarkers ¶
func (*MapType) WithPrefix ¶
type Markers ¶
Markers holds a collection of Marker instances attached to a tree node.
func FoundSearchResult ¶
FoundSearchResult attaches a SearchResult marker to the given Markers.
func MarkupError ¶
MarkupError attaches an error-level Markup marker to the given Markers.
func MarkupInfo ¶
MarkupInfo attaches an info-level Markup marker to the given Markers.
func MarkupWarn ¶
MarkupWarn attaches a warning-level Markup marker to the given Markers.
func MarkupWarnDetail ¶
MarkupWarnDetail attaches a warning-level Markup marker with detail to the given Markers.
type Markup ¶
type Markup struct {
Ident uuid.UUID
Level MarkupLevel
Message string
Detail string
}
Markup is a marker for attaching diagnostic messages to LST nodes. It is rendered as a comment in printed output (e.g., /*~~(message: detail)~~>*/).
func NewMarkup ¶
func NewMarkup(level MarkupLevel, message, detail string) Markup
NewMarkup creates a Markup marker with the given level and message.
type MarkupLevel ¶
type MarkupLevel int
MarkupLevel indicates the severity of a Markup marker.
const ( MarkupDebugLevel MarkupLevel = iota MarkupInfoLevel MarkupWarnLevel MarkupErrorLevel )
type MethodDeclaration ¶
type MethodDeclaration struct {
ID uuid.UUID
Prefix Space
Markers Markers
LeadingAnnotations []*Annotation // `//go:noinline` / `//go:nosplit` etc. on funcs
Receiver *Container[Statement] // nil for free functions; `(r *Type)` receiver
Name *Identifier
Parameters Container[Statement] // parameter list in parentheses
ReturnType Expression // nil for void functions; single type or *TypeList for multiple
Body *Block // nil for forward declarations
MethodType *JavaTypeMethod // the method type signature (nullable)
}
MethodDeclaration represents a function or method declaration.
func (*MethodDeclaration) GetID ¶
func (n *MethodDeclaration) GetID() uuid.UUID
func (*MethodDeclaration) GetMarkers ¶
func (n *MethodDeclaration) GetMarkers() Markers
func (*MethodDeclaration) GetPrefix ¶
func (n *MethodDeclaration) GetPrefix() Space
func (*MethodDeclaration) WithBody ¶
func (n *MethodDeclaration) WithBody(body *Block) *MethodDeclaration
func (*MethodDeclaration) WithID ¶ added in v0.0.3
func (n *MethodDeclaration) WithID(id uuid.UUID) J
func (*MethodDeclaration) WithLeadingAnnotations ¶
func (n *MethodDeclaration) WithLeadingAnnotations(anns []*Annotation) *MethodDeclaration
func (*MethodDeclaration) WithMarkers ¶
func (n *MethodDeclaration) WithMarkers(markers Markers) *MethodDeclaration
func (*MethodDeclaration) WithName ¶
func (n *MethodDeclaration) WithName(name *Identifier) *MethodDeclaration
func (*MethodDeclaration) WithPrefix ¶
func (n *MethodDeclaration) WithPrefix(prefix Space) *MethodDeclaration
type MethodInvocation ¶
type MethodInvocation struct {
ID uuid.UUID
Prefix Space
Markers Markers
Select *RightPadded[Expression] // nil for free functions
Name *Identifier
Arguments Container[Expression]
MethodType *JavaTypeMethod // the method type being invoked (nullable)
}
MethodInvocation represents a function or method call like `f(args)`.
func (*MethodInvocation) GetID ¶
func (n *MethodInvocation) GetID() uuid.UUID
func (*MethodInvocation) GetMarkers ¶
func (n *MethodInvocation) GetMarkers() Markers
func (*MethodInvocation) GetPrefix ¶
func (n *MethodInvocation) GetPrefix() Space
func (*MethodInvocation) WithMarkers ¶
func (n *MethodInvocation) WithMarkers(markers Markers) *MethodInvocation
func (*MethodInvocation) WithName ¶
func (n *MethodInvocation) WithName(name *Identifier) *MethodInvocation
func (*MethodInvocation) WithPrefix ¶
func (n *MethodInvocation) WithPrefix(prefix Space) *MethodInvocation
type MultiAssignment ¶
type MultiAssignment struct {
ID uuid.UUID
Prefix Space
Markers Markers
Variables []RightPadded[Expression] // LHS; After = space before comma
Operator LeftPadded[Space] // Before = space before `=` or `:=`
Values []RightPadded[Expression] // RHS; After = space before comma
}
MultiAssignment represents a multi-value assignment: `x, y = 1, 2` or `x, y := f()`.
func (*MultiAssignment) GetID ¶
func (n *MultiAssignment) GetID() uuid.UUID
func (*MultiAssignment) GetMarkers ¶
func (n *MultiAssignment) GetMarkers() Markers
func (*MultiAssignment) GetPrefix ¶
func (n *MultiAssignment) GetPrefix() Space
func (*MultiAssignment) WithMarkers ¶
func (n *MultiAssignment) WithMarkers(markers Markers) *MultiAssignment
func (*MultiAssignment) WithPrefix ¶
func (n *MultiAssignment) WithPrefix(prefix Space) *MultiAssignment
type ParameterizedType ¶
type ParameterizedType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Clazz Expression // the base type being parameterized
TypeParameters *Container[Expression] // the type arguments (nullable)
Type JavaType // resolved type (nullable)
}
ParameterizedType represents a generic type instantiation like `List[string]`.
func (*ParameterizedType) GetID ¶
func (n *ParameterizedType) GetID() uuid.UUID
func (*ParameterizedType) GetMarkers ¶
func (n *ParameterizedType) GetMarkers() Markers
func (*ParameterizedType) GetPrefix ¶
func (n *ParameterizedType) GetPrefix() Space
func (*ParameterizedType) WithID ¶ added in v0.0.3
func (n *ParameterizedType) WithID(id uuid.UUID) J
func (*ParameterizedType) WithMarkers ¶
func (n *ParameterizedType) WithMarkers(markers Markers) *ParameterizedType
func (*ParameterizedType) WithPrefix ¶
func (n *ParameterizedType) WithPrefix(prefix Space) *ParameterizedType
type Parentheses ¶
type Parentheses struct {
ID uuid.UUID
Prefix Space
Markers Markers
Tree RightPadded[Expression] // Element = inner expr, After = space before `)`
Type JavaType // the result type (nullable)
}
Parentheses wraps an expression in parentheses: `(expr)`.
func (*Parentheses) GetID ¶
func (n *Parentheses) GetID() uuid.UUID
func (*Parentheses) GetMarkers ¶
func (n *Parentheses) GetMarkers() Markers
func (*Parentheses) GetPrefix ¶
func (n *Parentheses) GetPrefix() Space
func (*Parentheses) WithMarkers ¶
func (n *Parentheses) WithMarkers(markers Markers) *Parentheses
func (*Parentheses) WithPrefix ¶
func (n *Parentheses) WithPrefix(prefix Space) *Parentheses
type ParseError ¶
type ParseError struct {
Ident uuid.UUID
Markers Markers
SourcePath string
CharsetName string
CharsetBomMarked bool
Text string
}
ParseError represents a source file that failed to parse. Mirrors org.openrewrite.tree.ParseError on the Java side.
func NewParseError ¶
func NewParseError(sourcePath string, source string, err error) *ParseError
NewParseError creates a ParseError from a source path, source text, and error.
type ParseExceptionResult ¶
type ParseExceptionResult struct {
Ident uuid.UUID
ParserType string
ExceptionType string
Message string
TreeType *string // nullable
}
ParseExceptionResult is a marker that captures information about a parse failure. Mirrors org.openrewrite.ParseExceptionResult on the Java side.
func (ParseExceptionResult) ID ¶
func (p ParseExceptionResult) ID() uuid.UUID
type PointerType ¶
type PointerType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Elem Expression
}
PointerType represents a pointer type expression: `*T`.
func (*PointerType) GetID ¶
func (n *PointerType) GetID() uuid.UUID
func (*PointerType) GetMarkers ¶
func (n *PointerType) GetMarkers() Markers
func (*PointerType) GetPrefix ¶
func (n *PointerType) GetPrefix() Space
func (*PointerType) WithMarkers ¶
func (n *PointerType) WithMarkers(markers Markers) *PointerType
func (*PointerType) WithPrefix ¶
func (n *PointerType) WithPrefix(prefix Space) *PointerType
type Return ¶
type Return struct {
ID uuid.UUID
Prefix Space
Markers Markers
Expressions []RightPadded[Expression]
}
Return represents a return statement.
func (*Return) GetMarkers ¶
func (*Return) WithMarkers ¶
func (*Return) WithPrefix ¶
type RightPadded ¶
RightPadded wraps an element with trailing whitespace/comments. Used for list elements where whitespace appears after the element (e.g., before a comma or closing delimiter).
type SearchResult ¶
SearchResult is a marker indicating that a search recipe found a match. It is rendered as a comment in printed output (e.g., /*~~(description)~~>*/).
func NewSearchResult ¶
func NewSearchResult(description string) SearchResult
NewSearchResult creates a SearchResult marker with a new UUID.
func (SearchResult) ID ¶
func (s SearchResult) ID() uuid.UUID
type SearchResultMarker ¶
SearchResultMarker represents a SearchResult marker from Java. It implements RpcCodec on the Java side, sending 2 sub-fields (id, description).
func (SearchResultMarker) ID ¶
func (m SearchResultMarker) ID() uuid.UUID
type SelectStmt ¶
SelectStmt is a marker on Switch indicating it's a `select` statement instead of `switch`.
func (SelectStmt) ID ¶
func (s SelectStmt) ID() uuid.UUID
type Semicolon ¶
Semicolon marks a RightPadded element that is followed by an explicit `;` separator in the source — i.e. multiple statements on one line: `_ = 1; _ = 2`. Go inserts implicit semicolons at end-of-line so most files don't need this marker; it's only emitted when the source literally has a `;` between statements that the printer must reproduce.
Mirrors org.openrewrite.java.marker.Semicolon on the Java side.
func NewSemicolon ¶
func NewSemicolon() Semicolon
NewSemicolon creates a Semicolon marker with a fresh UUID.
type Send ¶
type Send struct {
ID uuid.UUID
Prefix Space
Markers Markers
Channel Expression
Arrow LeftPadded[Expression] // Before = space before `<-`
}
Send represents a channel send statement: `ch <- value`.
func (*Send) GetMarkers ¶
func (*Send) WithMarkers ¶
func (*Send) WithPrefix ¶
type ShortVarDecl ¶
ShortVarDecl is a marker on Assignment indicating `:=` instead of `=`.
func (ShortVarDecl) ID ¶
func (s ShortVarDecl) ID() uuid.UUID
type Slice ¶
type Slice struct {
ID uuid.UUID
Prefix Space
Markers Markers
Indexed Expression
OpenBracket Space // space before `[`
Low RightPadded[Expression] // After = space before first `:`
High RightPadded[Expression] // After = space before second `:` (empty if 2-index)
Max Expression // nil for 2-index slices
CloseBracket Space // space before `]`
}
Slice represents a slice expression: `a[low:high]` or `a[low:high:max]`.
func (*Slice) GetMarkers ¶
func (*Slice) WithMarkers ¶
func (*Slice) WithPrefix ¶
type SourceFile ¶
type SourceFile interface {
J
// contains filtered or unexported methods
}
SourceFile is a J node representing an entire source file.
type Space ¶
Space represents whitespace and comments that appear before a syntax element. This is the fundamental unit of formatting preservation in OpenRewrite.
func ParseSpace ¶
ParseSpace parses raw text (between two token positions) into a Space, extracting any line comments (//) and block comments (/* */).
The model follows Java OpenRewrite's convention:
- Space.Whitespace = whitespace BEFORE the first comment
- Comment.Suffix = whitespace AFTER each comment
The printer emits: Whitespace + (Comment.Text + Comment.Suffix)* to reconstruct the original text.
type Statement ¶
type Statement interface {
J
// contains filtered or unexported methods
}
Statement is a J node that can appear at statement level.
type StatementExpression ¶
StatementExpression wraps a Statement so it can appear in expression contexts. Used for Go function literals which are parsed as MethodDeclaration (a Statement) but can appear in return statements, assignments, and call arguments.
func (*StatementExpression) GetID ¶
func (n *StatementExpression) GetID() uuid.UUID
func (*StatementExpression) GetMarkers ¶
func (n *StatementExpression) GetMarkers() Markers
func (*StatementExpression) GetPrefix ¶
func (n *StatementExpression) GetPrefix() Space
func (*StatementExpression) WithID ¶ added in v0.0.3
func (n *StatementExpression) WithID(id uuid.UUID) J
func (*StatementExpression) WithMarkers ¶
func (n *StatementExpression) WithMarkers(markers Markers) *StatementExpression
func (*StatementExpression) WithPrefix ¶
func (n *StatementExpression) WithPrefix(prefix Space) *StatementExpression
type StructTag ¶
StructTag is a marker on VariableDeclarations in a struct body, storing the struct field tag.
type StructType ¶
type StructType struct {
ID uuid.UUID
Prefix Space
Markers Markers
Body *Block // contains VariableDeclarations for fields
}
StructType represents a struct type expression: `struct { fields }`.
func (*StructType) GetID ¶
func (n *StructType) GetID() uuid.UUID
func (*StructType) GetMarkers ¶
func (n *StructType) GetMarkers() Markers
func (*StructType) GetPrefix ¶
func (n *StructType) GetPrefix() Space
func (*StructType) WithMarkers ¶
func (n *StructType) WithMarkers(markers Markers) *StructType
func (*StructType) WithPrefix ¶
func (n *StructType) WithPrefix(prefix Space) *StructType
type Switch ¶
type Switch struct {
ID uuid.UUID
Prefix Space
Markers Markers
Init *RightPadded[Statement] // optional init statement; After = space after semicolon
Tag *RightPadded[Expression] // optional tag expression; After = space before {
Body *Block // contains Case statements
}
Switch represents a switch statement.
func (*Switch) GetMarkers ¶
func (*Switch) WithMarkers ¶
func (*Switch) WithPrefix ¶
type TrailingComma ¶
type TrailingComma struct {
Ident uuid.UUID
Before Space // space before ","
After Space // space after "," (before closing delimiter)
}
TrailingComma is a marker indicating a trailing comma is present in a list. The Before space is the space before the comma; After space is the space after the comma (before the closing delimiter).
func (TrailingComma) ID ¶
func (t TrailingComma) ID() uuid.UUID
type Tree ¶
type Tree interface {
// contains filtered or unexported methods
}
Tree is the root interface for all LST nodes.
type TypeCast ¶
type TypeCast struct {
ID uuid.UUID
Prefix Space
Markers Markers
Clazz *ControlParentheses // the type in parentheses
Expr Expression // the expression being cast/asserted
Type JavaType // the result type (nullable)
}
TypeCast represents a type assertion or type cast: `x.(T)` in Go.
func (*TypeCast) GetMarkers ¶
func (*TypeCast) WithMarkers ¶
func (*TypeCast) WithPrefix ¶
type TypeDecl ¶
type TypeDecl struct {
ID uuid.UUID
Prefix Space
Markers Markers
LeadingAnnotations []*Annotation // `//go:generate ...` etc.
Name *Identifier
Assign *LeftPadded[Space] // non-nil for `type Foo = Bar`; Before = space before `=`
Definition Expression // the type expression (nil for grouped)
Specs *Container[Statement] // non-nil for grouped `type ( ... )`; Before = space before `(`
}
TypeDecl represents a `type Name Type` declaration. Covers: `type Foo struct{...}`, `type Foo interface{...}`, `type Foo int`, `type Foo = Bar`. For grouped declarations `type ( ... )`, Specs is non-nil and Name/Definition are unused.
func (*TypeDecl) GetMarkers ¶
func (*TypeDecl) WithLeadingAnnotations ¶
func (n *TypeDecl) WithLeadingAnnotations(anns []*Annotation) *TypeDecl
func (*TypeDecl) WithMarkers ¶
func (*TypeDecl) WithPrefix ¶
type TypeList ¶
type TypeList struct {
ID uuid.UUID
Prefix Space
Markers Markers
Types Container[Statement] // Before = space before `(`, last After = space before `)`
}
TypeList represents a parenthesized list of return types: `(int, error)` or `(n int, err error)`. Used for multiple (or single parenthesized) return values in function signatures. Elements are VariableDeclarations, each with optional name and type.
func (*TypeList) GetMarkers ¶
func (*TypeList) WithMarkers ¶
func (*TypeList) WithPrefix ¶
type TypeSwitchGuard ¶
TypeSwitchGuard is a marker on Switch indicating it's a type switch with a type assertion guard like `switch x.(type)` or `switch v := x.(type)`.
func (TypeSwitchGuard) ID ¶
func (t TypeSwitchGuard) ID() uuid.UUID
type Unary ¶
type Unary struct {
ID uuid.UUID
Prefix Space
Markers Markers
Operator LeftPadded[UnaryOperator]
Operand Expression
Type JavaType // the result type (nullable)
}
Unary represents a unary expression like `-x` or `!y`.
func (*Unary) GetMarkers ¶
func (*Unary) WithMarkers ¶
func (*Unary) WithOperand ¶
func (n *Unary) WithOperand(operand Expression) *Unary
func (*Unary) WithPrefix ¶
type UnaryOperator ¶
type UnaryOperator int
const ( Negate UnaryOperator = iota + 1 // - Not // ! BitwiseNot // ^ Deref // * AddressOf // & Receive // <- (channel receive, Go-specific) Positive // + PostIncrement // ++ (postfix) PostDecrement // -- (postfix) Spread // ... (variadic prefix, param declaration) SpreadPostfix // ... (variadic postfix, call site) Tilde // ~ (approximate type constraint, Go-specific) )
func ParseUnaryOperator ¶
func ParseUnaryOperator(s string) UnaryOperator
ParseUnaryOperator converts a Java enum name to a UnaryOperator.
func (UnaryOperator) String ¶
func (op UnaryOperator) String() string
String returns the Java enum name for this UnaryOperator.
type VarKeyword ¶
VarKeyword is a marker on VariableDeclarations indicating a `var` keyword is present.
func (VarKeyword) ID ¶
func (v VarKeyword) ID() uuid.UUID
type VariableDeclarations ¶
type VariableDeclarations struct {
ID uuid.UUID
Prefix Space
Markers Markers
LeadingAnnotations []*Annotation // struct field tags (one per `key:"value"` pair) or `//go:` directives
TypeExpr Expression // the declared type (nil if inferred)
Varargs *Space // non-nil for variadic params (`...T`); holds prefix of `...`
Variables []RightPadded[*VariableDeclarator] // the declared variables
Specs *Container[Statement] // non-nil for grouped `var ( ... )`; Before = space before `(`
}
VariableDeclarations represents one or more variable declarations. For grouped declarations `var ( ... )` or `const ( ... )`, Specs is non-nil and Variables/TypeExpr are unused.
func (*VariableDeclarations) GetID ¶
func (n *VariableDeclarations) GetID() uuid.UUID
func (*VariableDeclarations) GetMarkers ¶
func (n *VariableDeclarations) GetMarkers() Markers
func (*VariableDeclarations) GetPrefix ¶
func (n *VariableDeclarations) GetPrefix() Space
func (*VariableDeclarations) WithID ¶ added in v0.0.3
func (n *VariableDeclarations) WithID(id uuid.UUID) J
func (*VariableDeclarations) WithLeadingAnnotations ¶
func (n *VariableDeclarations) WithLeadingAnnotations(anns []*Annotation) *VariableDeclarations
func (*VariableDeclarations) WithMarkers ¶
func (n *VariableDeclarations) WithMarkers(markers Markers) *VariableDeclarations
func (*VariableDeclarations) WithPrefix ¶
func (n *VariableDeclarations) WithPrefix(prefix Space) *VariableDeclarations
type VariableDeclarator ¶
type VariableDeclarator struct {
ID uuid.UUID
Prefix Space
Markers Markers
Name *Identifier
Initializer *LeftPadded[Expression] // nil if no initializer
}
VariableDeclarator represents a single variable with optional initializer.
func (*VariableDeclarator) GetID ¶
func (n *VariableDeclarator) GetID() uuid.UUID
func (*VariableDeclarator) GetMarkers ¶
func (n *VariableDeclarator) GetMarkers() Markers
func (*VariableDeclarator) GetPrefix ¶
func (n *VariableDeclarator) GetPrefix() Space
func (*VariableDeclarator) WithID ¶ added in v0.0.3
func (n *VariableDeclarator) WithID(id uuid.UUID) J
func (*VariableDeclarator) WithMarkers ¶
func (n *VariableDeclarator) WithMarkers(markers Markers) *VariableDeclarator
func (*VariableDeclarator) WithName ¶
func (n *VariableDeclarator) WithName(name *Identifier) *VariableDeclarator
func (*VariableDeclarator) WithPrefix ¶
func (n *VariableDeclarator) WithPrefix(prefix Space) *VariableDeclarator