# Business Logic — KKW00801SF03DBean.typeModelData() [169 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00801SF.KKW00801SF03DBean` |
| Layer | Data Bean / Utility (Data Type Bean) |
| Module | `KKW00801SF` (Package: `eo.web.webview.KKW00801SF`) |

## 1. Role

### KKW00801SF03DBean.typeModelData()

This method implements the **X33 framework's data type resolution contract** (`X33VDataTypeBeanInterface.typeModelData`). It acts as a **routing/dispatch utility** that maps a pair of identifiers — a business-level **item name** (`key`) and a **sub-key** (`subkey`) — to a specific Java runtime `Class<?>` representing the expected data type for that attribute. The method serves as the **single contract point** for dynamic type introspection on the `KKW00801SF03DBean` DTO, enabling the X33 framework to construct form UI bindings without compile-time type knowledge.

The method handles **12 distinct code management items** related to CD (code/master data) management in the telecom order fulfillment domain. These items cover code type attributes (code, name, description), code division attributes (division, name, alias), effective period attributes (start date, end date), and display metadata (display order, initial display code and its name, update timestamp). For each item, three subkeys are supported: `value` (the raw data type), `enable` (the editable/enabled state), and `state` (the display/edit status).

The method implements a **pure lookup pattern** — it reads no external state, performs no database or service calls, and returns only `Class` references (`String.class` for values, `Boolean.class` for the enable flag). It is a shared utility used internally by the parent `KKW00801SFBean` when building dynamic list data structures for code-management screen components.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData params"])

    START --> CHECK_NULL{key or subkey null?}

    CHECK_NULL -- yes --> RET_NULL(["return null"])
    CHECK_NULL -- no --> ROUTING["Key-based type routing"]

    ROUTING --> K1["key = コード種類コード (cd_sbt_cd)"]
    ROUTING --> K2["key = コード種類名 (cd_sbt_nm)"]
    ROUTING --> K3["key = コード種類説明 (cd_sbt_setmei)"]
    ROUTING --> K4["key = コード区分 (cd_div)"]
    ROUTING --> K5["key = コード区分名 (cd_div_nm)"]
    ROUTING --> K6["key = コード区分略称 (cd_div_ali)"]
    ROUTING --> K7["key = コード適用開始年月日 (cd_tstaymd)"]
    ROUTING --> K8["key = コード適用終了年月日 (cd_tendymd)"]
    ROUTING --> K9["key = 表示順序 (dsp_jun)"]
    ROUTING --> K10["key = 初期表示コード (shk_dsp_cd)"]
    ROUTING --> K11["key = 初期表示コード名称 (shk_dsp_cd_nm)"]
    ROUTING --> K12["key = 更新年月日時刻 (upd_dtm)"]

    K1 --> SUB_CHECK
    K2 --> SUB_CHECK
    K3 --> SUB_CHECK
    K4 --> SUB_CHECK
    K5 --> SUB_CHECK
    K6 --> SUB_CHECK
    K7 --> SUB_CHECK
    K8 --> SUB_CHECK
    K9 --> SUB_CHECK
    K10 --> SUB_CHECK
    K11 --> SUB_CHECK
    K12 --> SUB_CHECK

    SUB_CHECK{subkey matches value/enable/state?}
    SUB_CHECK -- yes --> SUB_ROUTING
    SUB_CHECK -- no --> RET_NULL

    SUB_ROUTING --> SC_VALUE{subkey = value?}
    SC_VALUE -- yes --> RET_STRING["return String.class"]
    SC_VALUE -- no --> SC_ENABLE{subkey = enable?}
    SC_ENABLE -- yes --> RET_BOOLEAN["return Boolean.class"]
    SC_ENABLE -- no --> SC_STATE{subkey = state?}
    SC_STATE -- yes --> RET_STRING["return String.class"]
    SC_STATE -- no --> RET_NULL

    RET_STRING --> END(["Return / Next"])
    RET_BOOLEAN --> END
    RET_NULL --> END
