Package com.tngtech.archunit.core.domain
Class SourceCodeLocation
- java.lang.Object
-
- com.tngtech.archunit.core.domain.SourceCodeLocation
-
@PublicAPI(usage=ACCESS) public final class SourceCodeLocation extends java.lang.Object
Location in the source code of an ArchUnit domain object.
Consider, e.g., aJavaAccessfromcom.myapp.MyClassline number 28 to another classcom.any.OtherClass. Then theSourceCodeLocationwould becom.myapp.MyClass.java:28
ASourceCodeLocationwill always only be as precise as possible from the point of Java bytecode. A field of a class, e.g.,com.myapp.MyClasswould always give
since there is no way to precisely determine the line number of acom.myapp.MyClass.java:0JavaFieldfrom bytecode.- See Also:
toString()
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()static SourceCodeLocationof(JavaClass sourceClass)static SourceCodeLocationof(JavaClass sourceClass, int lineNumber)java.lang.StringtoString()
-
-
-
Method Detail
-
of
@PublicAPI(usage=ACCESS) public static SourceCodeLocation of(JavaClass sourceClass)
-
of
@PublicAPI(usage=ACCESS) public static SourceCodeLocation of(JavaClass sourceClass, int lineNumber)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- "(${sourceClass.getSimpleName()}.java:${lineNumber})". This format is (at least by IntelliJ Idea) recognized as location, if it's the end of a line, thus enabling IDE support to jump to a definition.
-
-