Package com.tngtech.archunit.core.domain
Class AccessTarget.CodeUnitCallTarget
java.lang.Object
com.tngtech.archunit.core.domain.AccessTarget
com.tngtech.archunit.core.domain.AccessTarget.CodeUnitCallTarget
- All Implemented Interfaces:
HasDescription
,CanBeAnnotated
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasParameterTypes
,HasReturnType
,HasThrowsClause<AccessTarget.CodeUnitCallTarget>
- Direct Known Subclasses:
AccessTarget.ConstructorCallTarget
,AccessTarget.MethodCallTarget
- Enclosing class:
- AccessTarget
public abstract static class AccessTarget.CodeUnitCallTarget extends AccessTarget implements HasParameterTypes, HasReturnType, HasThrowsClause<AccessTarget.CodeUnitCallTarget>
Represents an
AccessTarget
where the target is a code unit. For further elaboration about the necessity to distinguish
CodeUnitCallTarget
from JavaCodeUnit
, refer to the documentation at AccessTarget
and in particular the
documentation at MethodCallTarget.resolve()
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessTarget.CodeUnitCallTarget.Functions
Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.AccessTarget
AccessTarget.CodeUnitCallTarget, AccessTarget.ConstructorCallTarget, AccessTarget.FieldAccessTarget, AccessTarget.MethodCallTarget, 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 Type Method Description java.util.List<JavaType>
getParameterTypes()
java.util.List<JavaClass>
getRawParameterTypes()
JavaClass
getRawReturnType()
JavaType
getReturnType()
ThrowsClause<AccessTarget.CodeUnitCallTarget>
getThrowsClause()
abstract java.util.Set<? extends JavaCodeUnit>
resolve()
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
- Specified by:
getThrowsClause
in interfaceHasThrowsClause<AccessTarget.CodeUnitCallTarget>
-
resolve
Tries to resolve the targeted method or constructor.- Specified by:
resolve
in classAccessTarget
- Returns:
- Set of all members that match the call target
- See Also:
AccessTarget.ConstructorCallTarget.resolveConstructor()
,AccessTarget.MethodCallTarget.resolve()
-