# Business Logic — CRW02702SF01DBean.typeModelData() [167 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.CRW02702SF.CRW02702SF01DBean` |
| Layer | UI / View Bean (Web Layer — JSF Data Bean) |
| Module | `CRW02702SF` (Package: `eo.web.webview.CRW02702SF`) |

## 1. Role

### CRW02702SF01DBean.typeModelData()

This method serves as a **type-model data lookup dispatch** for the CRW02702 screen module within K-Opticom's telecom service order management UI framework. It implements the `X33VDataTypeBeanInterface` contract: given a **field name** (`key`) and an optional **sub-key** (`subkey`), it returns the appropriate Java `Class<?>` type that the UI framework uses for data binding, validation, and rendering.

The method handles **13 distinct business fields** used in the option service contract detail screen. Each field can have sub-keys: `"value"` returns the primary data type (e.g., `String.class`, `Boolean.class`), `"enable"` returns `Boolean.class` for enable/disable binding, and `"state"` returns `String.class` for the field's UI state indicator.

The design pattern is a **router/dispatch** (also known as a type factory): the method routes on the `key` parameter, then on the `subkey` parameter, returning the corresponding type. It is a **shared utility** used by the X33 framework's dynamic data binding system across multiple screens and list beans within the CRW02702 module.

There are **no SC calls, no database access, and no side effects** — this is a pure, stateless type lookup.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    CHECK_NULL{key null<br>subkey null?}
    RETURN_NULL(["return null"])
    FIND_SEP["separaterPoint = key.indexOf('/')"]
    CHECK_1{key = Detail Index?}
    SUB_1{subkey matches<br>value enable state?}
    RET_1["return String.class<br>or Boolean.class"]
    CHECK_2{key = Option Svc Name?}
    SUB_2{subkey matches<br>value enable state?}
    RET_2["return String.class<br>or Boolean.class"]
    CHECK_3{key = Option Content?}
    SUB_3{subkey matches<br>value enable state?}
    RET_3["return String.class<br>or Boolean.class"]
    CHECK_4{key = Sub Option<br>Content?}
    SUB_4{subkey matches<br>value enable state?}
    RET_4["return String.class<br>or Boolean.class"]
    CHECK_5{key = Usage Status?}
    SUB_5{subkey matches<br>value enable state?}
    RET_5["return String.class<br>or Boolean.class"]
    CHECK_6{key = Svc Start Date?}
    SUB_6{subkey matches<br>value enable state?}
    RET_6["return String.class<br>or Boolean.class"]
    CHECK_7{key = Cancellation<br>Expected Date?}
    SUB_7{subkey matches<br>value enable state?}
    RET_7["return String.class<br>or Boolean.class"]
    CHECK_8{key = Service End Date?}
    SUB_8{subkey matches<br>value enable state?}
    RET_8["return String.class<br>or Boolean.class"]
    CHECK_9{key = Option Svc<br>Contract No?}
    SUB_9{subkey matches<br>value state?}
    RET_9["return String.class"]
    CHECK_10{key = Option Svc Code?}
    SUB_10{subkey matches<br>value state?}
    RET_10["return String.class"]
    CHECK_11{key = Option Content<br>Link Flag?}
    SUB_11{subkey matches<br>value state?}
    RET_11["return Boolean.class<br>or String.class"]
    CHECK_12{key = Row Style<br>Class?}
    SUB_12{subkey matches<br>value state?}
    RET_12["return String.class"]
    CHECK_13{key = Row Style<br>ID?}
    SUB_13{subkey matches<br>value state?}
    RET_13["return String.class"]
    RETURN_NULL2(["return null"])

    START --> CHECK_NULL
    CHECK_NULL -->|yes| RETURN_NULL
    CHECK_NULL -->|no| FIND_SEP
    FIND_SEP --> CHECK_1
    CHECK_1 -->|yes| SUB_1
    CHECK_1 -->|no| CHECK_2
    SUB_1 --> RET_1
    RET_1 --> RETURN_NULL2
    CHECK_2 -->|yes| SUB_2
    CHECK_2 -->|no| CHECK_3
    SUB_2 --> RET_2
    RET_2 --> RETURN_NULL2
    CHECK_3 -->|yes| SUB_3
    CHECK_3 -->|no| CHECK_4
    SUB_3 --> RET_3
    RET_3 --> RETURN_NULL2
    CHECK_4 -->|yes| SUB_4
    CHECK_4 -->|no| CHECK_5
    SUB_4 --> RET_4
    RET_4 --> RETURN_NULL2
    CHECK_5 -->|yes| SUB_5
    CHECK_5 -->|no| CHECK_6
    SUB_5 --> RET_5
    RET_5 --> RETURN_NULL2
    CHECK_6 -->|yes| SUB_6
    CHECK_6 -->|no| CHECK_7
    SUB_6 --> RET_6
    RET_6 --> RETURN_NULL2
    CHECK_7 -->|yes| SUB_7
    CHECK_7 -->|no| CHECK_8
    SUB_7 --> RET_7
    RET_7 --> RETURN_NULL2
    CHECK_8 -->|yes| SUB_8
    CHECK_8 -->|no| CHECK_9
    SUB_8 --> RET_8
    RET_8 --> RETURN_NULL2
    CHECK_9 -->|yes| SUB_9
    CHECK_9 -->|no| CHECK_10
    SUB_9 --> RET_9
    RET_9 --> RETURN_NULL2
    CHECK_10 -->|yes| SUB_10
    CHECK_10 -->|no| CHECK_11
    SUB_10 --> RET_10
    RET_10 --> RETURN_NULL2
    CHECK_11 -->|yes| SUB_11
    CHECK_11 -->|no| CHECK_12
    SUB_11 --> RET_11
    RET_11 --> RETURN_NULL2
    CHECK_12 -->|yes| SUB_12
    CHECK_12 -->|no| CHECK_13
    SUB_12 --> RET_12
    RET_12 --> RETURN_NULL2
    CHECK_13 -->|yes| SUB_13
    CHECK_13 -->|no| RETURN_NULL2
    SUB_13 --> RET_13
    RET_13 --> RETURN_NULL2
