Package spoon.reflect.cu.position
Interface DeclarationSourcePosition
- All Superinterfaces:
CompoundSourcePosition
,Serializable
,SourcePosition
- All Known Subinterfaces:
BodyHolderSourcePosition
- All Known Implementing Classes:
BodyHolderSourcePositionImpl
,DeclarationSourcePositionImpl
Represents the position of a program element in a source file in an immutable manner.
The start/end represents range of whole program element including children element and comments
The nameStart/End represents range of name of program element.
The modifierSourceStart/End represents range of modifiers and annotations of the element
-
Field Summary
Fields inherited from interface spoon.reflect.cu.SourcePosition
NOPOSITION
-
Method Summary
Modifier and TypeMethodDescriptionaddDefaultValueEnd(int endDefaultValueDeclaration)
returns a new position object enriched a default value declaration (immutability pattern)int
returns the end of the default value int i = 0, j =1 ➡ returns the commaint
returns the last char of the last modifierint
returns the first char of the first modifierMethods inherited from interface spoon.reflect.cu.position.CompoundSourcePosition
getDeclarationEnd, getDeclarationStart, getNameEnd, getNameStart
Methods inherited from interface spoon.reflect.cu.SourcePosition
getColumn, getCompilationUnit, getEndColumn, getEndLine, getFile, getLine, getSourceEnd, getSourceStart, isValidPosition, toString
-
Method Details
-
getModifierSourceStart
int getModifierSourceStart()returns the first char of the first modifier -
getModifierSourceEnd
int getModifierSourceEnd()returns the last char of the last modifier -
getDefaultValueEnd
int getDefaultValueEnd()returns the end of the default value int i = 0, j =1 ➡ returns the comma -
addDefaultValueEnd
returns a new position object enriched a default value declaration (immutability pattern)
-