> For the complete documentation index, see [llms.txt](https://proxetta.jodd.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://proxetta.jodd.org/pointcuts.md).

# Pointcuts

**Proxetta** pointcuts are defined in pure Java. Pointcut is defined by simple functional interface: `ProxyPointcut#apply()` that should return `true` if target method is a pointcut and if proxy should be applied on it. Since pointcut applying is done in pure Java, user may define pointcuts in various proprietary ways.

The following example shows the definition of a pointcut on all methods that are marked with custom annotation: `@Log`.

```java
ProxyPointcut pointcut = MethodWithAnnotationPointcut.of(Log.class);
```

You can combine `ProxyPointcut` definitions using `and()` and `or()`, for example:

```java
ProxyPointcut pointcut = ((ProxyPointcut)
            methodInfo -> methodInfo.isPublicMethod()
            && methodInfo.isTopLevelMethod())
        .and(MethodWithAnnotationPointcut.of(Log.class));
```

`MethodInfo` argument provides various information about the target method: class name and signature, method name, number of arguments, access flag, return type... It also returns `ClassInfo` and `AnnotationInfo`: additional class and annotation information. All this information may be use to define on which methods to apply a proxy. And since all this information is stored as simple types and Strings, pointcut definition becomes easy, but powerful - all in plan Java.

When scanning classes for pointcuts, *Proxetta* examines all methods of target class and of all its superclasses, up to the `Object`. Final methods are ignored, since they can't be overridden. Moreover, only public methods of superclasses are available for proxyfication if not overridden. {: .attn}

All class and method information is available as strings (due to bytecode manipulation).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://proxetta.jodd.org/pointcuts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
