---

# Business Logic — KKW14301SF01DBean.typeModelData() [52 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA35101SF.KKW14301SF01DBean` |
| Layer | Utility / Data-Binding Type Resolver (Web Layer Component) |
| Module | `KKA35101SF` (Package: `eo.web.webview.KKA35101SF`) |

## 1. Role

### KKW14301SF01DBean.typeModelData()

The `typeModelData` method serves as a **data-binding type resolver** for the EO (Enterprise Open) television service configuration screen within the K-Opticom broadband order system. It maps **item names** (key) and **sub-keys** (subkey) to their corresponding Java runtime types, enabling dynamic form rendering where the UI layer must know the data type of each field at runtime. This method implements the **routing/dispatch design pattern** — it evaluates the `key` parameter against known television service configuration items and then dispatches to the appropriate type based on the `subkey`. It handles three specific items: the **E! Light TV Tuner (STT)** item, the **Course Selection** item, and the **Count** item. Each item exposes three sub-properties: `value` (the actual data as `String`), `enable` (a control flag as `Boolean`), and `state` (a UI state indicator as `String`). This method plays a critical role in the **screen bean abstraction** — it allows the view layer to request type information generically without hard-coding field-type relationships, supporting the framework's data-binding mechanism used across multiple screens (KKW14301SF).

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData(String key, String subkey)"])
    CHECK_NULL["key == null or subkey == null"]
    RETURN_NULL(["return null"])
    FIND_SLASH["int separaterPoint = key.indexOf('/')"]
    CHECK_KEY_TV["key.equals('Ｎ項目？ＥＯ光テレビチューナー（STT）')"]
    CHECK_SUBVALUE_SUB["subkey.equalsIgnoreCase('value')"]
    TV_RETURN_STRING_1(["return String.class"])
    CHECK_SUBENABLE_SUB["subkey.equalsIgnoreCase('enable')"]
    TV_RETURN_BOOLEAN(["return Boolean.class"])
    CHECK_SUBSTATE_SUB["subkey.equalsIgnoreCase('state')"]
    TV_RETURN_STRING_2(["return String.class"])
    CHECK_KEY_COURSE["key.equals('Ｎ項目？コース選択')"]
    CHECK_SUBVALUE_C["subkey.equalsIgnoreCase('value')"]
    TV_RETURN_STRING_3(["return String.class"])
    CHECK_SUBENABLE_C["subkey.equalsIgnoreCase('enable')"]
    COURSE_RETURN_BOOLEAN(["return Boolean.class"])
    CHECK_SUBSTATE_C["subkey.equalsIgnoreCase('state')"]
    TV_RETURN_STRING_4(["return String.class"])
    CHECK_KEY_COUNT["key.equals('Ｎ項目？カウント')"]
    CHECK_SUBVALUE_CO["subkey.equalsIgnoreCase('value')"]
    TV_RETURN_STRING_5(["return String.class"])
    CHECK_SUBENABLE_CO["subkey.equalsIgnoreCase('enable')"]
    COUNT_RETURN_BOOLEAN(["return Boolean.class"])
    CHECK_SUBSTATE_CO["subkey.equalsIgnoreCase('state')"]
    TV_RETURN_STRING_6(["return String.class"])
    RETURN_NULL_FINAL(["return null"])

    START --> CHECK_NULL
    CHECK_NULL -->|true| RETURN_NULL
    CHECK_NULL -->|false| FIND_SLASH
    FIND_SLASH --> CHECK_KEY_TV
    CHECK_KEY_TV -->|true| CHECK_SUBVALUE_SUB
    CHECK_KEY_TV -->|false| CHECK_KEY_COURSE
    CHECK_SUBVALUE_SUB -->|true| TV_RETURN_STRING_1
    CHECK_SUBVALUE_SUB -->|false| CHECK_SUBENABLE_SUB
    CHECK_SUBENABLE_SUB -->|true| TV_RETURN_BOOLEAN
    CHECK_SUBENABLE_SUB -->|false| CHECK_SUBSTATE_SUB
    CHECK_SUBSTATE_SUB -->|true| TV_RETURN_STRING_2
    CHECK_SUBSTATE_SUB -->|false| CHECK_KEY_COURSE
    CHECK_KEY_COURSE -->|true| CHECK_SUBVALUE_C
    CHECK_KEY_COURSE -->|false| CHECK_KEY_COUNT
    CHECK_SUBVALUE_C -->|true| TV_RETURN_STRING_3
    CHECK_SUBVALUE_C -->|false| CHECK_SUBENABLE_C
    CHECK_SUBENABLE_C -->|true| COURSE_RETURN_BOOLEAN
    CHECK_SUBENABLE_C -->|false| CHECK_SUBSTATE_C
    CHECK_SUBSTATE_C -->|true| TV_RETURN_STRING_4
    CHECK_SUBSTATE_C -->|false| CHECK_KEY_COUNT
    CHECK_KEY_COUNT -->|true| CHECK_SUBVALUE_CO
    CHECK_KEY_COUNT -->|false| RETURN_NULL_FINAL
    CHECK_SUBVALUE_CO -->|true| TV_RETURN_STRING_5
    CHECK_SUBVALUE_CO -->|false| CHECK_SUBENABLE_CO
    CHECK_SUBENABLE_CO -->|true| COUNT_RETURN_BOOLEAN
    CHECK_SUBENABLE_CO -->|false| CHECK_SUBSTATE_CO
    CHECK_SUBSTATE_CO -->|true| TV_RETURN_STRING_6
    CHECK_SUBSTATE_CO -->|false| RETURN_NULL_FINAL
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name** (項目名) that identifies which configuration field type to resolve. It corresponds to a specific UI form item in the EO (Enterprise Open) television service configuration screen. Valid values are: `"Ｎ項目？ＥＯ光テレビチューナー（STT）"` (item ID: `kcat_n_cnt_tv_tuner` — E! Light TV Tuner for Set-Top Box STT), `"Ｎ項目？コース選択"` (item ID: `kcat_n_course_choice` — Course Selection for service plan tier), or `"Ｎ項目？カウント"` (item ID: `kcat_n_cnt` — Count). The key determines which of the three processing branches is taken. |
| 2 | `subkey` | `String` | The **sub-key** (サブキー) that identifies the property within the specified item. It determines which attribute of the form field the caller wants the type for. Valid values are: `"value"` (the actual data value stored in the field), `"enable"` (a boolean flag controlling whether the field is editable), or `"state"` (a string indicating the UI state/status of the field, used for error display). The comparison is case-insensitive (`equalsIgnoreCase`). |