```

**Critical observations:**
- The `separaterPoint` variable is computed (L898) but **never used** — it appears to be dead code from a prior iteration supporting hierarchical keys with "/" delimiters.
- All 13 fields are **String**-typed, except `"オプション内容リンク表示フラグ"` (Option Content Link Display Flag) which is **Boolean**-typed for its value sub-key.
- Fields 9-13 (Contract No, Service Code, Link Flag, Row Style Class, Row Style ID) do **not** support the `"enable"` sub-key — only `"value"` and `"state"`.
- Fields 1-8 (Detail Index through Service End Date) all support `"value"`, `"enable"`, and `"state"` sub-keys.
- Unknown key/subkey combinations return `null` (graceful fallback).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **field name** (項目名) of a UI data-bound element. Must match one of 13 recognized Japanese field names such as "明細インデックス" (Detail Index), "オプションサービス名" (Option Service Name), "オプション内容" (Option Content), "利用状態" (Usage Status), etc. Each key corresponds to a specific instance field on the bean. |
| 2 | `subkey` | `String` | The **sub-key** identifying which aspect of the field to return type information for: `"value"` (the data type itself), `"enable"` (the enabled/disabled binding type), or `"state"` (the UI state string type). Case-insensitive comparison. |

**Instance fields read by the method:** None. This method is entirely stateless and does not read any instance fields.

## 4. CRUD Operations / Called Services

This method performs **no CRUD operations** and calls **no external services or data access methods**. It is a pure type lookup — a factory method returning Java `Class<?>` objects.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| (none) | — | — | — | Pure in-memory type dispatch; no database, SC, or CBS interaction. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:CRW02702SF | `CRW02702SFBean.typeModelData(String gamenId, String key, String subkey)` → `CRW02702SF01DBean.typeModelData(String key, String subkey)` | (none — pure type lookup) |
| 2 | Screen:CRW02702SF | `CRW02702SFBean.typeModelData(String key, String subkey)` → `X33VDataTypeBeanInterface.typeModelData(String key, String subkey)` → `CRW02702SF01DBean.typeModelData(String key, String subkey)` | (none — pure type lookup) |
| 3 | Screen:CRW02702SF | `CRW02702SFBean.listKoumokuIds()` → delegates to `CRW02702SF01DBean.listKoumokuIds()` for "オプションサービス契約一覧照会明細" (Option Service Contract List Inquiry Details) | (none — metadata list) |
| 4 | Screen:CRW02702SF | `CRW02702SFBean.addListDataInstance(String key)` → creates `new CRW02702SF01DBean()` → framework invokes `X33VDataTypeBeanInterface.typeModelData(String key, String subkey)` | (none — pure type lookup) |

**Call chain explanation:**
- The parent class `CRW02702SFBean` overrides `typeModelData` (L1415) with its own routing logic, but **does not** call `super.typeModelData` for the `CRW02702SF01DBean` fields. Instead, `CRW02702SF01DBean` implements its **own** `typeModelData` method with the same signature, fulfilling the `X33VDataTypeBeanInterface` directly.
- The method is invoked by the X33 framework's data binding system when rendering list items for the "オプションサービス契約一覧照会明細" (Option Service Contract List Inquiry Details) data-bound section.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(key == null || subkey == null)` (L894)

