Interface OnlyBeCalledSpecification<CONJUNCTION>
-
Method Summary
Modifier and TypeMethodDescriptionbyClassesThat(DescribedPredicate<? super JavaClass> predicate) Restricts allowed origins of calls to classes matching the suppliedDescribedPredicate.byCodeUnitsThat(DescribedPredicate<? super JavaCodeUnit> predicate) Restricts allowed origins of calls to code units matching the suppliedDescribedPredicate.byConstructorsThat(DescribedPredicate<? super JavaConstructor> predicate) Restricts allowed origins of calls to constructors matching the suppliedDescribedPredicate.byMethodsThat(DescribedPredicate<? super JavaMethod> predicate) Restricts allowed origins of calls to methods matching the suppliedDescribedPredicate.
-
Method Details
-
byClassesThat
Restricts allowed origins of calls to classes matching the suppliedDescribedPredicate.
Note that many predefinedpredicatescan 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- Restricts which classes the call should originate from. Every class that calls the respectiveJavaCodeUnitmust match the predicate.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
byClassesThat
- Returns:
- A syntax element that allows restricting which classes the call should be from
-
byCodeUnitsThat
@PublicAPI(usage=ACCESS) CONJUNCTION byCodeUnitsThat(DescribedPredicate<? super JavaCodeUnit> predicate) Restricts allowed origins of calls to code units matching the suppliedDescribedPredicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaCodeUnitcan be found withinJavaCodeUnit.Predicatesor one of the respective ancestors likeJavaMember.Predicates.- Parameters:
predicate- Restricts which code units the call should originate from- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
byMethodsThat
@PublicAPI(usage=ACCESS) CONJUNCTION byMethodsThat(DescribedPredicate<? super JavaMethod> predicate) Restricts allowed origins of calls to methods matching the suppliedDescribedPredicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaMethodcan be found withinJavaCodeUnit.Predicatesor one of the respective ancestors likeJavaMember.Predicates.- Parameters:
predicate- Restricts which methods the call should originate from. Calls from constructors are treated as mismatch.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
byConstructorsThat
@PublicAPI(usage=ACCESS) CONJUNCTION byConstructorsThat(DescribedPredicate<? super JavaConstructor> predicate) Restricts allowed origins of calls to constructors matching the suppliedDescribedPredicate.
Note that many predefinedpredicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaConstructorcan be found withinJavaCodeUnit.Predicatesor one of the respective ancestors likeJavaMember.Predicates.- Parameters:
predicate- Restricts which constructors the call should originate from. Calls from methods are treated as mismatch.- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-