# Getting Started

Welcome to the project. This guide answers "I just joined the team — where do I start reading?" and gets you oriented in under ten minutes.

## What This Project Does

This repository is a **Java edge-case test harness**. It contains plain Java objects (POJOs) designed to exercise the limits of parsers, generators, and tooling that process entity metadata. The classes stress-test scenarios like entities with dozens of labeled fields, mixed Japanese and English comments, partially annotated structures, and multi-pattern tag delimiters.

## Recommended Reading Order

Read the wiki pages in this order to build your mental model incrementally:

1. [Repository Overview](../overview.md) — high-level architecture and module guide
2. [This Guide](./getting-started.md) — you are here
3. **`A.java`** — simplest file; a single empty class to verify tooling can locate bare classes
4. **`ProductService.java`** — minimal service with one field and a getter
5. **`OrderProcessor.java`** — the only class with actual behavior (`createOrder`); best entry point for understanding *what the code does*
6. **`MixedLabelClass.java`** — tests inconsistent labeling within one class
7. **`MultiPattern.java`** — tests multi-pattern tag recognition with `ANK-4494-00-00` delimiters
8. **`LargeFieldMap.java`** and **`LargeBusinessLabelClass.java`** — the largest entities; work through these last

## Key Entry Points

Start with these three classes:

| Class | Why it matters |
|---|---|
| [A.java](../p2-edge-cases/src/main/java/A.java) | Trivial placeholder — verifies that analysis tools can find and process a class with zero members |
| [ProductService.java](../p2-edge-cases/src/main/java/ProductService.java) | Shows the simplest data-holding pattern used across the codebase |
| [OrderProcessor.java](../p2-edge-cases/src/main/java/OrderProcessor.java) | The most behavior-rich class; `createOrder()` is the only method that does anything beyond store data |

The remaining classes are edge-case variants you will inspect once you understand the baseline patterns.

## Project Structure

```
p2-edge-cases/
  src/main/java/
    A.java                          -- empty placeholder class
    EucJpClass.java                 -- user/org status with Japanese labels
    LargeBusinessLabelClass.java    -- 49-field entity, all Japanese labels
    LargeFieldMap.java              -- service-IF data mapping, 10 fields
    MixedLabelClass.java            -- mixed labeled/unlabeled/English-only fields
    MultiPattern.java               -- ANK-4494-00-00 pattern-delimited fields
    OrderProcessor.java             -- order creation handler
    PartialLabelEntity.java         -- alternating labeled/unlabeled fields
    ProductService.java             -- minimal product data holder
```

The diagram below shows how the module and its classes relate:

```mermaid
flowchart TD
    Root["p2-edge-cases
Edge-case Java sources"]

    Root --> A["A.java
Empty placeholder class"]
    Root --> EP["EucJpClass.java
User/org status with Japanese labels"]
    Root --> LB["LargeBusinessLabelClass.java
49-field entity with Japanese labels"]
    Root --> LF["LargeFieldMap.java
Service IF data mapping entity"]
    Root --> ML["MixedLabelClass.java
Mixed labeled/unlabeled fields"]
    Root --> MP["MultiPattern.java
Multi-pattern annotation entity"]
    Root --> OP["OrderProcessor.java
Order creation handler"]
    Root --> PE["PartialLabelEntity.java
Partially labeled entity"]
    Root --> PS["ProductService.java
Product data holder"]
```

### Class-by-class quick reference

| File | Fields | Edge case it tests |
|---|---|---|
| `A.java` | 0 | Zero-member class discovery |
| `EucJpClass.java` | 3 | Japanese encoding / label locale |
| `LargeBusinessLabelClass.java` | 49 | Very wide entities with uniform Japanese labels |
| `LargeFieldMap.java` | 10 | Service-IF mapping entity with mixed naming conventions |
| `MixedLabelClass.java` | 3 | Inconsistent labeling within a single class |
| `MultiPattern.java` | 3 | Pattern-delimited groups (`ANK-4494-00-00 ADD START/END`) |
| `OrderProcessor.java` | 0 (behavior only) | Minimal business logic handler |
| `PartialLabelEntity.java` | 4 | Alternating labeled/unlabeled fields |
| `ProductService.java` | 1 | Simplest service pattern (getter-based access) |

## Configuration

This project has **no external configuration files**. There are no `pom.xml`, `build.gradle`, or application property files detected. The code is self-contained Java — no framework, no dependency injection, no runtime config.

If you encounter a build tool in the wider repository (e.g. Maven or Gradle at a higher level), the source layout follows standard **Maven conventions**:

| Convention | Location |
|---|---|
| Source root | `p2-edge-cases/src/main/java/` |
| Default package | No package declaration — all classes are in the default package |
| Encoding | UTF-8 (Japanese labels require proper terminal/editor support) |

## Common Patterns

The codebase is intentionally minimal. Every class follows one of these patterns:

### Pattern 1: Data holder with labeled fields

Most classes are plain POJOs — private `String` fields, each followed by an inline comment that serves as a label:

```java
public class EucJpClass {
    private String userId = ""; // ユーザーID
    private String orgCode = ""; // 組織コード
    private String statusDiv = ""; // 状態区分
}
```

The label comment is **the only metadata** — no annotations, no getters/setters. Tools scanning this codebase rely on the inline comment to extract field descriptions.

### Pattern 2: Partial labeling

Some classes deliberately leave fields unlabeled, testing how tooling handles gaps:

```java
public class PartialLabelEntity {
    private String labeledA = ""; // レベルA
    private String unlabeledB = "";
    private String labeledC = ""; // レベルC
    private String unlabeledD = "";
}
```

### Pattern 3: Pattern-delimited groups

`MultiPattern.java` uses comment-based tags to mark groups of fields, simulating how generated code often uses region markers:

```java
// ANK-4494-00-00 ADD START
private String keiNo = "";  // 契約番号
private String syoriDiv = "";  // 処理区分
// ANK-4494-00-00 ADD END
private String idoDiv = "";  // 移動区分
```

### Pattern 4: Simple accessor

`ProductService.java` shows the minimal accessor pattern — a private field with a single public getter:

```java
public class ProductService {
    private String productId = "";
    public String getProduct() { return productId; }
}
```

### Pattern 5: Business behavior

`OrderProcessor.java` is the only class with meaningful methods. It follows the simplest possible handler pattern:

```java
public String createOrder(String orderId) { return orderId; }
```

No validation, no persistence — just an identity operation. This mirrors real-world scaffolding where the handler signature is the contract and the body is filled in later.

## Quick checklist for your first day

- [ ] Read the [Repository Overview](../overview.md) for the full architecture
- [ ] Open `OrderProcessor.java` — scan the Javadoc and the single method
- [ ] Open `LargeBusinessLabelClass.java` — note how 49 fields all follow the same `private String fieldNN = ""` pattern
- [ ] Search for `ADD START` or `ADD END` in the codebase to find the multi-pattern tag convention
- [ ] Open `MixedLabelClass.java` — verify that you can spot which fields are labeled and which are not
