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
Nested ClassesModifier and TypeClassDescriptionstatic final classPredefinedfunctionsto 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.PredicatesNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.CanBeAnnotated
CanBeAnnotated.UtilsNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName, HasName.UtilsNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasParameterTypes
HasParameterTypes.PredicatesNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasReturnType
HasReturnType.PredicatesNested 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tngtech.archunit.base.HasDescription
getDescription
-
Method Details
-
getParameterTypes
- Specified by:
getParameterTypesin interfaceHasParameterTypes- Returns:
- the raw parameter types of this object, e.g.
for a method
this would be thevoid someMethod(String first, int second) {..}JavaClassesequivalent to[String.class, int.class],
for a method
this would be the<T> void someMethod(T generic) {..}JavaTypeVariableT.
Note that for non-generic cases this returns the same asHasParameterTypes.getRawParameterTypes().
-
getRawParameterTypes
- Specified by:
getRawParameterTypesin interfaceHasParameterTypes- Returns:
- the raw parameter types of this object, e.g.
for a method
this would be thevoid someMethod(String first, int second) {..}JavaClassesequivalent 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. theJavaClassequivalent toObject.class.
Note that for non-generic cases this returns the same asHasParameterTypes.getParameterTypes().
-
getReturnType
- Specified by:
getReturnTypein interfaceHasReturnType
-
getRawReturnType
- Specified by:
getRawReturnTypein interfaceHasReturnType
-
getThrowsClause
@PublicAPI(usage=ACCESS) public ThrowsClause<? extends AccessTarget.CodeUnitAccessTarget> getThrowsClause()- Specified by:
getThrowsClausein interfaceHasThrowsClause<AccessTarget.CodeUnitAccessTarget>
-
resolveMember
Tries to resolve the targeted method or constructor.- Overrides:
resolveMemberin classAccessTarget- Returns:
- The member that matches the access target or empty if it was not imported
- See Also:
-