# Business Logic — FUW07101SF02DBean.clearListDataInstance() [14 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW07101SF.FUW07101SF02DBean` |
| Layer | View (Web Client D-Bean / Data Transfer Bean) |
| Module | `FUW07101SF` (Package: `eo.web.webview.FUW07101SF`) |

## 1. Role

### FUW07101SF02DBean.clearListDataInstance()

This method is a **display-data cleanup utility** that clears the contents of application-related list fields stored within a view-tier data bean. It is part of the Fuji Futurity X33 web framework's D-Bean (Display Bean) layer, which serves as a data transfer object between the presentation tier (JSF views) and the business logic tier. In the context of this telecom order management system, "application order" (申込, Shoushin) refers to customer service orders submitted through the web interface. The method implements a **key-based dispatch pattern** — it inspects the incoming `key` parameter to determine which of two display list fields should be cleared. It is a **shared view-layer utility** used by many D-Bean subclasses throughout the FUW07101SF module and other modules (e.g., FUW00901SF, FUW00912SF, FUW00916SF, etc.), which either override the method to add their own list-clearing logic or simply delegate to `super.clearListDataInstance(key)`. This method plays a critical role in **form state management**: before a screen reloads or re-renders, this method is called to ensure stale list data from a previous request does not leak into the current view.

The method handles **two business list categories**:
- **"申込台数名リスト" (Application Order Count Name List)** — a list of display names (labels) for order count entries, stored in `nm_list_list` (`X33VDataTypeList`).
- **"申込台数値リスト" (Application Order Count Value List)** — a list of corresponding numeric values for order count entries, stored in `val_list_list` (`X33VDataTypeList`).

Both lists work as a paired select-item structure (name/value pairs for dropdowns or radio buttons).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])
    CHECK_NULL{"key != null"}

    CHECK_NULL -- true --> MATCH_NM{"key equals \"申込台数名リスト\""}

    MATCH_NM -- true --> CLEAR_NM["nm_list_list.clear()"]

    MATCH_NM -- false --> MATCH_VAL{"key equals \"申込台数値リスト\""}

    MATCH_VAL -- true --> CLEAR_VAL["val_list_list.clear()"]

    MATCH_VAL -- false --> END_NODE(["Return / Next"])

    CHECK_NULL -- false --> END_NODE

    CLEAR_NM --> END_NODE
    CLEAR_VAL --> END_NODE

    START --> CHECK_NULL
```

**Description of the processing flow:**
1. The method receives a string `key` identifying which list type to clear.
2. It first checks whether `key` is non-null (defensive programming — prevents NullPointerException).
3. If `key` is not null, it compares the key against two hardcoded Japanese string literals:
   - **"申込台数名リスト"** (Application Order Count Name List) — if matched, clears the `nm_list_list` field.
   - **"申込台数値リスト"** (Application Order Count Value List) — if matched, clears the `val_list_list` field.
4. If `key` is null, or if `key` does not match either string, the method returns silently with no effect.

There are no constant references in this method — the list identifiers are hardcoded as Japanese string literals, which is consistent with the naming convention used throughout the X33 framework (where Japanese labels serve as internal list identifiers).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | A list identifier that specifies which display data list to clear. Accepts two possible values: `"申込台数名リスト"` (the name/label list for application order counts) or `"申込台数値リスト"` (the value list for application order counts). An empty string or null causes the method to exit without action. |

**Instance fields / external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `nm_list_list` | `X33VDataTypeList` | The name list for application order counts — contains display labels (e.g., "1台目", "2台目" — "Unit 1", "Unit 2") used in UI select/radio components. Cleared when `key` equals `"申込台数名リスト"`. |
| `val_list_list` | `X33VDataTypeList` | The value list for application order counts — contains the corresponding data values paired with the name list. Cleared when `key` equals `"申込台数値リスト"`. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `nm_list_list.clear` | (in-memory) | (none) | Clears the `nm_list_list` `X33VDataTypeList` instance — no database or external SC involved. |
| - | `val_list_list.clear` | (in-memory) | (none) | Clears the `val_list_list` `X33VDataTypeList` instance — no database or external SC involved. |

This method performs **pure in-memory list clearing** with no database reads, writes, or external service component (SC) / component business method (CBS) calls. The `X33VDataTypeList` is a framework-provided collection class that wraps list data for the X33 view layer.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Module: FUW07101SF | `FUW07101SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 2 | Module: FUW00901SF | `FUW00901SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 3 | Module: FUW00907SF | `FUW00907SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 4 | Module: FUW00912SF | `FUW00912SF01DBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 5 | Module: FUW00916SF | `FUW00916SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 6 | Module: FUW00917SF | `FUW00917SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 7 | Module: FUW00919SF | `FUW00919SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 8 | Module: FUW00926SF | `FUW00926SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 9 | Module: FUW00927SF | `FUW00927SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 10 | Module: FUW00931SF | `FUW00931SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 11 | Module: FUW00945SF | `FUW00945SF01DBean` defines its own `clearListDataInstance` (does not call super) | (none — in-memory only) |
| 12 | Module: FUW00946SF | `FUW00946SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 13 | Module: FUW00947SF | `FUW00947SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 14 | Module: FUW00957SF | `FUW00957SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 15 | Module: FUW00959SF | `FUW00959SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 16 | Module: FUW00961SF | `FUW00961SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |
| 17 | Module: FUW00964SF | `FUW00964SFBean.clearListDataInstance(key)` → `super.clearListDataInstance(key)` → `FUW07101SF02DBean.clearListDataInstance(key)` | (none — in-memory only) |

