---

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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW05501SF.KKW05501SF01DBean` |
| Layer | Service Component (SC) / Web Bean — Data binding layer in the X33 MVC framework |
| Module | `KKW05501SF` (Package: `eo.web.webview.KKW05501SF`) |

## 1. Role

### KKW05501SF01DBean.clearListDataInstance()

This method is a **data reset utility** within the KKW05501SF service screen bean. It selectively clears (empties) one of three `X33VDataTypeList` instances that hold display data for dropdown/select components on the service screen. It implements a **conditional dispatch pattern** based on a string key that identifies which list to clear. This method serves as a **shared framework utility** — it is defined in the base `KKW05501SF01DBean` and inherited by `KKW05501SFBean` (via `super.clearListDataInstance(key)`), and many other webview beans across the application override it similarly. It supports the **View Bean lifecycle**, specifically the screen initialization and data refresh cycle, ensuring that stale list data (e.g., code lookup values) from a previous screen state does not leak into the current request. The method handles three distinct list categories: initial setup code values, code type code values, and code type names.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(key)"])
    CHECK_NULL["key is not null?"]
    SKIP["Skip - key is null"]
    CHECK_INITIAL["key equals Initial Setup Code?"]
    CLEAR_INITIAL["Clear default_cd_list"]
    CHECK_TYPE["key equals Code Type Code Value List?"]
    CLEAR_TYPE["Clear cd_div_cd_list_list"]
    CHECK_NAME["key equals Code Type Name List?"]
    CLEAR_NAME["Clear cd_div_nm_list_list"]
    RETURN(["Return / Exit"])

    START --> CHECK_NULL
    CHECK_NULL -->|false| SKIP
    SKIP --> RETURN
    CHECK_NULL -->|true| CHECK_INITIAL
    CHECK_INITIAL -->|true| CLEAR_INITIAL
    CHECK_INITIAL -->|false| CHECK_TYPE
    CLEAR_INITIAL --> CHECK_TYPE
    CHECK_TYPE -->|true| CLEAR_TYPE
    CHECK_TYPE -->|false| CHECK_NAME
    CLEAR_TYPE --> CHECK_NAME
    CHECK_NAME -->|true| CLEAR_NAME
    CHECK_NAME -->|false| RETURN
    CLEAR_NAME --> RETURN
```

**CRITICAL — Constant Resolution:**
This method uses Japanese string literals directly (not constant references). The literal values are resolved as follows:

| Literal (Japanese) | English Translation | Target List Field |
|---|---|---|
| `初期設定コード` | Initial Setup Code | `default_cd_list` |
| `コードタイプコード値リスト` | Code Type Code Value List | `cd_div_cd_list_list` |
| `コードタイプ名称リスト` | Code Type Name List | `cd_div_nm_list_list` |

