Package com.tngtech.archunit.lang.syntax
Class ClassesThatInternal<CONJUNCTION>
java.lang.Object
com.tngtech.archunit.lang.syntax.ClassesThatInternal<CONJUNCTION>
- All Implemented Interfaces:
ClassesThat<CONJUNCTION>
@Internal
public final class ClassesThatInternal<CONJUNCTION>
extends Object
implements ClassesThat<CONJUNCTION>
-
Constructor Summary
ConstructorDescriptionClassesThatInternal
(Function<DescribedPredicate<? super JavaClass>, CONJUNCTION> addPredicate) -
Method Summary
Modifier and TypeMethodDescriptionareAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches classes annotated with a certain annotation, where matching annotations are determined by the supplied predicate.areAnnotatedWith
(Class<? extends Annotation> annotationType) Matches classes annotated with a certain type of annotation.areAnnotatedWith
(String annotationTypeName) Matches classes annotated with a certain type of annotation.Matches annotations.areAssignableFrom
(DescribedPredicate<? super JavaClass> predicate) Matches classes assignable from a certain type matching the given predicate.areAssignableFrom
(Class<?> type) Matches classes assignable from a certain type (compareClass.isAssignableFrom(Class)
to terminology).areAssignableFrom
(String typeName) Matches classes assignable from a certain type with the given type name.areAssignableTo
(DescribedPredicate<? super JavaClass> predicate) Matches classes assignable to a certain type matching the given predicate.areAssignableTo
(Class<?> type) Matches classes assignable to a certain type (compareClass.isAssignableFrom(Class)
to terminology).areAssignableTo
(String typeName) Matches classes assignable to a certain type with the given type name.areEnums()
Matches enums.Matches interfaces.areMetaAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches classes meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.areMetaAnnotatedWith
(Class<? extends Annotation> annotationType) Matches classes meta-annotated with a certain type of annotation.areMetaAnnotatedWith
(String annotationTypeName) Matches classes meta-annotated with a certain type of annotation.areNotAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches classes not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.areNotAnnotatedWith
(Class<? extends Annotation> annotationType) Matches classes not annotated with a certain type of annotation.areNotAnnotatedWith
(String annotationTypeName) Matches classes not annotated with a certain type of annotation.Matches everything except annotations.areNotAssignableFrom
(DescribedPredicate<? super JavaClass> predicate) Matches classes not assignable from a certain type matching the given predicate.areNotAssignableFrom
(Class<?> type) Matches classes not assignable from a certain type.areNotAssignableFrom
(String typeName) Matches classes not assignable from a certain type with the given type name.areNotAssignableTo
(DescribedPredicate<? super JavaClass> predicate) Matches classes not assignable to a certain type matching the given predicate.areNotAssignableTo
(Class<?> type) Matches classes not assignable to a certain type.areNotAssignableTo
(String typeName) Matches classes not assignable to a certain type with the given type name.Matches everything except enums.Matches everything except interfaces.areNotMetaAnnotatedWith
(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches classes not meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.areNotMetaAnnotatedWith
(Class<? extends Annotation> annotationType) Matches classes not meta-annotated with a certain type of annotation.areNotMetaAnnotatedWith
(String annotationTypeName) Matches classes not meta-annotated with a certain type of annotation.Matches non-package private classes.Matches non-private classes.Matches non-protected classes.Matches non-public classes.Matches everything except records.Matches package private classes.Matches private classes.Matches protected classes.Matches public classes.Matches records.belongToAnyOf
(Class<?>... classes) Matches every class in the supplied list and any of their named/anonymous inner classes, no matter how deeply nested.containAnyCodeUnitsThat
(DescribedPredicate<? super JavaCodeUnit> predicate) Matches classes that contain anycode unit
matching the supplied predicate.containAnyConstructorsThat
(DescribedPredicate<? super JavaConstructor> predicate) Matches classes that contain anyconstructor
matching the supplied predicate.containAnyFieldsThat
(DescribedPredicate<? super JavaField> predicate) Matches classes that contain anyfield
matching the supplied predicate.containAnyMembersThat
(DescribedPredicate<? super JavaMember> predicate) Matches classes that contain anymember
matching the supplied predicate.containAnyMethodsThat
(DescribedPredicate<? super JavaMethod> predicate) Matches classes that contain anymethod
matching the supplied predicate.containAnyStaticInitializersThat
(DescribedPredicate<? super JavaStaticInitializer> predicate) Matches classes that contain astatic initializer
matching the supplied predicate.doNotBelongToAnyOf
(Class<?>... classes) Inverted form ofbelongToAnyOf(Outer.class)
Matches classes that do not have a certain fully qualified class name.doNotHaveModifier
(JavaModifier modifier) Matches classes not having a certainJavaModifier
(e.g.doNotHaveSimpleName
(String name) Matches classes that do not have a certain simple class name.doNotImplement
(DescribedPredicate<? super JavaClass> predicate) Matches classes that do not implement a certain interface matching the given predicate.doNotImplement
(Class<?> type) Matches classes that do not implement a certain interface.doNotImplement
(String typeName) Matches classes that do not implement a certain interface with the given type name.haveFullyQualifiedName
(String name) Matches classes by their fully qualified class name.haveModifier
(JavaModifier modifier) Matches classes having a certainJavaModifier
(e.g.haveNameMatching
(String regex) Matches classes with a fully qualified class name matching a given regular expression.haveNameNotMatching
(String regex) Matches classes with a fully qualified class name not matching a given regular expression.haveSimpleName
(String name) Matches classes by their simple class name.haveSimpleNameContaining
(String infix) Matches classes with a simple class name containing the specified infix.haveSimpleNameEndingWith
(String suffix) Matches classes with a simple class name ending with a given suffix.Matches classes with a simple class name not containing the specified infix.haveSimpleNameNotEndingWith
(String suffix) Matches classes with a simple class name not ending with a given suffix.haveSimpleNameNotStartingWith
(String prefix) Matches classes with a simple class name not starting with a given prefix.haveSimpleNameStartingWith
(String prefix) Matches classes with a simple class name starting with a given prefix.implement
(DescribedPredicate<? super JavaClass> predicate) Matches classes that implement a certain interface matching the given predicate.Matches classes that implement a certain interface.Matches classes that implement a certain interface with the given type name.resideInAnyPackage
(String... packageIdentifiers) Matches classes residing in a package matching any of the supplied package identifiers.resideInAPackage
(String packageIdentifier) Matches classes residing in a package matching the supplied package identifier.resideOutsideOfPackage
(String packageIdentifier) Matches classes not residing in a package matching the supplied package identifier.resideOutsideOfPackages
(String... packageIdentifiers) Matches classes not residing in a package matching any of the supplied package identifiers.
-
Constructor Details
-
ClassesThatInternal
public ClassesThatInternal(Function<DescribedPredicate<? super JavaClass>, CONJUNCTION> addPredicate)
-
-
Method Details
-
resideInAPackage
Description copied from interface:ClassesThat
Matches classes residing in a package matching the supplied package identifier.- Specified by:
resideInAPackage
in interfaceClassesThat<CONJUNCTION>
- Parameters:
packageIdentifier
- A string identifying packages, for details seePackageMatcher
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideInAnyPackage
Description copied from interface:ClassesThat
Matches classes residing in a package matching any of the supplied package identifiers.- Specified by:
resideInAnyPackage
in interfaceClassesThat<CONJUNCTION>
- Parameters:
packageIdentifiers
- Strings identifying packages, for details seePackageMatcher
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideOutsideOfPackage
Description copied from interface:ClassesThat
Matches classes not residing in a package matching the supplied package identifier.- Specified by:
resideOutsideOfPackage
in interfaceClassesThat<CONJUNCTION>
- Parameters:
packageIdentifier
- A string identifying packages, for details seePackageMatcher
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
resideOutsideOfPackages
Description copied from interface:ClassesThat
Matches classes not residing in a package matching any of the supplied package identifiers.- Specified by:
resideOutsideOfPackages
in interfaceClassesThat<CONJUNCTION>
- Parameters:
packageIdentifiers
- Strings identifying packages, for details seePackageMatcher
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
Description copied from interface:ClassesThat
Matches classes annotated with a certain type of annotation.- Specified by:
areAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationType
- Specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not annotated with a certain type of annotation.- Specified by:
areNotAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationType
- Specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
Description copied from interface:ClassesThat
Matches classes annotated with a certain type of annotation.- Specified by:
areAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not annotated with a certain type of annotation.- Specified by:
areNotAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
Description copied from interface:ClassesThat
Matches classes annotated with a certain annotation, where matching annotations are determined by the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaAnnotation
can be found within one of the respective ancestors likeHasType.Predicates
.- Specified by:
areAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaAnnotations
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaAnnotation
can be found within one of the respective ancestors likeHasType.Predicates
.- Specified by:
areNotAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaAnnotations
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.This also matches classes that are directly annotated with the supplied annotation type.
- Specified by:
areMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationType
- Specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.Matching classes may also not directly be annotated with the supplied annotation type.
- Specified by:
areNotMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationType
- Specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.This also matches classes that are directly annotated with the supplied annotation type.
- Specified by:
areMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.Matching classes may also not directly be annotated with the supplied annotation type.
- Specified by:
areNotMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
annotationTypeName
- Fully qualified class name of a specific type ofAnnotation
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.This also matches classes where a direct annotation matches the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaAnnotation
can be found within one of the respective ancestors likeHasType.Predicates
.- Specified by:
areMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaAnnotations
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
Description copied from interface:ClassesThat
Matches classes not meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate. A meta-annotation is an annotation that is declared on another annotation.Matching classes may also not be annotated with a direct annotation matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaAnnotation
can be found within one of the respective ancestors likeHasType.Predicates
.- Specified by:
areNotMetaAnnotatedWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaAnnotations
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
Description copied from interface:ClassesThat
Matches classes that implement a certain interface. Note that this only matches non-interfaceclasses
that implement the supplied interfacetype
(compareJavaClass.Predicates.implement(Class)
. For general assignability seeClassesThat.areAssignableTo(Class)
- Specified by:
implement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- An interface type matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotImplement
Description copied from interface:ClassesThat
Matches classes that do not implement a certain interface. This is the negation ofClassesThat.implement(Class)
.- Specified by:
doNotImplement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- An interface type matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
Description copied from interface:ClassesThat
Matches classes that implement a certain interface with the given type name. This is equivalent toClassesThat.implement(Class)
, but does not depend on having a certain type on the classpath. Note that this only matches non-interfaceclasses
that implement the supplied interfacetypeName
(compareJavaClass.Predicates.implement(Class)
. For general assignability seeClassesThat.areAssignableTo(String)
- Specified by:
implement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of an interface type matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotImplement
Description copied from interface:ClassesThat
Matches classes that do not implement a certain interface with the given type name. This is equivalent toClassesThat.doNotImplement(Class)
, but does not depend on having a certain type on the classpath.- Specified by:
doNotImplement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of an interface type matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
implement
Description copied from interface:ClassesThat
Matches classes that implement a certain interface matching the given predicate. For example, a call withHasName.Predicates.name(String)
would be equivalent toClassesThat.implement(String)
, but the approach is a lot more generic. Note that this only matches non-interfaceclasses
that implement an interface matching thepredicate
(compareJavaClass.Predicates.implement(Class)
. For general assignability seeClassesThat.areAssignableTo(DescribedPredicate)
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
implement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying interfaces matching classes must implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotImplement
Description copied from interface:ClassesThat
Matches classes that do not implement a certain interface matching the given predicate. This is the negation ofClassesThat.implement(DescribedPredicate)
.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
doNotImplement
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying interfaces matching classes must not implement- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameStartingWith
Description copied from interface:ClassesThat
Matches classes with a simple class name starting with a given prefix.- Specified by:
haveSimpleNameStartingWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
prefix
- A prefix the simple class name should start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotStartingWith
Description copied from interface:ClassesThat
Matches classes with a simple class name not starting with a given prefix.- Specified by:
haveSimpleNameNotStartingWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
prefix
- A prefix the simple class name should not start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameContaining
Description copied from interface:ClassesThat
Matches classes with a simple class name containing the specified infix.- Specified by:
haveSimpleNameContaining
in interfaceClassesThat<CONJUNCTION>
- Parameters:
infix
- An infix the simple class name should contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotContaining
Description copied from interface:ClassesThat
Matches classes with a simple class name not containing the specified infix.- Specified by:
haveSimpleNameNotContaining
in interfaceClassesThat<CONJUNCTION>
- Parameters:
infix
- An infix the simple class name should not contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameEndingWith
Description copied from interface:ClassesThat
Matches classes with a simple class name ending with a given suffix.- Specified by:
haveSimpleNameEndingWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
suffix
- A suffix the simple class name should end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleNameNotEndingWith
Description copied from interface:ClassesThat
Matches classes with a simple class name not ending with a given suffix.- Specified by:
haveSimpleNameNotEndingWith
in interfaceClassesThat<CONJUNCTION>
- Parameters:
suffix
- A suffix the simple class name should not end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameMatching
Description copied from interface:ClassesThat
Matches classes with a fully qualified class name matching a given regular expression.- Specified by:
haveNameMatching
in interfaceClassesThat<CONJUNCTION>
- Parameters:
regex
- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotMatching
Description copied from interface:ClassesThat
Matches classes with a fully qualified class name not matching a given regular expression.- Specified by:
haveNameNotMatching
in interfaceClassesThat<CONJUNCTION>
- Parameters:
regex
- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
Description copied from interface:ClassesThat
Matches classes assignable to a certain type (compareClass.isAssignableFrom(Class)
to terminology). A simple example for this predicate would beassignableTo(Object.class).test(importedStringClass); // --> returns true assignableTo(String.class).test(importedStringClass); // --> returns true assignableTo(List.class).test(importedStringClass); // --> returns false
- Specified by:
areAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- An upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
Description copied from interface:ClassesThat
Matches classes not assignable to a certain type. This is the negation ofClassesThat.areAssignableTo(Class)
.- Specified by:
areNotAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- An upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
Description copied from interface:ClassesThat
Matches classes assignable to a certain type with the given type name. This is equivalent toClassesThat.areAssignableTo(Class)
, but does not depend on having a certain type on the classpath.- Specified by:
areAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of an upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
Description copied from interface:ClassesThat
Matches classes not assignable to a certain type with the given type name. This is equivalent toClassesThat.areNotAssignableTo(Class)
, but does not depend on having a certain type on the classpath.- Specified by:
areNotAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of an upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableTo
Description copied from interface:ClassesThat
Matches classes assignable to a certain type matching the given predicate. For example, a call withHasName.Predicates.name(String)
would be equivalent toClassesThat.areAssignableTo(String)
, but the approach is a lot more generic.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
areAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying an upper type bound to match imported classes against (imported subtypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableTo
Description copied from interface:ClassesThat
Matches classes not assignable to a certain type matching the given predicate. This is the negation ofClassesThat.areAssignableTo(DescribedPredicate)
.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
areNotAssignableTo
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying an upper type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
Description copied from interface:ClassesThat
Matches classes assignable from a certain type (compareClass.isAssignableFrom(Class)
to terminology). This is roughly equivalent to the use of reflection:
A simple example for this predicate would besomeClass.class.isAssignableFrom(type);
assignableFrom(ArrayList.class).test(importedArrayListClass); // --> returns true assignableFrom(ArrayList.class).test(importedListClass); // --> returns true assignableFrom(ArrayList.class).test(importedStringClass); // --> returns false
- Specified by:
areAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- A lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
Description copied from interface:ClassesThat
Matches classes not assignable from a certain type. This is the negation ofClassesThat.areAssignableFrom(Class)
.- Specified by:
areNotAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
type
- A lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
Description copied from interface:ClassesThat
Matches classes assignable from a certain type with the given type name. This is equivalent toClassesThat.areAssignableFrom(Class)
, but does not depend on having a certain type on the classpath.- Specified by:
areAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of a lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
Description copied from interface:ClassesThat
Matches classes not assignable from a certain type with the given type name. This is equivalent toClassesThat.areNotAssignableFrom(Class)
, but does not depend on having a certain type on the classpath.- Specified by:
areNotAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
typeName
- Name of a lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAssignableFrom
Description copied from interface:ClassesThat
Matches classes assignable from a certain type matching the given predicate. For example, a call withHasName.Predicates.name(String)
would be equivalent toClassesThat.areAssignableFrom(String)
, but the approach is a lot more generic.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
areAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying a lower type bound to match imported classes against (imported supertypes will match)- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAssignableFrom
Description copied from interface:ClassesThat
Matches classes not assignable from a certain type matching the given predicate. This is the negation ofClassesThat.areAssignableFrom(DescribedPredicate)
.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaClass
can be found withinJavaClass.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
areNotAssignableFrom
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate identifying a lower type bound imported classes should NOT have- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areInterfaces
Description copied from interface:ClassesThat
Matches interfaces.- Specified by:
areInterfaces
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotInterfaces
Description copied from interface:ClassesThat
Matches everything except interfaces.- Specified by:
areNotInterfaces
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areEnums
Description copied from interface:ClassesThat
Matches enums.- Specified by:
areEnums
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotEnums
Description copied from interface:ClassesThat
Matches everything except enums.- Specified by:
areNotEnums
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotations
Description copied from interface:ClassesThat
Matches annotations.- Specified by:
areAnnotations
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotations
Description copied from interface:ClassesThat
Matches everything except annotations.- Specified by:
areNotAnnotations
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areRecords
Description copied from interface:ClassesThat
Matches records.- Specified by:
areRecords
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
- See Also:
-
areNotRecords
Description copied from interface:ClassesThat
Matches everything except records.- Specified by:
areNotRecords
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
- See Also:
-
areTopLevelClasses
- Specified by:
areTopLevelClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotTopLevelClasses
- Specified by:
areNotTopLevelClasses
in interfaceClassesThat<CONJUNCTION>
-
areNestedClasses
- Specified by:
areNestedClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotNestedClasses
- Specified by:
areNotNestedClasses
in interfaceClassesThat<CONJUNCTION>
-
areMemberClasses
- Specified by:
areMemberClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotMemberClasses
- Specified by:
areNotMemberClasses
in interfaceClassesThat<CONJUNCTION>
-
areInnerClasses
- Specified by:
areInnerClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotInnerClasses
- Specified by:
areNotInnerClasses
in interfaceClassesThat<CONJUNCTION>
-
areAnonymousClasses
- Specified by:
areAnonymousClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotAnonymousClasses
- Specified by:
areNotAnonymousClasses
in interfaceClassesThat<CONJUNCTION>
-
areLocalClasses
- Specified by:
areLocalClasses
in interfaceClassesThat<CONJUNCTION>
-
areNotLocalClasses
- Specified by:
areNotLocalClasses
in interfaceClassesThat<CONJUNCTION>
-
belongToAnyOf
Description copied from interface:ClassesThat
Matches every class in the supplied list and any of their named/anonymous inner classes, no matter how deeply nested. E.g. consider
Thenclass Outer { class Inner { class EvenMoreInner { } } }
belongToAnyOf(Outer.class)
would match theJavaClass
Outer
but alsoInner
andEvenMoreInner
. Likewise would hold for any anonymous inner classes.- Specified by:
belongToAnyOf
in interfaceClassesThat<CONJUNCTION>
- Parameters:
classes
- List ofClass
objects.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotBelongToAnyOf
Description copied from interface:ClassesThat
Inverted form ofbelongToAnyOf(Outer.class)
- Specified by:
doNotBelongToAnyOf
in interfaceClassesThat<CONJUNCTION>
- Parameters:
classes
- List ofClass
objects.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePublic
Description copied from interface:ClassesThat
Matches public classes.- Specified by:
arePublic
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPublic
Description copied from interface:ClassesThat
Matches non-public classes.- Specified by:
areNotPublic
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areProtected
Description copied from interface:ClassesThat
Matches protected classes.- Specified by:
areProtected
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotProtected
Description copied from interface:ClassesThat
Matches non-protected classes.- Specified by:
areNotProtected
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePackagePrivate
Description copied from interface:ClassesThat
Matches package private classes.- Specified by:
arePackagePrivate
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPackagePrivate
Description copied from interface:ClassesThat
Matches non-package private classes.- Specified by:
areNotPackagePrivate
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePrivate
Description copied from interface:ClassesThat
Matches private classes.- Specified by:
arePrivate
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPrivate
Description copied from interface:ClassesThat
Matches non-private classes.- Specified by:
areNotPrivate
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveFullyQualifiedName
Description copied from interface:ClassesThat
Matches classes by their fully qualified class name.- Specified by:
haveFullyQualifiedName
in interfaceClassesThat<CONJUNCTION>
- Parameters:
name
- The fully qualified class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveFullyQualifiedName
Description copied from interface:ClassesThat
Matches classes that do not have a certain fully qualified class name.- Specified by:
doNotHaveFullyQualifiedName
in interfaceClassesThat<CONJUNCTION>
- Parameters:
name
- The fully qualified class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveSimpleName
Description copied from interface:ClassesThat
Matches classes by their simple class name.- Specified by:
haveSimpleName
in interfaceClassesThat<CONJUNCTION>
- Parameters:
name
- The simple class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveSimpleName
Description copied from interface:ClassesThat
Matches classes that do not have a certain simple class name.- Specified by:
doNotHaveSimpleName
in interfaceClassesThat<CONJUNCTION>
- Parameters:
name
- The simple class name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveModifier
Description copied from interface:ClassesThat
Matches classes having a certainJavaModifier
(e.g.JavaModifier.ABSTRACT
).- Specified by:
haveModifier
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveModifier
Description copied from interface:ClassesThat
Matches classes not having a certainJavaModifier
(e.g.JavaModifier.ABSTRACT
).- Specified by:
doNotHaveModifier
in interfaceClassesThat<CONJUNCTION>
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyMembersThat
Description copied from interface:ClassesThat
Matches classes that contain anymember
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaMember
can be found withinJavaMember.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
containAnyMembersThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaMembers
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyFieldsThat
Description copied from interface:ClassesThat
Matches classes that contain anyfield
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaField
can be found withinJavaMember.Predicates
or one of the respective ancestors likeHasName.Predicates
.- Specified by:
containAnyFieldsThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaFields
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyCodeUnitsThat
Description copied from interface:ClassesThat
Matches classes that contain anycode unit
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaCodeUnit
can be found withinJavaCodeUnit.Predicates
or one of the respective ancestors likeJavaMember.Predicates
.- Specified by:
containAnyCodeUnitsThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaCodeUnits
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyMethodsThat
Description copied from interface:ClassesThat
Matches classes that contain anymethod
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaMethod
can be found withinJavaCodeUnit.Predicates
or one of the respective ancestors likeJavaMember.Predicates
.- Specified by:
containAnyMethodsThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaMethods
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyConstructorsThat
public CONJUNCTION containAnyConstructorsThat(DescribedPredicate<? super JavaConstructor> predicate) Description copied from interface:ClassesThat
Matches classes that contain anyconstructor
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaConstructor
can be found withinJavaCodeUnit.Predicates
or one of the respective ancestors likeJavaMember.Predicates
.- Specified by:
containAnyConstructorsThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaConstructors
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
containAnyStaticInitializersThat
public CONJUNCTION containAnyStaticInitializersThat(DescribedPredicate<? super JavaStaticInitializer> predicate) Description copied from interface:ClassesThat
Matches classes that contain astatic initializer
matching the supplied predicate.
Note that many predefinedpredicates
can be found within a subclassPredicates
of the respective domain object or a common ancestor. For example,predicates
targetingJavaStaticInitializer
can be found withinJavaCodeUnit.Predicates
or one of the respective ancestors likeJavaMember.Predicates
.- Specified by:
containAnyStaticInitializersThat
in interfaceClassesThat<CONJUNCTION>
- Parameters:
predicate
- A predicate defining matchingJavaStaticInitializers
- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-