Package com.tngtech.archunit.core.domain
Class JavaAccess<TARGET extends AccessTarget>
java.lang.Object
com.tngtech.archunit.core.domain.JavaAccess<TARGET>
- All Implemented Interfaces:
HasDescription
,Convertible
,HasName
,HasOwner<JavaCodeUnit>
,HasSourceCodeLocation
- Direct Known Subclasses:
JavaCodeUnitAccess
,JavaFieldAccess
@PublicAPI(usage=ACCESS)
public abstract class JavaAccess<TARGET extends AccessTarget>
extends Object
implements HasName, HasDescription, HasOwner<JavaCodeUnit>, HasSourceCodeLocation, Convertible
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Predefinedfunctions
to transformJavaAccess
.static final class
Predefinedpredicates
targetingJavaAccess
.Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName, HasName.Utils
-
Method Summary
-
Method Details
-
getName
-
getOrigin
-
getOriginOwner
-
getTargetOwner
-
getTarget
-
getLineNumber
-
getOwner
- Specified by:
getOwner
in interfaceHasOwner<TARGET extends AccessTarget>
- Returns:
- The "owner" of this object, compare
HasOwner
-
getSourceCodeLocation
- Specified by:
getSourceCodeLocation
in interfaceHasSourceCodeLocation
- Returns:
- The
SourceCodeLocation
of this object, i.e. how to locate the respective object within the set of source files.
-
isDeclaredInLambda
-
convertTo
Description copied from interface:Convertible
Converts this type to a set of other types. For example aJavaAccess
can also be considered aDependency
, sojavaAccess.convertTo(Dependency.class)
will yield a set with a singleDependency
representing this access. Or a component dependency grouping many class dependencies could be considered a set of exactly these class dependencies. The result will be an empty set if no conversion is possible (e.g. callingjavaAccess.convertTo(Integer.class)
.- Specified by:
convertTo
in interfaceConvertible
- Parameters:
type
- The type to convert to- Returns:
- A set of converted elements, empty if no conversion is possible
-
toString
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-
descriptionVerb
-
getContainingTryBlocks
- Returns:
- All try-catch-blocks where this
JavaAccess
is contained within the try-part the try-catch-block
-