**External state read:** None. The method is stateless — it does not read any instance fields or external state. It performs pure computation based solely on its two parameters.

## 4. CRUD Operations / Called Services

This method does **not** perform any CRUD operations, service component calls, or database access. It is a pure **type resolution utility** that performs string comparisons and returns Java `Class` objects. No SC (Service Component) or CBS (Component/Service Bean) methods are invoked.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| *None* | — | — | — | This method performs no data access operations. It is a type-dispatch utility. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW14301SF (WebA) | `KKW14301SFBean` → instantiates `KKW14301SF01DBean` → `typeModelData` | None (type resolver, no CRUD) |
| 2 | Screen:KKW14301SF (WebB) | `KKW14301SFBean` → instantiates `KKW14301SF01DBean` → `typeModelData` | None (type resolver, no CRUD) |

**Notes on callers:**
- `typeModelData` is referenced indirectly by `KKW14301SFBean` in both koptWebA and koptWebB modules. The bean creates a `KKW14301SF01DBean` instance and uses it to manage data type binding for TV tuner list items.
- Comments in the caller (`KKW14301SFBean`) describe this as the case where the data type is a "data-type bean type" item (`kcat_tv_tuner_list`), where the data-type bean class is `KKW14301SF01DBean`.
- The method is likely called during screen initialization to determine the type of each form field for data-binding purposes.

## 6. Per-Branch Detail Blocks

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

