# Business Logic — KKW00401SF02DBean.clearListDataInstance() [26 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00401SF.KKW00401SF02DBean` |
| Layer | Controller / Web Bean (DTO) |
| Module | `KKW00401SF` (Package: `eo.web.webview.KKW00401SF`) |

## 1. Role

### KKW00401SF02DBean.clearListDataInstance()

This method is a **data initialization utility** that clears (empties) a specific `X33VDataTypeList` field on the `KKW00401SF02DBean` DTO class, based on a string key representing a **data-type view item name** (データタイプビュー項目). The key maps to a **STB (Set-Top Box) related dropdown/selection component** on the web screen — specifically, it targets fields that manage STB activation migration classification, selection-type number, STB classification, HDD capacity, and TV course lists.

The method implements a **dispatch/routing pattern**: it inspects the `key` parameter and dispatches to one of five list-clearing branches, each corresponding to a specific screen-bound data-type list field. This is a shared utility called by many screen beans (all `FUW009xxxSF` screen beans that extend this class) to reset form state — for example, when re-displaying a screen with clean dropdown values or when the user navigates between tabs that share the same STB data-type bean.

The method plays a **reusable bean lifecycle role** in the X33 framework: every data-type DTO bean that participates in repeat-indicated list components (繰り返し指定項目) must implement `clearListDataInstance` so the framework can properly reset list-bound fields during screen initialization, validation retry, or navigation. This specific bean (`KKW00401SF02DBean`) handles **STB modification request information** (STB変更申告情報) — the set of dropdowns and selection lists that appear on the STB contract change screen.