**Note:** The method is inherited across 20+ D-Bean classes via the X33 framework's class hierarchy. Callers typically invoke it during screen initialization, form reset, or before repopulating dropdown lists with fresh data. Some modules (e.g., FUW00945SF) override the method entirely without calling `super`, effectively shadowing this base implementation.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key != null)` (L486)

> Defensive null check. If `key` is null, the entire method body is skipped, returning immediately without any side effects. This prevents `NullPointerException` on the subsequent `equals()` calls.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `if (key != null)` — null safety gate; if null, exit method silently (L486) |

**Block 1.1** — [IF-ELSE-IF] `key.equals("申込台数名リスト")` / `key.equals("申込台数値リスト")` (L489)

> Key-based dispatch: identifies which of two paired display lists should be cleared. The Japanese strings serve as internal list type identifiers within the X33 framework.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key.equals("申込台数名リスト"))` — branch to clear the name list; "申込台数名リスト" = Application Order Count Name List (L489) |
| 2 | EXEC | `nm_list_list.clear()` — clears all elements from the `nm_list_list` X33VDataTypeList (L491) |
| 3 | ELSE-IF | `else if (key.equals("申込台数値リスト"))` — branch to clear the value list; "申込台数値リスト" = Application Order Count Value List (L493) |
| 4 | EXEC | `val_list_list.clear()` — clears all elements from the `val_list_list` X33VDataTypeList (L493) |
| 5 | ELSE | (implicit) — if `key` does not match either identifier, do nothing and proceed to return (L489–L494) |

**Block 2** — [RETURN] (L494)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` — void method, returns to caller (implicit return at end of method body) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `nm_list_list` | Field | Name list list — an `X33VDataTypeList` containing display labels (human-readable names) for application order count entries. Used as the text portion of select/radio UI components. |
| `val_list_list` | Field | Value list list — an `X33VDataTypeList` containing the corresponding data values paired with `nm_list_list`. Each value at index `i` corresponds to the name at index `i` in `nm_list_list`. |
| `"申込台数名リスト"` | Literal | Application Order Count Name List — Japanese string used as the key/identifier to specify which list to clear. "申込" (Shoushin) = application/order submission; "台数" (Taisuu) = quantity/count; "名" (Mei) = name; "リスト" (Risuto) = list. |
| `"申込台数値リスト"` | Literal | Application Order Count Value List — Japanese string used as the key/identifier. "値" (Chi) = value, distinguishing it from the name list. |
| X33VDataTypeList | Framework class | Fujitsu Futurity X33 framework's typed list wrapper. Holds a collection of `X33VDataType*Bean` objects and provides list operations like `clear()`, `get()`, `size()`, `add()`. |
| D-Bean | Architecture term | Display Bean — a data transfer object in the X33 MVC framework that holds form data between the view layer (JSF pages) and the logic layer. The "02D" suffix in `FUW07101SF02DBean` indicates this is a secondary display bean (subclass of a main bean). |
| Shoushin (申込) | Business term | Application order / service order submission — the core business operation in this telecom system where customers submit requests for services (e.g., FTTH installation, mail changes). |
| Taisuu (台数) | Business term | Quantity / count — refers to the number of units or lines in a service order (e.g., "1台目" = first unit, "2台目" = second unit). |
| FUW | Module prefix | Fujitsu Utility Web — the module naming convention for web client presentation-layer components. |
| X33SException | Framework exception | Exception class from the Fuji Futurity X33 framework, thrown for view-layer business rule violations. |
