SourcePosition (Doclet API )
Keywords: com.sun.javadoc.SourcePosition interface
Date: 2026-04-22

com.sun.javadoc

## Interface SourcePosition

-     public interface SourcePosition

  This interface describes a source position: filename, line number, and column number.
  Since:
    1.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `column()` The column in the source file.
    `File` | `file()` The source file.
    `int` | `line()` The line in the source file.
    `String` | `toString()` Convert the source position to the form "Filename:line".

- - ### Method Detail

    - #### file

          File file()

      The source file. Returns null if no file information is available.

    - #### line

          int line()

      The line in the source file. The first line is numbered 1; 0 means no line number information is available.

    - #### column

          int column()

      The column in the source file. The first column is numbered 1; 0 means no column information is available. Columns count characters in the input stream; a tab advances the column number to the next 8-column tab stop.

    - #### toString

          String toString()

      Convert the source position to the form "Filename:line".
      Overrides:
        `toString` in class `Object`
      Returns:
        a string representation of the object.

Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2026, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.