Interface MembersThat<CONJUNCTION>
- All Known Subinterfaces:
CodeUnitsThat<CONJUNCTION>,FieldsThat<CONJUNCTION>,MethodsThat<CONJUNCTION>
-
Method Summary
Modifier and TypeMethodDescriptionareAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members annotated with a certain annotation, where matching annotations are determined by the supplied predicate.areAnnotatedWith(Class<? extends Annotation> annotationType) Matches members annotated with a certain type of annotation.areAnnotatedWith(String annotationTypeName) Matches members annotated with a certain type of annotation.areDeclaredIn(Class<?> javaClass) Matches members declared within the supplied class.areDeclaredIn(String className) Matches members declared within a class of the supplied class name.Allows to restrict the set of members under consideration by the class they are declared in
E.g.areDeclaredInClassesThat(DescribedPredicate<? super JavaClass> predicate) Matches members declared within a class matching the supplied predicate.areMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.areMetaAnnotatedWith(Class<? extends Annotation> annotationType) Matches members meta-annotated with a certain type of annotation.areMetaAnnotatedWith(String annotationTypeName) Matches members meta-annotated with a certain type of annotation.areNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.areNotAnnotatedWith(Class<? extends Annotation> annotationType) Matches members not annotated with a certain type of annotation.areNotAnnotatedWith(String annotationTypeName) Matches members not annotated with a certain type of annotation.areNotDeclaredIn(Class<?> javaClass) Matches members not declared within the supplied class.areNotDeclaredIn(String className) Matches members not declared within a class of the supplied class name.areNotMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members not meta-annotated with a certain annotation, where matching meta-annotations are determined by the supplied predicate.areNotMetaAnnotatedWith(Class<? extends Annotation> annotationType) Matches members not meta-annotated with a certain type of annotation.areNotMetaAnnotatedWith(String annotationTypeName) Matches members not meta-annotated with a certain type of annotation.Matches non-package private members.Matches non-private members.Matches non-protected members.Matches non-public members.Matches package private members.Matches private members.Matches protected members.Matches public members.doNotHaveFullName(String fullName) Matches members that do not have a certain full name.doNotHaveModifier(JavaModifier modifier) Matches members not having a certainJavaModifier(e.g.doNotHaveName(String name) Matches members that do not have a certain name (i.e.haveFullName(String fullName) Matches members by their full name.haveFullNameMatching(String regex) Matches members with a full name matching a given regular expression.haveFullNameNotMatching(String regex) Matches members with a full name not matching a given regular expression.haveModifier(JavaModifier modifier) Matches members having a certainJavaModifier(e.g.Matches members by their name (i.e.haveNameContaining(String infix) Matches members with a name containing the specified infix.haveNameEndingWith(String suffix) Matches members with a name ending with the specified suffix.haveNameMatching(String regex) Matches members with a name (i.e.haveNameNotContaining(String infix) Matches members with a name not containing the specified infix.haveNameNotEndingWith(String suffix) Matches members with a name not ending with the specified suffix.haveNameNotMatching(String regex) Matches members with a name (i.e.haveNameNotStartingWith(String prefix) Matches members with a name not starting with the specified prefix.haveNameStartingWith(String prefix) Matches members with a name starting with the specified prefix.
-
Method Details
-
haveName
Matches members by their name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME).- Parameters:
name- The member name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveName
Matches members that do not have a certain name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME).- Parameters:
name- The member name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameMatching
Matches members with a name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME) matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotMatching
Matches members with a name (i.e. field name, method name orJavaConstructor.CONSTRUCTOR_NAME) not matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveFullName
Matches members by their full name.- Parameters:
fullName- The member's full name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveFullName
Matches members that do not have a certain full name.- Parameters:
fullName- The member's full name- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveFullNameMatching
Matches members with a full name matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveFullNameNotMatching
Matches members with a full name not matching a given regular expression.- Parameters:
regex- A regular expression- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameStartingWith
Matches members with a name starting with the specified prefix.- Parameters:
prefix- A prefix the member name should start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotStartingWith
Matches members with a name not starting with the specified prefix.- Parameters:
prefix- A prefix the member name should not start with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameContaining
Matches members with a name containing the specified infix.- Parameters:
infix- An infix the member name should contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotContaining
Matches members with a name not containing the specified infix.- Parameters:
infix- An infix the member name should not contain- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameEndingWith
Matches members with a name ending with the specified suffix.- Parameters:
suffix- A suffix the member name should end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveNameNotEndingWith
Matches members with a name not ending with the specified suffix.- Parameters:
suffix- A suffix the member name should not end with- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePublic
Matches public members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPublic
Matches non-public members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areProtected
Matches protected members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotProtected
Matches non-protected members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePackagePrivate
Matches package private members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPackagePrivate
Matches non-package private members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
arePrivate
Matches private members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotPrivate
Matches non-private members.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
haveModifier
Matches members having a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
doNotHaveModifier
Matches members not having a certainJavaModifier(e.g.JavaModifier.ABSTRACT).- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
Matches members annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(Class<? extends Annotation> annotationType) Matches members not annotated with a certain type of annotation.- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areAnnotatedWith
Matches members annotated with a certain type of annotation.- 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
Matches members not annotated with a certain type of annotation.- 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
@PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members annotated with a certain annotation, where matching annotations are determined by the supplied predicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaAnnotationcan be found within one of the respective ancestors likeHasType.Predicates.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members not annotated with a certain annotation, where matching annotations are determined by the supplied predicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaAnnotationcan be found within one of the respective ancestors likeHasType.Predicates.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(Class<? extends Annotation> annotationType) Matches members meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.This also matches members that are directly annotated with the supplied annotation type.
- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(Class<? extends Annotation> annotationType) Matches members not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.Matching members may also not directly be annotated with the supplied annotation type.
- Parameters:
annotationType- Specific type ofAnnotation- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areMetaAnnotatedWith
Matches members meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.This also matches members that are directly annotated with the supplied annotation type.
- 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
Matches members not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.Matching members may also not directly be annotated with the supplied annotation type.
- 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
@PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members 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 members where a direct annotation matches the supplied predicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaAnnotationcan be found within one of the respective ancestors likeHasType.Predicates.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotMetaAnnotatedWith
@PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(DescribedPredicate<? super JavaAnnotation<?>> predicate) Matches members 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 members may also not be annotated with a direct annotation matching the supplied predicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaAnnotationcan be found within one of the respective ancestors likeHasType.Predicates.- Parameters:
predicate- A predicate defining matchingJavaAnnotations- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areDeclaredIn
Matches members declared within the supplied class.
E.g.someFieldin
will be matched byclass Example { Object someField; }members().that().areDeclaredIn(Example.class)- Parameters:
javaClass- A class that members have to be declared in to match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotDeclaredIn
Matches members not declared within the supplied class.
E.g.someFieldin
will not be matched byclass Example { Object someField; }members().that().areNotDeclaredIn(Example.class)- Parameters:
javaClass- A class that members must not be declared in to match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areDeclaredIn
Matches members declared within a class of the supplied class name.
E.g.someFieldin
will be matched byclass Example { Object someField; }members().that().areDeclaredIn(Example.class.getName())- Parameters:
className- Fully qualified name of a class that members have to be declared in to match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areNotDeclaredIn
Matches members not declared within a class of the supplied class name.
E.g.someFieldin
will not be matched byclass Example { Object someField; }members().that().areNotDeclaredIn(Example.class.getName())- Parameters:
className- Fully qualified name of a class that members must not be declared in to match- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areDeclaredInClassesThat
@PublicAPI(usage=ACCESS) CONJUNCTION areDeclaredInClassesThat(DescribedPredicate<? super JavaClass> predicate) Matches members declared within a class matching the supplied predicate.
E.g.someFieldin
will be matched byclass Example implements Serializable { Object someField; }
Note that many predefinedmembers().that().areDeclaredInClassesThat(are(assignableTo(Serializable.class)))predicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaClasscan be found withinJavaClass.Predicatesor one of the respective ancestors likeHasName.Predicates.- Parameters:
predicate- A predicate which matches classes where members have to be declared in- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
areDeclaredInClassesThat
Allows to restrict the set of members under consideration by the class they are declared in
E.g.someFieldin
will be matched byclass Example { Object someField; }members().that().areDeclaredInClassesThat().areAssignableTo(Object.class)- Returns:
- A syntax element that allows restricting where members are declared in
-