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 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
.- Parameters:
predicate
- Restricts which classes the call should originate from. Every class that calls the respectiveJavaCodeUnit
must 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 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
.- 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 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
.- 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 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
.- 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
-