net.sourceforge.pmd.lang.ecmascript.ast
Class SourceCodePositioner
java.lang.Object
net.sourceforge.pmd.lang.ecmascript.ast.SourceCodePositioner
public class SourceCodePositioner
- extends 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.
Idea from: http://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/javascript/jscomp/SourceFile.java
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SourceCodePositioner
public SourceCodePositioner(String sourceCode)
lineNumberFromOffset
public int lineNumberFromOffset(int offset)
columnFromOffset
public int columnFromOffset(int offset)
Copyright © 2002-2016 InfoEther. All Rights Reserved.