---
title: "Business Logic — KKW00401SF01DBean.clearListDataInstance()"
method: "clearListDataInstance"
class: "KKW00401SF01DBean"
file: "source/koptWebB/src/eo/web/webview/KKW00401SF/KKW00401SF01DBean.java"
loc: 14
lines: "721-734"
---

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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00401SF.KKW00401SF01DBean` |
| Layer | Component (Data Bean / View Model) |
| Module | `KKW00401SF` (Package: `eo.web.webview.KKW00401SF`) |

## 1. Role

### KKW00401SF01DBean.clearListDataInstance()

This method provides list data instance clearing functionality for the KKW00401SF screen module's data bean. It acts as a routing/dispatch utility that selectively clears one of two code-type dropdown lists based on the business key parameter passed in. The method handles two **service types** of list data: the Code Type Code Value List (`cd_div_cd_list_list`) used for displaying categorical code values in dropdown selections, and the Code Type Name List (`cd_div_nm_list_list`) used for displaying human-readable code descriptions in the same UI controls.

As a Data Bean method, `clearListDataInstance` implements a **dispatch pattern** — it receives a string key that serves as a discriminator, and based on the key value, it delegates to the appropriate list's `clear()` operation. Its role in the larger system is to support screen lifecycle management: when a user navigates between screens or triggers a re-initialization, this method ensures stale selection data from previous screen runs is removed before new data is loaded. It is a shared utility method called by the parent bean class `KKW00401SFBean` and various subclass DBeans within the same module, making it a common data-cleaning entry point across the KKW00401SF screen family.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["clearListDataInstance(String key)"])
    
    CHECK_NULL{key != null?}
    
    BLOCK1["key equals<br>\"コードタイプコード値リスト\""]
    CLEAR1["cd_div_cd_list_list.clear()"]
    
    BLOCK2["key equals<br>\"コードタイプ名称リスト\""]
    CLEAR2["cd_div_nm_list_list.clear()"]
    
    END_NODE(["Return / Next"])
    
    START --> CHECK_NULL
    CHECK_NULL -->|false| END_NODE
    CHECK_NULL -->|true| BLOCK1
    BLOCK1 -->|true| CLEAR1
    BLOCK1 -->|false| BLOCK2
    BLOCK2 -->|true| CLEAR2
    BLOCK2 -->|false| END_NODE
    CLEAR1 --> END_NODE
    CLEAR2 --> END_NODE
```

**Processing Flow:**

1. **Null Guard** — The method first checks whether the `key` parameter is `null`. If `null`, the method exits immediately without performing any action (defensive programming to prevent `NullPointerException` on the subsequent `.equals()` call).
2. **Branch 1 — Code Type Code Value List** — If `key` exactly matches the string `"コードタイプコード値リスト"` (Code Type Code Value List), the method clears the `cd_div_cd_list_list` instance field, which holds the list of code values displayed in dropdown controls.
3. **Branch 2 — Code Type Name List** — If `key` exactly matches the string `"コードタイプ名称リスト"` (Code Type Name List), the method clears the `cd_div_nm_list_list` instance field, which holds the list of code names (descriptions) displayed in dropdown controls.
4. **No-Op** — If `key` is neither of the two recognized values, the method completes without modifying any state.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The list item discriminator that identifies which data list to clear. It carries the display label of a dropdown list component. Valid values are `"コードタイプコード値リスト"` (Code Type Code Value List — the list of actual code values for dropdown selections) and `"コードタイプ名称リスト"` (Code Type Name List — the list of human-readable code descriptions for the same dropdowns). If `null`, no operation is performed. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `cd_div_cd_list_list` | `X33VDataTypeList` | Code Type Code Value List — contains `X33VDataTypeStringBean` objects holding code values for the dropdown control's value column |
| `cd_div_nm_list_list` | `X33VDataTypeList` | Code Type Name List — contains `X33VDataTypeStringBean` objects holding code name/description values for the dropdown control's text column |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `cd_div_cd_list_list.clear` | - (local list) | - | Calls `clear()` on the `cd_div_cd_list_list` `X33VDataTypeList` instance to remove all code value items from the dropdown data list |
| U | `cd_div_nm_list_list.clear` | - (local list) | - | Calls `clear()` on the `cd_div_nm_list_list` `X33VDataTypeList` instance to remove all code name items from the dropdown data list |