> Null guard: If either parameter is null, return null immediately. This is the early-exit safety check for malformed lookups.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // unused dead code [→ unused] |
| 2 | RETURN | `return null` // key or subkey is null — return null |

**Block 2** — IF `(key.equals("明細インデックス"))` [Detail Index] (L900)

> Returns the Java type for the detail index field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return String.class` // detail index value type |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` → `return Boolean.class` // detail index enabled state type |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type (subkeyが"state"の場合、ステータスを返す) |

**Block 3** — IF `[ELSE] `(key.equals("オプションサービス名"))` [Option Service Name] (L913)

> Returns the Java type for the option service name field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 4** — IF `[ELSE] `(key.equals("オプション内容"))` [Option Content] (L926)

> Returns the Java type for the option content (service detail description) field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 5** — IF `[ELSE] `(key.equals("サブオプション内容"))` [Sub Option Content] (L939)

> Returns the Java type for the sub-option content field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 6** — IF `[ELSE] `(key.equals("利用状態"))` [Usage Status] (L952)

> Returns the Java type for the usage status field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 7** — IF `[ELSE] `(key.equals("利用開始日"))` [Service Start Date] (L965)

> Returns the Java type for the service start date field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 8** — IF `[ELSE] `(key.equals("解約予定日"))` [Cancellation Expected Date] (L978)

> Returns the Java type for the cancellation expected date field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 9** — IF `[ELSE] `(key.equals("利用終了日"))` [Service End Date] (L991)

> Returns the Java type for the service end date field. Supports value, enable, and state sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `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" → return state type |

**Block 10** — IF `[ELSE] `(key.equals("オプションサービス契約番号"))` [Option Service Contract Number] (L1004)

> Returns the Java type for the option service contract number. Does **not** support "enable" sub-key — only "value" and "state".

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return String.class` |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type |

**Block 11** — IF `[ELSE] `(key.equals("オプションサービスコード"))` [Option Service Code] (L1014)

> Returns the Java type for the option service code. Does **not** support "enable" sub-key — only "value" and "state".

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return String.class` |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type |

**Block 12** — IF `[ELSE] `(key.equals("オプション内容リンク表示フラグ"))` [Option Content Link Display Flag] (L1024)

> Returns the Java type for the option content link display flag. This is the only field whose **value** sub-key returns `Boolean.class` (a flag). Only supports "value" and "state" sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return Boolean.class` // flag field — data type is boolean |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type |

**Block 13** — IF `[ELSE] `(key.equals("行スタイルクラス"))` [Row Style Class] (L1034)

> Returns the Java type for the row style CSS class name. Only supports "value" and "state" sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return String.class` |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type |