```

**Processing description:**

1. **Null Guard**: Immediately returns `null` if either `key` or `subkey` is `null` (line 903-905). This is the earliest possible exit.
2. **Separator Detection**: Computes `separaterPoint` via `key.indexOf("/")` (line 907). This variable is calculated but never used in the method — it appears to be leftover boilerplate.
3. **Key-Based Routing**: A chain of 12 `else-if` branches dispatches to the correct code management item based on the `key` parameter value. Each branch uses a literal Japanese string comparison against the item's display name.
4. **Subkey-Based Type Resolution**: Within each key branch, three subkey checks (`equalsIgnoreCase`) route to the appropriate `Class<?>` return:
   - `"value"` (case-insensitive) → `String.class`
   - `"enable"` (case-insensitive) → `Boolean.class`
   - `"state"` (case-insensitive) → `String.class`
5. **Default Exit**: If no key or subkey matches, the method falls through to return `null` (line 1067).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The item name (display label) for a code management field. Identifies which of the 12 code attributes the caller is requesting type information for. Values are Japanese display names such as "コード種類コード" (code type code), "コード区分" (code division), "表示順序" (display order), etc. Each key maps to a specific field group on the DTO with its own `_value`, `_enabled`, `_state`, and `_update` sub-fields. |
| 2 | `subkey` | `String` | The sub-field name within the identified item. Determines which attribute of the item's data model to describe. Values are: `"value"` (the raw data type for the field's content), `"enable"` (the boolean editability flag for the field on the UI), or `"state"` (the string-based display/edit state flag). Comparison is case-insensitive. |

**External State / Instance Fields:** None. This method is a pure function — it reads no instance fields, performs no I/O, and depends on no external services.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations**. It is a pure data-routing method that contains zero external method calls, database accesses, or service component invocations. It does not interact with any SC (Service Component) or CBS (Common Business Service). The only operations it performs are:

| Type | Operation | Description |
|------|-----------|-------------|
| N/A | `String.indexOf()` | Computes separator position (unused result) |
| N/A | `String.equals()` / `equalsIgnoreCase()` | Literal comparisons for key/subkey dispatch |
| N/A | `return` | Returns a `Class<?>` literal reference |

## 5. Dependency Trace

### Callers (who calls `typeModelData`)

The `typeModelData(String, String)` method in `KKW00801SF03DBean` is **not called directly** by any other class in the codebase. The method signature appears identically in other DBean classes (e.g., `FUW00912SF01DBean`, `FUW00912SFBean`, `FUW00926SFBean`), indicating this is a **framework-contracted interface method** implemented by all `X33VDataTypeBeanInterface` implementors.

The parent screen bean `KKW00801SFBean` references `KKW00801SF03DBean` by class name only — it uses `KKW00801SF03DBean.listKoumokuIds()` (line 1543) to retrieve the list of item IDs for the "ウイルスチェック有無リスト" (virus check existence list) data type item. The framework will invoke `typeModelData` on this bean indirectly through the `X33VDataTypeBeanInterface` contract when the framework needs to resolve the data type of a field on a `KKW00801SF03DBean` instance during dynamic form binding.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Framework: X33 View Engine | `X33VDataTypeBeanInterface.typeModelData(key, subkey)` → `KKW00801SF03DBean.typeModelData` | N/A (pure routing, no CRUD) |
| 2 | Framework: X33 View Engine | `X33VDataTypeBeanInterface.typeModelData(key, subkey)` → `KKW00801SF03DBean.typeModelData` (via `KKW00801SFBean.listDataTypeBeans` → `KKW00801SF03DBean` instantiation) | N/A (pure routing, no CRUD) |

**Notes:**
- `KKW00801SFBean.addListDataInstance` instantiates `KKW00801SF03DBean` as a data type bean for the "ウイルスチェック有無リスト" (virus check existence list) item (line 1649). The framework will subsequently call `typeModelData` on the bean instance.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L902)

> Null guard: returns `null` early if either argument is `null`.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // early exit on null input |

---

**Block 2** — [EXEC] `(separaterPoint calculation)` (L906)

> Computes the index of "/" in key. This result is unused — no subsequent references to `separaterPoint`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // unused variable |

---

**Block 3** — [IF/ELSE-IF chain] `(key equals code item names)` (L909–L1067)

> A chain of 12 key-matching branches. Each key is a Japanese display name for a code management field. Each branch then dispatches on the subkey.

### Block 3.1 — [IF] `key.equals("コード種類コード")` (cd_sbt_cd) (L909)

> Code type code — the sub-field value of the code type classification.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` // subkey is "state", returns status |

