Package com.tngtech.archunit.core.domain
Class AccessTarget.CodeUnitAccessTarget
java.lang.Object
com.tngtech.archunit.core.domain.AccessTarget
com.tngtech.archunit.core.domain.AccessTarget.CodeUnitAccessTarget
- All Implemented Interfaces:
HasDescription
,CanBeAnnotated
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasParameterTypes
,HasReturnType
,HasThrowsClause<AccessTarget.CodeUnitAccessTarget>
- Direct Known Subclasses:
AccessTarget.CodeUnitCallTarget
,AccessTarget.CodeUnitReferenceTarget
- Enclosing class:
- AccessTarget
@PublicAPI(usage=ACCESS)
public abstract static class AccessTarget.CodeUnitAccessTarget
extends AccessTarget
implements HasParameterTypes, HasReturnType, HasThrowsClause<AccessTarget.CodeUnitAccessTarget>
Represents an
AccessTarget
where the target is a code unit. For further elaboration about the necessity to distinguish
CodeUnitAccessTarget
from JavaCodeUnit
, refer to the documentation at AccessTarget
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Predefinedfunctions
to transformAccessTarget.CodeUnitAccessTarget
.Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.AccessTarget
AccessTarget.CodeUnitAccessTarget, AccessTarget.CodeUnitCallTarget, AccessTarget.CodeUnitReferenceTarget, AccessTarget.ConstructorCallTarget, AccessTarget.ConstructorReferenceTarget, AccessTarget.FieldAccessTarget, AccessTarget.MethodCallTarget, AccessTarget.MethodReferenceTarget, AccessTarget.Predicates
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.CanBeAnnotated
CanBeAnnotated.Utils
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName, HasName.Utils
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasParameterTypes
HasParameterTypes.Predicates
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasReturnType
HasReturnType.Predicates
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasThrowsClause
HasThrowsClause.Predicates
-
Method Summary
Modifier and TypeMethodDescriptionThrowsClause<? extends AccessTarget.CodeUnitAccessTarget>
Optional<? extends JavaCodeUnit>
Tries to resolve the targeted method or constructor.Methods inherited from class com.tngtech.archunit.core.domain.AccessTarget
equals, getFullName, getName, getOwner, hashCode, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tngtech.archunit.base.HasDescription
getDescription
-
Method Details
-
getParameterTypes
- Specified by:
getParameterTypes
in interfaceHasParameterTypes
- Returns:
- the raw parameter types of this object, e.g.
for a method
this would be thevoid someMethod(String first, int second) {..}
JavaClasses
equivalent to[String.class, int.class]
,
for a method
this would be the<T> void someMethod(T generic) {..}
JavaTypeVariable
T
.
Note that for non-generic cases this returns the same asHasParameterTypes.getRawParameterTypes()
.
-
getRawParameterTypes
- Specified by:
getRawParameterTypes
in interfaceHasParameterTypes
- Returns:
- the raw parameter types of this object, e.g.
for a method
this would be thevoid someMethod(String first, int second) {..}
JavaClasses
equivalent to[String.class, int.class]
,
for a method
this would be the erasure of the generic type variable<T> void someMethod(T generic) {..}
T
, i.e. theJavaClass
equivalent toObject.class
.
Note that for non-generic cases this returns the same asHasParameterTypes.getParameterTypes()
.
-
getReturnType
- Specified by:
getReturnType
in interfaceHasReturnType
-
getRawReturnType
- Specified by:
getRawReturnType
in interfaceHasReturnType
-
getThrowsClause
@PublicAPI(usage=ACCESS) public ThrowsClause<? extends AccessTarget.CodeUnitAccessTarget> getThrowsClause()- Specified by:
getThrowsClause
in interfaceHasThrowsClause<AccessTarget.CodeUnitAccessTarget>
-
resolveMember
Tries to resolve the targeted method or constructor.- Overrides:
resolveMember
in classAccessTarget
- Returns:
- The member that matches the access target or empty if it was not imported
- See Also:
-