**Block 14** — IF `[ELSE] `(key.equals("行スタイルID"))` [Row Style ID] (L1044)

> Returns the Java type for the row style CSS ID. Only supports "value" and "state" sub-keys.

| # | Type | Code |
|---|------|------|
| 1 | IF-ELSE | `subkey.equalsIgnoreCase("value")` → `return String.class` |
| 2 | ELSE-IF | `subkey.equalsIgnoreCase("state")` → `return String.class` // subkey is "state" → return state type |

**Block 15** — FINAL RETURN (L1054)

> No matching key was found — return null as a graceful fallback.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null` // no matching key found — return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `key` | Field | Field name — the Japanese name of a UI data-bound element (e.g., "明細インデックス", "オプションサービス名"). Used by the X33 framework for dynamic type lookup. |
| `subkey` | Field | Sub-key identifying the aspect of the field: `"value"` (primary data type), `"enable"` (enabled/disabled binding), or `"state"` (UI state). Case-insensitive. |
| `l_detail_index_value` | Field | Detail index value — the display value of a row index in a data-bound list |
| `l_detail_index_enabled` | Field | Detail index enabled flag — whether the detail index field is enabled (true/false) |
| `l_detail_index_state` | Field | Detail index state — the current UI state string of the detail index field |
| `l_op_svc_cd_nm_value` | Field | Option service code name value — the display name of the option service |
| `l_op_svc_niy_value` | Field | Option content value — the description/detail of the selected option service |
| `l_sbop_svc_niy_value` | Field | Sub-option content value — the description/detail of a sub-option (add-on) |
| `l_op_svc_kei_stat_nm_value` | Field | Option service category status name — the display name of the service usage status |
| `l_svc_staymd_value` | Field | Service start date — the date when the service becomes active |
| `l_rsv_tsta_kibo_ymd_value` | Field | Cancellation expected date — the date the customer requests cancellation |
| `l_svc_endymd_value` | Field | Service end date — the date the service will be terminated |
| `l_op_svc_kei_no_value` | Field | Option service contract number — the unique identifier for the option service contract line |
| `l_op_svc_cd_value` | Field | Option service code — the short code identifying the type of option service |
| `l_op_svc_niy_link_dsp_flg` | Field | Option content link display flag — boolean flag controlling whether option content links are displayed |
| `l_line_style_class` | Field | Row style CSS class name — the CSS class applied to a table row |
| `l_line_style_id` | Field | Row style CSS ID — the CSS ID applied to a table row |
| CRW02702SF | Screen | Service Option Contract List Inquiry screen — allows users to view and manage option service contracts in the K-Opticom telecom management system |
| X33VDataTypeBeanInterface | Interface | Framework interface defining the type-model data contract for UI data-bound beans |
| X33VListedBeanInterface | Interface | Framework interface for beans that provide list metadata (column definitions) |
| Data-bound item | UI concept | A row in a repeating list section on the screen, where each item corresponds to an option service contract line item |
| 明細インデックス | Field (Japanese) | Detail Index — the row number/index within a data-bound list section |
| オプションサービス名 | Field (Japanese) | Option Service Name — the human-readable name of the option service |
| オプション内容 | Field (Japanese) | Option Content — the detailed description of the selected option service |
| サブオプション内容 | Field (Japanese) | Sub-option Content — the detailed description of an add-on sub-option |
| 利用状態 | Field (Japanese) | Usage Status — the current status of the service (active, suspended, etc.) |
| 利用開始日 | Field (Japanese) | Service Start Date — the date when the option service begins |
| 解約予定日 | Field (Japanese) | Cancellation Expected Date — the date when cancellation is expected to take effect |
| 利用終了日 | Field (Japanese) | Service End Date — the date when the service will be terminated |
| オプションサービス契約番号 | Field (Japanese) | Option Service Contract Number — the contract line item identifier |
| オプションサービスコード | Field (Japanese) | Option Service Code — the short code for the option service type |
| オプション内容リンク表示フラグ | Field (Japanese) | Option Content Link Display Flag — boolean flag for displaying option content links |
| 行スタイルクラス | Field (Japanese) | Row Style Class — the CSS class name applied to a row |
| 行スタイルID | Field (Japanese) | Row Style ID — the CSS ID applied to a row |
