# Business Logic — KKW22301SF03DBean.clearListDataInstance() [18 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22301SF.KKW22301SF03DBean` |
| Layer | Controller / View Data Bean (webview) |
| Module | `KKW22301SF` (Package: `eo.web.webview.KKW22301SF`) |

## 1. Role

### KKW22301SF03DBean.clearListDataInstance()

This method provides a centralized utility for clearing (emptying) specific typed lists used as dropdown or selectable item sources in the KKW22301SF screen module — a customer contract order entry/viewing interface operated by K-Opticom's fiber-optic broadband service agents. The method follows a **dispatch/routing pattern**: it receives a string key identifying which list should be cleared and branches to the appropriate field-clearing operation, enabling the calling screen to reset dropdown data at runtime without needing direct field access. It handles three distinct list categories — code lists (code classifications), code name lists (code labels), and name lists (naming entries) — which correspond to the three `X33VDataTypeList` instance fields on the bean. The method plays the role of a **shared screen-state reset utility**, allowing parent beans (e.g., `KKW22301SFBean`) and subclasses to delegate list-clearing logic through a single, key-based entry point. It also participates in a **delegation chain**: the parent bean overrides this method to add its own list-clearing branches and then calls `super.clearListDataInstance(key)` to pass through to this implementation, forming a classic template-method-style extension pattern.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])
    CHECK_NULL{"key != null?"}
    CHECK_BRANCH1{"key equals"}
    CLEAR_CD["cd_div_list_list.clear()"]
    CLEAR_CD_NM["cd_div_nm_list_list.clear()"]
    CLEAR_NM["nm_list_list.clear()"]
    END_NODE(["Return / Next"])

    START --> CHECK_NULL
    CHECK_NULL -->|"Yes"| CHECK_BRANCH1
    CHECK_NULL -->|"No"| END_NODE

    subgraph Branches
    CHECK_BRANCH1 -->|"コードリスト"| CLEAR_CD
    CHECK_BRANCH1 -->|"コード名リスト"| CLEAR_CD_NM
    CHECK_BRANCH1 -->|"名称リスト"| CLEAR_NM
    end

    CLEAR_CD --> END_NODE
    CLEAR_CD_NM --> END_NODE
    CLEAR_NM --> END_NODE