### Block 3.2 — [ELSE-IF] `key.equals("コード種類名")` (cd_sbt_nm) (L923)

> Code type name — the display name of the code type classification.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.3 — [ELSE-IF] `key.equals("コード種類説明")` (cd_sbt_setmei) (L937)

> Code type description — the descriptive text for the code type classification.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.4 — [ELSE-IF] `key.equals("コード区分")` (cd_div) (L951)

> Code division — the primary classification category for codes.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.5 — [ELSE-IF] `key.equals("コード区分名")` (cd_div_nm) (L965)

> Code division name — the display name of the code division category.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.6 — [ELSE-IF] `key.equals("コード区分略称")` (cd_div_ali) (L979)

> Code division alias — the abbreviated label for the code division category.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.7 — [ELSE-IF] `key.equals("コード適用開始年月日")` (cd_tstaymd) (L993)

> Code effective start date — the start date when the code becomes applicable.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.8 — [ELSE-IF] `key.equals("コード適用終了年月日")` (cd_tendymd) (L1007)

> Code effective end date — the end date when the code ceases to be applicable.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.9 — [ELSE-IF] `key.equals("表示順序")` (dsp_jun) (L1021)

> Display order — the sort/sequence order for displaying the code item in lists.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.10 — [ELSE-IF] `key.equals("初期表示コード")` (shk_dsp_cd) (L1035)

> Initial display code — the default code value shown when the form loads.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.11 — [ELSE-IF] `key.equals("初期表示コード名称")` (shk_dsp_cd_nm) (L1049)

> Initial display code name — the display name of the default code value.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

### Block 3.12 — [ELSE-IF] `key.equals("更新年月日時刻")` (upd_dtm) (L1063)

> Update datetime — the timestamp of the last modification to the code record.

| # | Type | Code |
|---|------|------|
| 1 | [IF] | `subkey.equalsIgnoreCase("value")` → `return String.class;` |
| 2 | [ELSE-IF] | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class;` |
| 3 | [ELSE-IF] | `subkey.equalsIgnoreCase("state")` → `return String.class;` |

---

**Block 4** — [DEFAULT/ELSE] `(no key or subkey matched)` (L1067)

> If no condition matched, return `null` — indicating the item/subkey combination is not recognized.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // no matching property found |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| コード種類コード (cd_sbt_cd) | Field | Code type code — the sub-category code within a code type classification |
| コード種類名 (cd_sbt_nm) | Field | Code type name — the human-readable display name of a code type |
| コード種類説明 (cd_sbt_setmei) | Field | Code type description — the detailed description text for a code type |
| コード区分 (cd_div) | Field | Code division — the top-level classification category for master codes |
| コード区分名 (cd_div_nm) | Field | Code division name — the display name of a code division category |
| コード区分略称 (cd_div_ali) | Field | Code division alias — the abbreviated short label for a code division |
| コード適用開始年月日 (cd_tstaymd) | Field | Code effective start date — the date from which a code becomes valid and applicable |
| コード適用終了年月日 (cd_tendymd) | Field | Code effective end date — the date after which a code is no longer valid or applicable |
| 表示順序 (dsp_jun) | Field | Display order — the sequence number determining the sort/display order in lists |
| 初期表示コード (shk_dsp_cd) | Field | Initial display code — the default code value pre-populated when a form loads |
| 初期表示コード名称 (shk_dsp_cd_nm) | Field | Initial display code name — the display name corresponding to the initial display code |
| 更新年月日時刻 (upd_dtm) | Field | Update datetime — the timestamp recording when a code record was last modified |
| `typeModelData` | Method | X33 framework contract method that resolves the Java Class type for a given item/subkey pair, used for dynamic form binding |
| X33VDataTypeBeanInterface | Interface | Fujitsu Futurity X33 framework interface that data beans implement to support dynamic data-type introspection for form UI generation |
| X33VListedBeanInterface | Interface | X33 framework interface that data beans implement to support repeatable list data structures |
| DBean | Abbreviation | Data Bean — a DTO-style class that holds screen input/output data and implements framework interfaces |
| CD | Business term | Code / Master Code — reference data (lookup codes) used across the telecom service order system |
| virus_chk_umu_list | Field | Virus check existence list — a data type list item in the parent screen bean that uses KKW00801SF03DBean as its data type bean class |