> Null guard clause: If either parameter is null, return null immediately. This prevents NPE and provides a safe default for missing type information.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf('/')` // Search for delimiter in key (unused — possibly leftover from prior implementation) [L349] |

---

**Block 2** — [IF] `(key.equals("Ｎ項目？ＥＯ光テレビチューナー（STT）"))` — `kcat_n_cnt_tv_tuner = "kcat_n_cnt_tv_tuner"` (E! Light TV Tuner for STB) (L351)

> Business meaning: Resolves type information for the **E! Light TV Tuner (STT)** configuration item. This item appears in the EO (Enterprise Open) television service order screen for fiber-to-the-home (FTTH) broadband subscribers selecting their set-top box tuner type.

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` → returns `String.class` [L352] // Comment: The data type for this item is String |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` → returns `Boolean.class` [L355] // Boolean enable flag |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → returns `String.class` [L358] // Comment: If subkey is "state", returns the status (state) |

---

**Block 3** — [ELSE-IF] `(key.equals("Ｎ項目？コース選択"))` — `kcat_n_course_choice = "kcat_n_course_choice"` (Course Selection) (L363)

> Business meaning: Resolves type information for the **Course Selection** item. This item allows the customer to select their broadband service plan tier/course in the EO television service order screen.

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` → returns `String.class` [L364] // Comment: The data type for this item is String |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` → returns `Boolean.class` [L367] // Boolean enable flag |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → returns `String.class` [L370] // Comment: If subkey is "state", returns the status (state) |

---

**Block 4** — [ELSE-IF] `(key.equals("Ｎ項目？カウント"))` — `kcat_n_cnt = "kcat_n_cnt"` (Count) (L375)

> Business meaning: Resolves type information for the **Count** item. This item tracks a numeric counter (stored as String) within the EO television service configuration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` → returns `String.class` [L376] // Comment: The data type for this item is String |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` → returns `Boolean.class` [L379] // Boolean enable flag |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → returns `String.class` [L382] // Comment: If subkey is "state", returns the status (state) |

---

**Block 5** — [FINAL] `(no condition — fallback)` (L385)

> If none of the key/subkey combinations match, return `null` to indicate no type mapping exists for the given parameters.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Comment: If no matching property exists, return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Parameter | Item Name (項目名) — Identifies a specific UI form field in the EO television service configuration screen |
| `subkey` | Parameter | Sub-Key (サブキー) — Identifies a property of the form field (value, enable, or state) |
| `Ｎ項目？ＥＯ光テレビチューナー（STT）` | Field | N-Item? E! Light TV Tuner (STT) — The set-top box tuner selection field in the EO television order screen. Item ID: `kcat_n_cnt_tv_tuner` |
| `Ｎ項目？コース選択` | Field | N-Item? Course Selection — The service plan course/tier selection field. Item ID: `kcat_n_course_choice` |
| `Ｎ項目？カウント` | Field | N-Item? Count — A counter field for tracking within the EO television configuration. Item ID: `kcat_n_cnt` |
| `kcat_n_cnt_tv_tuner` | Constant | Tuner count item field — Internal field ID for the TV tuner selection form item |
| `kcat_n_cnt_tv_tuner_err` | Constant | Tuner count item error field — Error display field associated with the TV tuner item |
| `kcat_n_course_choice` | Constant | Course choice item field — Internal field ID for the service course selection form item |
| `kcat_n_course_choice_err` | Constant | Course choice item error field — Error display field associated with the course choice item |
| EO (エンタープライズ・オープン) | Acronym | Enterprise Open — K-Opticom's broadband customer-facing web order system for telecom services |
| FTTH | Business term | Fiber To The Home — Fiber-optic broadband internet service offered by K-Opticom |
| STB | Acronym | Set-Top Box — Hardware device for receiving television signals, referenced in the tuner selection item |
| STT | Abbreviation | Set-Top Tuner — A specific set-top box tuner variant in the EO television service configuration |
| `value` | Sub-key | The actual data value stored in the form field (type: `String`) |
| `enable` | Sub-key | A boolean flag indicating whether the form field is enabled/disabled for user interaction (type: `Boolean`) |
| `state` | Sub-key | A string indicating the current UI state/status of the field, typically used for error or warning messages (type: `String`) |
| KKW14301SF | Screen ID | EO Television Tuner List screen — The web screen where customers select their TV tuner options |
| KKW14301SF01DBean | Component | Data Bean for KKW14301SF screen — Holds configuration item metadata and type resolution logic for the TV tuner list |
| koptWebA / koptWebB | Module | K-Opticom Web Application A/B — The two web application modules (likely representing different environments or deployments) |

---