**Notes:** This method performs **no database operations, SC (Service Component) calls, or CBS (Common Business Service) invocations**. All operations are local in-memory list manipulations. The `X33VDataTypeList.clear()` method is a standard collection operation from the X33 framework that removes all elements from the list without triggering any persistence logic.

## 5. Dependency Trace

Callers of this method are found within the `KKW00401SF` module's bean hierarchy. The method is declared as `public`, allowing it to be invoked by the parent bean and subclass DBeans.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW00401SF | `KKW00401SFBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |
| 2 | Screen:KKW00401SF | `KKW00401SF02DBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |
| 3 | Screen:KKW00401SF | `KKW00401SF09DBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |
| 4 | Screen:KKW00401SF | `KKW00401SF22DBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |
| 5 | Screen:KKW00401SF | `KKW00401SF23DBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |
| 6 | Screen:KKW00401SF | `KKW00401SF25DBean.clearListDataInstance` -> `KKW00401SF01DBean.clearListDataInstance` | `cd_div_cd_list_list.clear` [U] local |

**Notes:**
- All callers are within the `KKW00401SF` screen module — this is a screen-local utility method, not called from cross-module components.
- Callers include the parent bean `KKW00401SFBean` and multiple subclass DBeans (`02DBean`, `09DBean`, `22DBean`, `23DBean`, `25DBean`).
- The method is typically called during screen initialization or data reset operations to clear stale dropdown selection data.

## 6. Per-Branch Detail Blocks

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

> Null guard: prevents NullPointerException by checking if the key parameter is non-null before proceeding with string comparison.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key` (parameter) — guard condition on null check |
| 2 | EXEC | Proceed into method body if condition is true |

**Block 1.1** — IF-ELSE-IF-ELSE `[コードタイプコード値リスト="コードタイプコード値リスト"]` (L730)

> First branch: clears the code type code value list when key matches the code value list discriminator.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("コードタイプコード値リスト")` — checks if key matches Code Type Code Value List identifier |
| 2 | CALL | `cd_div_cd_list_list.clear()` — clears all elements from the code value list |

**Block 1.2** — ELSE-IF `[コードタイプ名称リスト="コードタイプ名称リスト"]` (L733)

> Second branch: clears the code type name list when key matches the code name list discriminator.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `key.equals("コードタイプ名称リスト")` — checks if key matches Code Type Name List identifier |
| 2 | CALL | `cd_div_nm_list_list.clear()` — clears all elements from the code name list |

**Block 1.3** — ELSE (implicit, no else block in source)

> If the key does not match either recognized value, the method exits the outer if block and returns. No state is modified.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `cd_div_cd` | Field | Code Division Code — the code value portion of a code type (e.g., "01", "02" for a dropdown category) |
| `cd_div_nm` | Field | Code Division Name — the human-readable name/description associated with a code division (e.g., "Active", "Inactive" for a category) |
| `cd_div_cd_list_list` | Field | Code Type Code Value List — X33VDataTypeList containing code value strings for the code type dropdown control |
| `cd_div_nm_list_list` | Field | Code Type Name List — X33VDataTypeList containing code name strings for the code type dropdown control |
| コードタイプコード値リスト | Japanese term | Code Type Code Value List — the list of code values for a dropdown's value column |
| コードタイプ名称リスト | Japanese term | Code Type Name List — the list of code descriptions for a dropdown's text column |
| DBean | Abbreviation | Data Bean — a view-model class that holds screen data and provides getter/setter methods, implementing X33 framework interfaces |
| X33VDataTypeList | Class | X33 Framework Typed List — a framework-provided collection class that holds elements of a specific data type for UI data binding |
| X33VDataTypeStringBean | Class | X33 Framework String Bean — a wrapper class for string data within an X33VDataTypeList |
| KKW00401SF | Module | Screen module code — the K-Opticom screen for code type management (service code type / classification maintenance) |
| X33SException | Class | X33 Framework Exception — the framework's standard exception type for screen-level errors |
| Screen | Domain term | A UI screen in the K-Opticom web application — a web page managed by the JSF/X33 framework that handles a specific business function |
