com.sun.tools.javac.util
Interface JCDiagnostic.DiagnosticPosition

All Known Implementing Classes:
JCDiagnostic.SimpleDiagnosticPosition, JCTree, JCTree.JCAnnotation, JCTree.JCArrayAccess, JCTree.JCArrayTypeTree, JCTree.JCAssert, JCTree.JCAssign, JCTree.JCAssignOp, JCTree.JCBinary, JCTree.JCBlock, JCTree.JCBracketExpr, JCTree.JCBracketStat, JCTree.JCBreak, JCTree.JCCase, JCTree.JCCatch, JCTree.JCClassDecl, JCTree.JCCompilationUnit, JCTree.JCConditional, JCTree.JCContinue, JCTree.JCDoWhileLoop, JCTree.JCEnhancedForLoop, JCTree.JCErroneous, JCTree.JCEscapeExpr, JCTree.JCEscapeStat, JCTree.JCExpression, JCTree.JCExpressionStatement, JCTree.JCFieldAccess, JCTree.JCForLoop, JCTree.JCIdent, JCTree.JCIf, JCTree.JCImport, JCTree.JCInstanceOf, JCTree.JCLabeledStatement, JCTree.JCLiteral, JCTree.JCMethodDecl, JCTree.JCMethodInvocation, JCTree.JCModifiers, JCTree.JCNewArray, JCTree.JCNewClass, JCTree.JCParens, JCTree.JCPrimitiveTypeTree, JCTree.JCReturn, JCTree.JCSkip, JCTree.JCStatement, JCTree.JCSwitch, JCTree.JCSynchronized, JCTree.JCThrow, JCTree.JCTry, JCTree.JCTypeApply, JCTree.JCTypeCast, JCTree.JCTypeParameter, JCTree.JCUnary, JCTree.JCVariableDecl, JCTree.JCWhileLoop, JCTree.JCWildcard, JCTree.LetExpr, JCTree.TypeBoundKind
Enclosing class:
JCDiagnostic

public static interface JCDiagnostic.DiagnosticPosition

A DiagnosticPosition provides information about the positions in a file that gave rise to a diagnostic. It always defines a "preferred" position that most accurately defines the location of the diagnostic, it may also provide a related tree node that spans that location.


Method Summary
 int getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
          If there is a tree node, and if endPositions are available, get the end position of the tree node.
 int getPreferredPosition()
          Get the position within the file that most accurately defines the location for the diagnostic.
 int getStartPosition()
          If there is a tree node, get the start position of the tree node.
 JCTree getTree()
          Gets the tree node, if any, to which the diagnostic applies.
 

Method Detail

getTree

JCTree getTree()
Gets the tree node, if any, to which the diagnostic applies.


getStartPosition

int getStartPosition()
If there is a tree node, get the start position of the tree node. Otherwise, just returns the same as getPreferredPosition().


getPreferredPosition

int getPreferredPosition()
Get the position within the file that most accurately defines the location for the diagnostic.


getEndPosition

int getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
If there is a tree node, and if endPositions are available, get the end position of the tree node. Otherwise, just returns the same as getPreferredPosition().