There are no external service calls, database operations, or business rule evaluations in this method — it is a pure data-clearing utility.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])
    CHECK_NULL{"key != null?"}
    CHECK_STB_IDO{"key == \"STB異動区分\""}
    CLEAR_STB_IDO["stb_ido_div_list.clear()"]
    CHECK_SEL_TYPE{"key == \"選択型番号\""}
    CLEAR_SEL_TYPE["sel_type_number_list.clear()"]
    CHECK_STB_DIV{"key == \"STB区分\""}
    CLEAR_STB_DIV["stb_div_list.clear()"]
    CHECK_HDD{"key == \"HDD容量\""}
    CLEAR_HDD["hdd_capa_list.clear()"]
    CHECK_TV{"key == \"TVコース\""}
    CLEAR_TV["tv_course_list.clear()"]
    NO_MATCH["No matching list — no-op"]
    END_NODE(["Return"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| CHECK_STB_IDO
    CHECK_NULL -->|false| NO_MATCH
    CHECK_STB_IDO -->|true| CLEAR_STB_IDO
    CHECK_STB_IDO -->|false| CHECK_SEL_TYPE
    CLEAR_STB_IDO --> CHECK_SEL_TYPE
    CHECK_SEL_TYPE -->|true| CLEAR_SEL_TYPE
    CHECK_SEL_TYPE -->|false| CHECK_STB_DIV
    CLEAR_SEL_TYPE --> CHECK_STB_DIV
    CHECK_STB_DIV -->|true| CLEAR_STB_DIV
    CHECK_STB_DIV -->|false| CHECK_HDD
    CLEAR_STB_DIV --> CHECK_HDD
    CHECK_HDD -->|true| CLEAR_HDD
    CHECK_HDD -->|false| CHECK_TV
    CLEAR_HDD --> CHECK_TV
    CHECK_TV -->|true| CLEAR_TV
    CHECK_TV -->|false| NO_MATCH
    CLEAR_TV --> END_NODE
    NO_MATCH --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **data-type view item name** (データタイプビュー項目) that identifies which list field to clear. This is a human-readable Japanese label displayed on the screen's dropdown/selection component. Each value corresponds to a specific STB (Set-Top Box) contract modification screen field. |

**Values `key` can take and their effects:**

| Key Value (Japanese) | Item ID (内部項目ID) | Target List Field | Business Meaning |
|----------------------|---------------------|-------------------|------------------|
| `STB異動区分` | `stb_ido_div` | `stb_ido_div_list` | STB Activation Migration Classification — whether the STB is being activated for the first time, transferred, or replaced |
| `選択型番号` | `sel_type_number` | `sel_type_number_list` | Selection-Type Number — a numbered list of selectable STB model numbers |
| `STB区分` | `stb_div` | `stb_div_list` | STB Classification — the type/category of STB device (e.g., standard, premium) |
| `HDD容量` | `hdd_capa` | `hdd_capa_list` | HDD Capacity — storage capacity options for STB models with recording capability |
| `TVコース` | `tv_course` | `tv_course_list` | TV Course — subscription TV package/channel lineup selections |

**Instance fields read by this method:**

| Field | Type | Role |
|-------|------|------|
| `stb_ido_div_list` | `X33VDataTypeList` | List of items for STB activation migration classification dropdown |
| `sel_type_number_list` | `X33VDataTypeList` | List of items for selection-type number dropdown |
| `stb_div_list` | `X33VDataTypeList` | List of items for STB classification dropdown |
| `hdd_capa_list` | `X33VDataTypeList` | List of items for HDD capacity dropdown |
| `tv_course_list` | `X33VDataTypeList` | List of items for TV course selection dropdown |

## 4. CRUD Operations / Called Services

This method performs **pure in-memory list clearing** — it calls `X33VDataTypeList.clear()` on five local instance fields. There are no external service component (SC) calls, CBS calls, or database operations.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | - | - | Calls `clear()` on local list fields (`stb_ido_div_list`, `sel_type_number_list`, `stb_div_list`, `hdd_capa_list`, `tv_course_list`) — pure in-memory clearing, no persistence |

## 5. Dependency Trace

This method is **inherited as part of a data-type bean hierarchy**. It is defined on `KKW00401SF02DBean` and called via `super.clearListDataInstance(key)` by screen beans that extend it (e.g., `KKW00401SFBean`). All callers use the pattern `super.clearListDataInstance(key)` to dispatch to this parent implementation.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen: FUW00901SF | `FUW00901SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 2 | Screen: FUW00902SF | `FUW00902SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 3 | Screen: FUW00903SF | `FUW00903SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 4 | Screen: FUW00907SF | `FUW00907SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 5 | Screen: FUW00908SF | `FUW00908SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 6 | Screen: FUW00909SF | `FUW00909SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 7 | Screen: FUW00912SF | `FUW00912SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 8 | Screen: FUW00913SF | `FUW00913SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 9 | Screen: FUW00914SF | `FUW00914SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 10 | Screen: FUW00915SF | `FUW00915SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 11 | Screen: FUW00916SF | `FUW00916SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 12 | Screen: FUW00917SF | `FUW00917SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 13 | Screen: FUW00918SF | `FUW00918SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 14 | Screen: FUW00919SF | `FUW00919SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |
| 15 | Screen: FUW00921SF | `FUW00921SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` -> `KKW00401SF02DBean.clearListDataInstance(key)` | In-memory list clear only |

**Other `KKW00401SF` sibling beans** that also override `clearListDataInstance` (each adds their own list-clearing branches before calling `super.clearListDataInstance(key)`):
- `KKW00401SF01DBean` — clears code-type code-value lists and code-type name lists
- `KKW00401SF09DBean` — clears its own data-type lists
- `KKW00401SF23DBean` — clears its own data-type lists
- `KKW00401SF25DBean` — clears its own data-type lists

The parent `KKW00401SFBean` aggregates all sibling beans' lists and also delegates to `super.clearListDataInstance(key)`.

## 6. Per-Branch Detail Blocks

> Each branch of the control flow is displayed as a hierarchical block structure.

**Block 1** — IF `(key != null)` (L4092)

> Guard against null key. If the key is null, skip all processing — this allows callers to safely pass potentially-uninitialized keys without triggering a NullPointerException.

| # | Type | Code |
|---|------|------|
| 1 | SET | `// Enter block only if key is non-null` |

**Block 1.1** — IF `(key.equals("STB異動区分")) [STB異動区分="STB Activation Migration Classification"] (L4096)`

> Clear the STB activation migration classification list — used for dropdown items indicating whether the STB is being activated, transferred, or replaced.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `stb_ido_div_list.clear();` // Clear all items from the STB migration classification list |

**Block 1.2** — ELSE-IF `(key.equals("選択型番号")) [選択型番号="Selection-Type Number"] (L4099)`

> Clear the selection-type number list — used for dropdown items listing selectable STB model numbers.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `sel_type_number_list.clear();` // Clear all items from the selection-type number list |

**Block 1.3** — ELSE-IF `(key.equals("STB区分")) [STB区分="STB Classification"] (L4102)`

> Clear the STB classification list — used for dropdown items categorizing the type of STB device (e.g., standard, premium).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `stb_div_list.clear();` // Clear all items from the STB classification list |

**Block 1.4** — ELSE-IF `(key.equals("HDD容量")) [HDD容量="HDD Capacity"] (L4105)`

> Clear the HDD capacity list — used for dropdown items specifying storage capacity options for STB models with recording capability.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `hdd_capa_list.clear();` // Clear all items from the HDD capacity list |

**Block 1.5** — ELSE-IF `(key.equals("TVコース")) [TVコース="TV Course"] (L4108)`

> Clear the TV course list — used for dropdown items representing subscription TV package/channel lineup selections.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `tv_course_list.clear();` // Clear all items from the TV course list |

**Block 2** — ELSE-ELSE-ELSE-ELSE-ELSE `(No matching key)` (L4111)

> None of the known data-type view item names matched — this is a no-op. The method implicitly returns without clearing any list. This handles the case where a caller passes an unrecognized key (e.g., a common-information-view list prefix starting with `//` which is handled by the parent bean class).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `// No matching list — implicit no-op` |

**Block 3** — END `(key == null)` (L4092)

> The key was null — skip all processing entirely.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | (implicit) `return;` // Exit method — nothing to clear |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `STB` | Acronym | Set-Top Box — a hardware device that receives and decodes digital television/broadband signals for subscriber viewing |
| `STB異動区分` (stb_ido_div) | Field | STB Activation Migration Classification — indicates the type of STB status change: initial activation, transfer between accounts, or replacement |
| `選択型番号` (sel_type_number) | Field | Selection-Type Number — a list of selectable STB model/serial number identifiers presented to the user for contract selection |
| `STB区分` (stb_div) | Field | STB Classification — the category/type of the STB device (e.g., standard vs. premium, recording-enabled vs. non-recording) |
| `HDD容量` (hdd_capa) | Field | HDD Capacity — storage capacity options (e.g., 500GB, 1TB) for STB models equipped with digital video recording capability |
| `TVコース` (tv_course) | Field | TV Course — subscription TV package/channel lineup selections offered to the subscriber (e.g., basic, premium, sports bundle) |
| `データタイプビュー項目` | Japanese term | Data-Type View Item — an X33 framework concept for a screen component that displays a typed list of selectable items (e.g., dropdown, radio group, checkbox list) |
| `X33VDataTypeList` | Technical | A Fujitsu Futurity X33 framework class representing a typed list of data beans, used for screen-bound selection component data |
| `X33VListedBeanInterface` | Technical | X33 framework interface for beans that contain repeat-indicated list data on a screen |
| `KKW00401SF` | Module ID | Screen module code for STB contract change/modification operations (the `SF` suffix typically denotes a service/function screen) |
| `KKW00401SF02DBean` | Class | Data-type DTO bean for STB modification request information — holds the list data for STB-related dropdown/selection fields on the contract change screen |
| FUW009xxxSF | Screen prefix | FUW-series screen beans — the web screen bean hierarchy that extends the KKW00401SF data-type beans for specific screen layouts and user workflows |
| X33SException | Technical | Fujitsu Futurity X33 framework checked exception for screen-level errors (validation failures, business rule violations, etc.) |