No external constant class is referenced — all values are inline string comparisons.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The list item identifier (項目名) that specifies which data list to clear. It carries a Japanese string label corresponding to one of three predefined list categories used in dropdown/select display components. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `default_cd_list` | `X33VDataTypeList` | List holding initial setup code values (初期設定コード) — codes used for the screen's primary initialization/setting dropdown |
| `cd_div_cd_list_list` | `X33VDataTypeList` | List holding code type code values (コードタイプコード値リスト) — the actual values for code type classification dropdowns |
| `cd_div_nm_list_list` | `X33VDataTypeList` | List holding code type names (コードタイプ名称リスト) — the display labels associated with code type values |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeList.clear` | (Framework) | (In-memory list) | Calls `clear()` on the `X33VDataTypeList` instance to remove all elements |

This method performs **no database or external service operations**. All three target fields (`default_cd_list`, `cd_div_cd_list_list`, `cd_div_nm_list_list`) are in-memory Java collections of type `X33VDataTypeList`. The `clear()` operation is a pure in-memory data removal — it empties the list without touching any persistent storage.

## 5. Dependency Trace

**Callers (classes that override and call `super.clearListDataInstance(key)`):**

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW05501SF | `KKW05501SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 2 | Screen:FUW00901SF | `FUW00901SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 3 | Screen:FUW00902SF | `FUW00902SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 4 | Screen:FUW00903SF | `FUW00903SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 5 | Screen:FUW00905SF | `FUW00905SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 6 | Screen:FUW00906SF | `FUW00906SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 7 | Screen:FUW00907SF | `FUW00907SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 8 | Screen:FUW00908SF | `FUW00908SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 9 | Screen:FUW00909SF | `FUW00909SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 10 | Screen:FUW00910SF | `FUW00910SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 11 | Screen:FUW00911SF | `FUW00911SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 12 | Screen:FUW00913SF | `FUW00913SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 13 | Screen:FUW00914SF | `FUW00914SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 14 | Screen:FUW00915SF | `FUW00915SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |
| 15 | Screen:FUW00916SF | `FUW00916SFBean.clearListDataInstance(key)` -> `super.clearListDataInstance(key)` [KKW05501SF01DBean] | `X33VDataTypeList.clear []` |

**Note:** The method is also overridden (without calling super) in numerous DBean subclasses (e.g., `KKW05501SF01DBean`, `FUW00907SF01DBean`, `FUW00917SF01DBean`) and in `CommonInfoCF` beans. The chain above captures all beans that delegate to the parent implementation.

## 6. Per-Branch Detail Blocks

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

> Check if the key parameter is not null. If null, skip all clearing logic and return immediately.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key != null` // Null guard — prevent NPE before string comparison |

**Block 1.1** — IF `[key.equals("初期設定コード") (Initial Setup Code)]` (L773)

> When the key matches "初期設定コード", clear the `default_cd_list` which holds the initial setup code values used in screen dropdown components.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `default_cd_list.clear()` // Clear the initial setup code list — リスト項目の要素をクリアします (Clear list item elements) |

**Block 1.2** — ELSE-IF `[key.equals("コードタイプコード値リスト") (Code Type Code Value List)]` (L776)

> When the key matches "コードタイプコード値リスト", clear the `cd_div_cd_list_list` which holds code type code values.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `cd_div_cd_list_list.clear()` // Clear the code type code value list — コードタイプコード値値リスト (Code type code value list) |

**Block 1.3** — ELSE-IF `[key.equals("コードタイプ名称リスト") (Code Type Name List)]` (L779)

> When the key matches "コードタイプ名称リスト", clear the `cd_div_nm_list_list` which holds code type name values.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `cd_div_nm_list_list.clear()` // Clear the code type name list — コードタイプ名称リスト (Code type name list) |

**Block 2** — RETURN (L784)

> Method completion. No value returned (void).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // void method — implicit return at end of method body |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Parameter | List item identifier — specifies which in-memory data list to clear by matching a Japanese label string |
| `初期設定コード` | Field/Constant | Initial Setup Code — the Japanese label for the key that identifies the initial setup code list |
| `コードタイプコード値リスト` | Field/Constant | Code Type Code Value List — the Japanese label for the key that identifies the code type code value list |
| `コードタイプ名称リスト` | Field/Constant | Code Type Name List — the Japanese label for the key that identifies the code type name list |
| `default_cd_list` | Field | Default code list — in-memory list holding initial setup code values for screen display |
| `cd_div_cd_list_list` | Field | Code division code value list — in-memory list holding code type classification values |
| `cd_div_nm_list_list` | Field | Code division name list — in-memory list holding code type display names |
| `X33VDataTypeList` | Framework | Fujitsu Futurity X33 framework type-safe list wrapper — generic container for view bean list data with type preservation |
| `KKW05501SF01DBean` | Class | Data bean for KKW05501SF screen — holds view state (lists, fields) for a service screen in the X33 MVC framework |
| `KKW05501SFBean` | Class | Parent screen bean that extends/contains KKW05501SF01DBean — delegates clear operations via `super.clearListDataInstance(key)` |
| `X33SException` | Framework | Fujitsu X33 framework exception class — declared in method signature but not thrown by this specific implementation |
| DBean | Acronym | Data Bean — a view-state holder in the X33 framework that manages UI-bound data for a specific screen |

---
