net.sourceforge.pmd.lang.ecmascript.ast
Class SourceCodePositioner

java.lang.Object
  extended by 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


Constructor Summary
SourceCodePositioner(String sourceCode)
           
 
Method Summary
 int columnFromOffset(int offset)
           
 int lineNumberFromOffset(int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceCodePositioner

public SourceCodePositioner(String sourceCode)
Method Detail

lineNumberFromOffset

public int lineNumberFromOffset(int offset)

columnFromOffset

public int columnFromOffset(int offset)


Copyright © 2002-2016 InfoEther. All Rights Reserved.