Interface MembersThat<CONJUNCTION extends GivenMembersConjunction<?>>

All Known Subinterfaces:
CodeUnitsThat<CONJUNCTION>, FieldsThat<CONJUNCTION>, MethodsThat<CONJUNCTION>

public interface MembersThat<CONJUNCTION extends GivenMembersConjunction<?>>
  • Method Details

    • haveName

      Matches members by their name (i.e. field name, method name or JavaConstructor.CONSTRUCTOR_NAME).
      Parameters:
      name - The member name
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • doNotHaveName

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveName(String name)
      Matches members that do not have a certain name (i.e. field name, method name or JavaConstructor.CONSTRUCTOR_NAME).
      Parameters:
      name - The member name
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • haveNameMatching

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameMatching(String regex)
      Matches members with a name (i.e. field name, method name or JavaConstructor.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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotMatching(String regex)
      Matches members with a name (i.e. field name, method name or JavaConstructor.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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveFullName(String fullName)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveFullName(String fullName)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveFullNameMatching(String regex)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveFullNameNotMatching(String regex)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameStartingWith(String prefix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotStartingWith(String prefix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameContaining(String infix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotContaining(String infix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameEndingWith(String suffix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveNameNotEndingWith(String suffix)
      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

      @PublicAPI(usage=ACCESS) CONJUNCTION areNotProtected()
      Matches non-protected members.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • arePackagePrivate

      @PublicAPI(usage=ACCESS) CONJUNCTION arePackagePrivate()
      Matches package private members.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areNotPackagePrivate

      @PublicAPI(usage=ACCESS) CONJUNCTION 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

      @PublicAPI(usage=ACCESS) CONJUNCTION haveModifier(JavaModifier modifier)
      Matches members having a certain JavaModifier (e.g. JavaModifier.ABSTRACT).
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • doNotHaveModifier

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveModifier(JavaModifier modifier)
      Matches members not having a certain JavaModifier (e.g. JavaModifier.ABSTRACT).
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areAnnotatedWith

      @PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(Class<? extends Annotation> annotationType)
      Matches members annotated with a certain type of annotation.
      Parameters:
      annotationType - Specific type of Annotation
      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 of Annotation
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areAnnotatedWith

      @PublicAPI(usage=ACCESS) CONJUNCTION areAnnotatedWith(String annotationTypeName)
      Matches members annotated with a certain type of annotation.
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areNotAnnotatedWith

      @PublicAPI(usage=ACCESS) CONJUNCTION areNotAnnotatedWith(String annotationTypeName)
      Matches members not annotated with a certain type of annotation.
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      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.
      Parameters:
      predicate - A predicate defining matching JavaAnnotations
      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.
      Parameters:
      predicate - A predicate defining matching JavaAnnotations
      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.
      Parameters:
      annotationType - Specific type of Annotation
      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.
      Parameters:
      annotationType - Specific type of Annotation
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areMetaAnnotatedWith

      @PublicAPI(usage=ACCESS) CONJUNCTION areMetaAnnotatedWith(String annotationTypeName)
      Matches members meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areNotMetaAnnotatedWith

      @PublicAPI(usage=ACCESS) CONJUNCTION areNotMetaAnnotatedWith(String annotationTypeName)
      Matches members not meta-annotated with a certain type of annotation. A meta-annotation is an annotation that is declared on another annotation.
      Parameters:
      annotationTypeName - Fully qualified class name of a specific type of Annotation
      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.
      Parameters:
      predicate - A predicate defining matching JavaAnnotations
      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.
      Parameters:
      predicate - A predicate defining matching JavaAnnotations
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areDeclaredIn

      @PublicAPI(usage=ACCESS) CONJUNCTION areDeclaredIn(Class<?> javaClass)
      Matches members declared within the supplied class.

      E.g. someField in
      
       class Example {
           Object someField;
       }
      will be matched by
      
       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

      @PublicAPI(usage=ACCESS) CONJUNCTION areNotDeclaredIn(Class<?> javaClass)
      Matches members not declared within the supplied class.

      E.g. someField in
      
       class Example {
           Object someField;
       }
      will not be matched by
      
       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

      @PublicAPI(usage=ACCESS) CONJUNCTION areDeclaredIn(String className)
      Matches members declared within a class of the supplied class name.

      E.g. someField in
      
       class Example {
           Object someField;
       }
      will be matched by
      
       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

      @PublicAPI(usage=ACCESS) CONJUNCTION areNotDeclaredIn(String className)
      Matches members not declared within a class of the supplied class name.

      E.g. someField in
      
       class Example {
           Object someField;
       }
      will not be matched by
      
       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. someField in
      
       class Example {
           Object someField;
       }
      will be matched by
      
       members().that().areDeclaredInClassesThat(areSubtypeOf(Object.class))
       
      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

      @PublicAPI(usage=ACCESS) ClassesThat<CONJUNCTION> areDeclaredInClassesThat()
      Allows to restrict the set of members under consideration by the class they are declared in

      E.g. someField in
      
       class Example {
           Object someField;
       }
      will be matched by
      
       members().that().areDeclaredInClassesThat().areAssignableTo(Object.class)
       
      Returns:
      A syntax element that allows restricting where members are declared in