```

**CRITICAL — Constant Resolution:**
The branching conditions use literal Japanese strings (no constant files referenced). The resolved values are:

| Branch | Condition Value | Business Meaning |
|--------|----------------|------------------|
| Branch 1 | `コードリスト` | Code List — holds classification codes for UI dropdown selectors (item ID: `cd_div_list`) |
| Branch 2 | `コード名リスト` | Code Name List — holds human-readable labels corresponding to each code (item ID: `cd_div_nm_list`) |
| Branch 3 | `名称リスト` | Name List — holds name entries for display (item ID: `nm_list`) |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The list identifier that determines which `X33VDataTypeList` field should be cleared. Valid values are `"コードリスト"` (code list), `"コード名リスト"` (code name list), or `"名称リスト"` (name list). If the value does not match any branch or is `null`, the method performs no action. |

**Instance fields accessed by this method:**

| Field | Type | Access | Business Description |
|-------|------|--------|---------------------|
| `cd_div_list_list` | `X33VDataTypeList` | Write (clear) | Code classification list — internal tracking data for UI dropdown code values |
| `cd_div_nm_list_list` | `X33VDataTypeList` | Write (clear) | Code name list — human-readable label entries for each code value |
| `nm_list_list` | `X33VDataTypeList` | Write (clear) | Name list — name entries used in UI display |

## 4. CRUD Operations / Called Services

This method performs **in-memory list clearing** only. It does not invoke any external services, SC components, or CBS calls. The `clear()` method called on `X33VDataTypeList` is a standard Java `List` operation.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | - | - (in-memory) | Calls `clear()` on `X33VDataTypeList` instance — empties the list in memory, no DB interaction |

## 5. Dependency Trace

No callers directly invoke `KKW22301SF03DBean.clearListDataInstance(String)` from outside the class. The method is part of a protected/overridable API surface intended to be called through the parent bean. The parent class `KKW22301SFBean` overrides this method to add its own branches and then delegates to `super.clearListDataInstance(key)`, making this a **sub-component of a larger parent-level dispatch**.

The table below shows the call chain through the parent bean:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW22301SF | `KKW22301SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW22301SF03DBean.clearListDataInstance(key)` | `X33VDataTypeList.clear [U] (in-memory)` |

**Other module beans** also define `clearListDataInstance(String)` as an override of a shared parent class, following the same pattern (call their own branches, then `super.clearListDataInstance(key)`). Examples include:
- `FUW00912SFBean`, `FUW00926SFBean`, `FUW00959SFBean`, `FUW00964SFBean` series
- `FUW00927SFBean`, `FUW00901SFBean`, `FUW00919SFBean`, `FUW00931SFBean`
- `FUW00917SFBean`, `FUW00907SFBean`, `FUW00957SFBean`

These are distinct beans in unrelated modules and do not call into `KKW22301SF03DBean`.

## 6. Per-Branch Detail Blocks

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

> Null guard: prevents NullPointerException if key is not provided. If key is null, the method returns immediately without any side effects.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `if (key != null)` // Null guard before branching |
| 2 | SET | (no action) |

**Block 1.1** — [IF-ELSE-IF/ELSE-IF/ELSE-IF] `(key.equals("コードリスト") / "コード名リスト" / "名称リスト")` (L622–L631)

> Dispatch/routing: determines which of the three list fields to clear based on the business key value. Each branch clears exactly one field and returns.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("コードリスト")` // [CODE LIST — code classification values for dropdown] |
| 2 | EXEC | `cd_div_list_list.clear()` // Clears the code list in memory [-> Item ID: cd_div_list] |
| 3 | CHECK | `key.equals("コード名リスト")` // [CODE NAME LIST — code label entries for dropdown] |
| 4 | EXEC | `cd_div_nm_list_list.clear()` // Clears the code name list in memory [-> Item ID: cd_div_nm_list] |
| 5 | CHECK | `key.equals("名称リスト")` // [NAME LIST — name entries for display] |
| 6 | EXEC | `nm_list_list.clear()` // Clears the name list in memory [-> Item ID: nm_list] |

**Block 1.2** — [ELSE, implicit] `(key matches none)` (L631–)

> If key is not null but does not match any of the three known list identifiers, the method performs no operation and returns. This is intentional — unsupported keys are silently ignored rather than throwing an exception.

| # | Type | Code |
|---|------|------|
| 1 | - | (no code — fall-through, implicit no-op) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `cd_div_list` | Field (Item ID) | Code division list — the internal identifier for the code classification list field |
| `cd_div_nm_list` | Field (Item ID) | Code division name list — the internal identifier for the code name (label) list field |
| `nm_list` | Field (Item ID) | Name list — the internal identifier for the name entries list field |
| `コードリスト` | Term | Code List — Japanese label for the code classification list; holds raw code values used as dropdown options |
| `コード名リスト` | Term | Code Name List — Japanese label for the code name list; holds human-readable labels corresponding to each code |
| `名称リスト` | Term | Name List — Japanese label for the name list; holds name entries for display in the UI |
| `X33VDataTypeList` | Type | Fujitsu Futurity X33 framework data type — a typed list collection used to hold UI view data beans |
| `DBean` | Term | Data Bean — a view-layer data container class in the X33 web framework that holds screen state and presentation data |
| `KKW22301SF` | Module | Customer Contract Order screen module — the SF (Service Form) module handling customer contract order entry and viewing for K-Opticom fiber services |
| `X33SException` | Type | X33 framework service exception — the standard exception type thrown by X33 web application service components |
| K-Opticom | Business term | KDDI's fiber-optic broadband brand — the telecom service operator whose order management system this belongs to |
