Klasse SourceLocation

java.lang.Object
org.aspectj.bridge.SourceLocation
Alle implementierten Schnittstellen:
Serializable, ISourceLocation

public class SourceLocation extends Object implements ISourceLocation
Immutable source location. This guarantees that the source file is not null and that the numeric values are positive and line ≤ endLine.
Siehe auch:
  • Felddetails

    • UNKNOWN

      public static final ISourceLocation UNKNOWN
      used when SourceLocation is not available
  • Konstruktordetails

    • SourceLocation

      public SourceLocation(File file, int line)
      Same as SourceLocation(file, line, line, 0), except that column is not rendered during toString()
    • SourceLocation

      public SourceLocation(File file, int line, int endLine)
      same as SourceLocation(file, line, endLine, ISourceLocation.NO_COLUMN)
    • SourceLocation

      public SourceLocation(File file, int line, int endLine, int column)
      Parameter:
      file - File of the source; if null, use ISourceLocation.NO_FILE, not null
      line - int starting line of the location - positive number
      endLine - int ending line of the location - ≤ starting line
      column - int character position of starting location - positive number
    • SourceLocation

      public SourceLocation(File file, int line, int endLine, int column, String context)
    • SourceLocation

      public SourceLocation(File file, int line, int endLine, int column, String context, String sourceFileName)
  • Methodendetails

    • validLine

      public static final void validLine(int line)
      Löst aus:
      IllegalArgumentException - if the input would not be a valid line
    • validColumn

      public static final void validColumn(int column)
      Löst aus:
      IllegalArgumentException - if the input would not be a valid column
    • getSourceFile

      public File getSourceFile()
      Angegeben von:
      getSourceFile in Schnittstelle ISourceLocation
      Gibt zurück:
      File source or NO_FILE if the implementation requires a non-null result or null otherwise
    • getLine

      public int getLine()
      Angegeben von:
      getLine in Schnittstelle ISourceLocation
      Gibt zurück:
      0..MAX_LINE
    • getColumn

      public int getColumn()
      Angegeben von:
      getColumn in Schnittstelle ISourceLocation
      Gibt zurück:
      int actual column or 0 if not available per constructor treatment of ISourceLocation.NO_COLUMN
    • getEndLine

      public int getEndLine()
      Angegeben von:
      getEndLine in Schnittstelle ISourceLocation
      Gibt zurück:
      getLine()..MAX_LINE
    • getContext

      public String getContext()
      Angegeben von:
      getContext in Schnittstelle ISourceLocation
      Gibt zurück:
      null String or application-specific context
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      String {context\n}{file:}line{:column}
    • getOffset

      public int getOffset()
      Angegeben von:
      getOffset in Schnittstelle ISourceLocation
      Gibt zurück:
      offset into file
    • setOffset

      public void setOffset(int i)
    • getSourceFileName

      public String getSourceFileName()
      Beschreibung aus Schnittstelle kopiert: ISourceLocation
      In the cases where getSourceFile().getName() returns a class file (for example when we have a binary aspect) this should return the name of the source file (for example BinaryAspect.aj)
      Angegeben von:
      getSourceFileName in Schnittstelle ISourceLocation
      Gibt zurück:
      the name of the source file
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object