> ## Documentation Index
> Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Frameworks

> List and retrieve EU regulatory frameworks with the Law4Devs Java SDK.

## Overview

Frameworks represent EU regulations such as GDPR, CRA, NIS2, and the AI Act. Use `client.frameworks()` to list and fetch them.

***

## Methods

### `list()`

Returns a page of all available frameworks.

```java theme={null}
Page<Framework> page = client.frameworks().list();

System.out.printf("Found %d frameworks%n", page.meta().total());
for (Framework fw : page.data()) {
    System.out.printf("  %-12s %s%n", fw.slug(), fw.name());
}
```

**Returns** `Page<Framework>`

***

### `list(int page, int perPage)`

Fetch a specific page with custom page size.

```java theme={null}
Page<Framework> page = client.frameworks().list(1, 5);
```

**Parameters**

| Parameter | Type  | Default | Description              |
| --------- | ----- | ------- | ------------------------ |
| `page`    | `int` | `1`     | Page number (1-indexed)  |
| `perPage` | `int` | `20`    | Items per page (max 100) |

**Returns** `Page<Framework>`

***

### `get()`

Fetch full detail for a single framework by slug.

```java theme={null}
FrameworkDetail cra = client.frameworks().get("cra");

System.out.println(cra.name());          // Cyber Resilience Act
System.out.println(cra.celexNumber());   // 32024R2847
System.out.println(cra.articleCount()); // number of synced articles
```

**Parameters**

| Parameter | Type     | Description                   |
| --------- | -------- | ----------------------------- |
| `slug`    | `String` | Framework slug, e.g. `"gdpr"` |

**Returns** `FrameworkDetail`

***

### `iter()`

Lazily iterate all frameworks across all pages.

```java theme={null}
for (Framework fw : client.frameworks().iter()) {
    System.out.println(fw.slug() + ": " + fw.name());
}
```

**Returns** `Iterable<Framework>`

***

## Models

### `Framework`

Returned by `list()` and `iter()`.

| Field            | Type      | Description                              |
| ---------------- | --------- | ---------------------------------------- |
| `id()`           | `int`     | Internal numeric ID                      |
| `slug()`         | `String`  | URL-safe identifier, e.g. `"cra"`        |
| `name()`         | `String`  | Full framework name                      |
| `shortName()`    | `String`  | Short name, e.g. `"CRA"`                 |
| `celexNumber()`  | `String`  | EUR-Lex CELEX identifier                 |
| `description()`  | `String`  | Brief description                        |
| `isActive()`     | `boolean` | Whether data is actively maintained      |
| `status()`       | `String`  | `"active"`, `"draft"`, or `"superseded"` |
| `articleCount()` | `int`     | Number of synced articles                |
| `recitalCount()` | `int`     | Number of synced recitals                |
| `createdAt()`    | `String`  | ISO 8601 creation timestamp              |

### `FrameworkDetail`

Returned by `get()`. Includes all `Framework` fields plus:

| Field                | Type     | Description                       |
| -------------------- | -------- | --------------------------------- |
| `eurLexUrl()`        | `String` | Link to the official EUR-Lex page |
| `requirementCount()` | `int`    | Number of extracted requirements  |
| `annexCount()`       | `int`    | Number of annexes                 |
| `tagCount()`         | `int`    | Number of associated tags         |

***

## Examples

### List all active frameworks

```java theme={null}
for (Framework fw : client.frameworks().iter()) {
    if (fw.isActive()) {
        System.out.printf("%-12s %s (%d articles)%n",
            fw.slug(), fw.name(), fw.articleCount());
    }
}
```

### Build a framework lookup map

```java theme={null}
var map = new java.util.LinkedHashMap<String, Framework>();
for (Framework fw : client.frameworks().iter()) {
    map.put(fw.slug(), fw);
}

Framework gdpr = map.get("gdpr");
System.out.println(gdpr.name()); // General Data Protection Regulation
```

### Print frameworks with full article coverage

```java theme={null}
var page = client.frameworks().list();
for (Framework fw : page.data()) {
    if (fw.expectedArticles() > 0 && fw.articleCount() >= fw.expectedArticles()) {
        System.out.println(fw.name() + " — fully synced");
    }
}
```
