Package net.sourceforge.pmd.lang.ast
Class SourceCodePositioner
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.SourceCodePositioner
-
public class SourceCodePositioner extends java.lang.Object
Calculates from an absolute offset in the source file the line/column coordinate. This is needed as Rhino only offers absolute positions for each node. Some other languages like XML and Apex use this, too. Idea from: http://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/javascript/jscomp/SourceFile.java
-
-
Constructor Summary
Constructors Constructor Description SourceCodePositioner(java.lang.String sourceCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
columnFromOffset(int lineNumber, int offset)
int
getLastLine()
int
getLastLineColumn()
int
lineNumberFromOffset(int offset)
-