Package com.tngtech.archunit.core.domain
Class AccessTarget
- java.lang.Object
-
- com.tngtech.archunit.core.domain.AccessTarget
-
- All Implemented Interfaces:
CanBeAnnotated
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
- Direct Known Subclasses:
AccessTarget.CodeUnitCallTarget
,AccessTarget.FieldAccessTarget
public abstract class AccessTarget extends java.lang.Object implements HasName.AndFullName, CanBeAnnotated, HasOwner<JavaClass>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessTarget.CodeUnitCallTarget
static class
AccessTarget.ConstructorCallTarget
static class
AccessTarget.FieldAccessTarget
static class
AccessTarget.MethodCallTarget
static class
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.Functions
-
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasOwner
HasOwner.Functions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getFullName()
java.lang.String
getName()
JavaClass
getOwner()
int
hashCode()
boolean
isAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Returns true, if one of the resolved targets is annotated with an annotation matching the predicate.
NOTE: If the target was not imported, this method will always return false.boolean
isAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true, if one of the resolved targets is annotated with the given annotation type.
NOTE: If the target was not imported, this method will always return false.boolean
isAnnotatedWith(java.lang.String annotationTypeName)
boolean
isMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
boolean
isMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
boolean
isMetaAnnotatedWith(java.lang.String annotationTypeName)
abstract java.util.Set<? extends JavaMember>
resolve()
Tries to resolve the targeted members (methods, fields or constructors).java.lang.String
toString()
-
-
-
Method Detail
-
getFullName
public java.lang.String getFullName()
- Specified by:
getFullName
in interfaceHasName.AndFullName
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
resolve
public abstract java.util.Set<? extends JavaMember> resolve()
Tries to resolve the targeted members (methods, fields or constructors). In most cases this will be a single element, if the target was imported, or an empty set, if the target was not imported. However, forMethodCallTargets
, there can be multiple possible targets.- Returns:
- Set of all members that match the call target
- See Also:
AccessTarget.MethodCallTarget.resolve()
,AccessTarget.FieldAccessTarget.resolve()
,AccessTarget.ConstructorCallTarget.resolve()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isAnnotatedWith
public boolean isAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true, if one of the resolved targets is annotated with the given annotation type.
NOTE: If the target was not imported, this method will always return false.- Specified by:
isAnnotatedWith
in interfaceCanBeAnnotated
- Parameters:
annotationType
- The type of the annotation to check for- Returns:
- true if one of the resolved targets is annotated with the given type
-
isAnnotatedWith
public boolean isAnnotatedWith(java.lang.String annotationTypeName)
- Specified by:
isAnnotatedWith
in interfaceCanBeAnnotated
- See Also:
isAnnotatedWith(Class)
-
isAnnotatedWith
public boolean isAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
Returns true, if one of the resolved targets is annotated with an annotation matching the predicate.
NOTE: If the target was not imported, this method will always return false.- Specified by:
isAnnotatedWith
in interfaceCanBeAnnotated
- Parameters:
predicate
- Qualifies matching annotations- Returns:
- true if one of the resolved targets is annotated with an annotation matching the predicate
-
isMetaAnnotatedWith
public boolean isMetaAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
- Specified by:
isMetaAnnotatedWith
in interfaceCanBeAnnotated
-
isMetaAnnotatedWith
public boolean isMetaAnnotatedWith(java.lang.String annotationTypeName)
- Specified by:
isMetaAnnotatedWith
in interfaceCanBeAnnotated
-
isMetaAnnotatedWith
public boolean isMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation> predicate)
- Specified by:
isMetaAnnotatedWith
in interfaceCanBeAnnotated
-
-