# Getting Started

I just joined the team — where do I start reading?

## What This Project Does

This repository contains a lightweight Java library for managing text headers and file metadata. It provides classes representing different header models — from simple no-header cases to complex, multi-line header structures — and utilities for cross-referencing and license compliance. With only six source files and no external dependencies, the codebase is designed to be easy to audit and straightforward to extend.

## Recommended Reading Order

Follow this order to build a mental model of the codebase from simple to complex:

1. **[NoHeader](src/main/java/NoHeader.java)** — The smallest class. Read it first to understand the baseline concept of content with no header.
2. **[MitLicense](src/main/java/MitLicense.java)** — A quick scan confirms the MIT open-source license and distribution terms.
3. **[WithHeader](src/main/java/WithHeader.java)** — Introduces associating a header with content.
4. **[PartialHeader](src/main/java/PartialHeader.java)** — Shows how the project handles incomplete or transitional header states.
5. **[Crosslink](src/main/java/Crosslink.java)** — A small utility that may link header objects or track references between them.
6. **[LongHeader](src/main/java/LongHeader.java)** — The core of the project. At ~260 lines, it contains the most substantial logic for header parsing, formatting, or transformation. Read last, as it builds on patterns introduced by the smaller classes.

```
NoHeader → MitLicense → WithHeader → PartialHeader → Crosslink → LongHeader
```

## Key Entry Points

This project is structured as a **library**, not a standalone application — there is no `main` method or CLI entry point. Consumers import and compose these classes as needed.

| Class | Lines | Why it matters |
|---|---|---|
| [**LongHeader**](src/main/java/LongHeader.java) | ~260 | The most complex class. Handles multi-line / extended header content, likely with parsing and formatting logic. |
| [**WithHeader**](src/main/java/WithHeader.java) | ~8 | Core abstraction: associating a header with a payload or body. |
| [**NoHeader**](src/main/java/NoHeader.java) | ~2 | Simplest class — serves as a baseline marker for content without headers. |
| [**PartialHeader**](src/main/java/PartialHeader.java) | ~8 | Represents an incomplete or fallback header state. |
| [**Crosslink**](src/main/java/Crosslink.java) | ~8 | Utility for cross-referencing between headers or code elements. |
| [**MitLicense**](src/main/java/MitLicense.java) | ~2 | Bundled MIT License text for legal compliance in distributions. |

## Project Structure

The repository has a flat layout with a single module and no package declarations:

```mermaid
flowchart LR
    repo["Repository"] --> src["src/main/java/"]
    src --> noh["NoHeader.java"]
    src --> mit["MitLicense.java"]
    src --> withh["WithHeader.java"]
    src --> parth["PartialHeader.java"]
    src --> cross["Crosslink.java"]
    src --> longh["LongHeader.java"]
```

| Path | Description |
|---|---|
| `src/main/java/` | All six Java source files live at the top level — no packages, no sub-modules. |
| `.codewiki/` | Generated wiki documentation (overview, guides, tree index). |

## Configuration

This project has **no build configuration files** (no `pom.xml`, `build.gradle`, or `settings.gradle` detected). It is a dependency-free library, so there are no build tool settings to configure.

| File | Purpose |
|---|---|
| `src/main/java/MitLicense.java` | Contains the MIT License text; the only configuration-like artifact. |

## Common Patterns

- **Independent data types** — Each class is self-contained with no deep inheritance. They are designed to be composed by consumers rather than extended through polymorphism.
- **Small, focused classes** — Most classes are under 10 lines. Complexity is centralized in `LongHeader.java`, while simple cases use dedicated types like `NoHeader` and `WithHeader`.
- **No external dependencies** — The library uses only the Java standard library. You can read any file without needing to understand framework-specific conventions.
- **MIT licensed** — Code can be freely used, modified, and distributed under the terms in [MitLicense](src/main/java/MitLicense.java).
