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

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW22301SF.KKW22301SF01DBean` |
| Layer | DBean / Data Type Router (Web Layer — View data type resolution utility) |
| Module | `KKW22301SF` (Package: `eo.web.webview.KKW22301SF`) |

## 1. Role

### KKW22301SF01DBean.typeModelData()

This method serves as a **data type metadata resolver** for the KKW22301SF screen module. It determines the Java runtime type (`Class<?>`) that a given data item should use, based on a combination of the item's business field name (`key`) and a metadata sub-property (`subkey`). The method implements a **routing/dispatch pattern** that maps well-known UI field names to their expected data types, enabling the framework to perform type-safe data binding and validation.

Three business fields are handled:
- **"サービス契約番号" (Service Contract Number)** — item ID: `svc_kei_no` — represents the unique identifier of a service contract line item.
- **"SYSID" (System ID)** — item ID: `sysid` — represents the internal system identifier used across telecom service management.
- **"請求契約番号" (Billing Contract Number)** — item ID: `seiky_kei_no` — represents the billing contract identifier linked to a service contract.

For each field, the method resolves three standard sub-properties:
- **`value`** (case-insensitive) — the data value type (always `String.class`)
- **`enable`** (case-insensitive) — the editable/active flag type (`Boolean.class`)
- **`state`** (case-insensitive) — the item's state/status indicator type (`String.class`)

The method plays the role of a **shared utility** within the DBean hierarchy. Many DBean classes (e.g., `FUW00912SFBean`, `FUW00959SFBean`, `FUW00964SFBean`) define their own `typeModelData` implementations, indicating this is a framework-level contract method used by view-layer components to resolve data types at runtime for dynamic form rendering.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    NULLCHECK{"key == null
or subkey == null?"}
    SvcKeiNo{"key equals
\"サービス契約番号\""}
    SvcKeiNoValue{"subkey equalsIgnoreCase
\"value\""}
    SvcKeiNoEnable{"subkey equalsIgnoreCase
\"enable\""}
    SvcKeiNoState{"subkey equalsIgnoreCase
\"state\""}
    SysIdCheck{"key equals
\"SYSID\""}
    SysIdValue{"subkey equalsIgnoreCase
\"value\""}
    SysIdEnable{"subkey equalsIgnoreCase
\"enable\""}
    SysIdState{"subkey equalsIgnoreCase
\"state\""}
    SeikyKeiNo{"key equals
\"請求契約番号\""}
    SeikyKeiNoValue{"subkey equalsIgnoreCase
\"value\""}
    SeikyKeiNoEnable{"subkey equalsIgnoreCase
\"enable\""}
    SeikyKeiNoState{"subkey equalsIgnoreCase
\"state\""}
    RETURN_NULL1(["return null"])
    RET_STRING_SVC(["return String.class"])
    RET_BOOL_SVC(["return Boolean.class"])
    RET_STRING_SYSID(["return String.class"])
    RET_BOOL_SYSID(["return Boolean.class"])
    RET_STRING_SEIKY(["return String.class"])
    RET_BOOL_SEIKY(["return Boolean.class"])
    RETURN_NULL2(["return null"])

    START --> NULLCHECK
    NULLCHECK -->|true| RET_NULL1
    NULLCHECK -->|false| SvcKeiNo
    SvcKeiNo -->|true| SvcKeiNoValue
    SvcKeiNo -->|false| SysIdCheck
    SysIdCheck -->|true| SysIdValue
    SysIdCheck -->|false| SeikyKeiNo
    SeikyKeiNo -->|true| SeikyKeiNoValue
    SeikyKeiNo -->|false| RETURN_NULL2

    SvcKeiNoValue -->|true| RET_STRING_SVC
    SvcKeiNoValue -->|false| SvcKeiNoEnable
    SvcKeiNoEnable -->|true| RET_BOOL_SVC
    SvcKeiNoEnable -->|false| SvcKeiNoState
    SvcKeiNoState -->|true| RET_STRING_SVC
    SvcKeiNoState -->|false| RETURN_NULL1

    SysIdValue -->|true| RET_STRING_SYSID
    SysIdValue -->|false| SysIdEnable
    SysIdEnable -->|true| RET_BOOL_SYSID
    SysIdEnable -->|false| SysIdState
    SysIdState -->|true| RET_STRING_SYSID
    SysIdState -->|false| RETURN_NULL1

    SeikyKeiNoValue -->|true| RET_STRING_SEIKY
    SeikyKeiNoValue -->|false| SeikyKeiNoEnable
    SeikyKeiNoEnable -->|true| RET_BOOL_SEIKY
    SeikyKeiNoEnable -->|false| SeikyKeiNoState
    SeikyKeiNoState -->|true| RET_STRING_SEIKY
    SeikyKeiNoState -->|false| RETURN_NULL2
```

**Processing Flow:**
1. **Null Guard (L336):** If either `key` or `subkey` is null, the method immediately returns `null`.
2. **Separator Extraction (L347):** Computes `separaterPoint = key.indexOf("/")` — this value is calculated but **never used** in the current implementation (dead code).
3. **Field Dispatch (L351–L384):** Three `if/else-if` branches handle each known business field. Each field has three nested subkey checks for `value`, `enable`, and `state`.
4. **Fallback (L384):** If no known key/subkey combination matches, returns `null`.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field name (item display label in Japanese). Identifies which logical data item to resolve the type for. Possible values: `"サービス契約番号"` (Service Contract Number, internal ID: `svc_kei_no`), `"SYSID"` (System ID, internal ID: `sysid`), `"請求契約番号"` (Billing Contract Number, internal ID: `seiky_kei_no`). The value determines which field's type metadata is returned. Case-sensitive comparison. |
| 2 | `subkey` | `String` | The metadata sub-property of the field. Specifies which attribute of the data item to describe. Possible values: `"value"` (the data value itself), `"enable"` (whether the field is editable/active), `"state"` (the field's state/status indicator). Case-insensitive comparison. |

**No instance fields or external state** are read by this method. It is fully stateless and depends only on its input parameters.

## 4. CRUD Operations / Called Services

This method performs **no database operations** and **does not call any external services**. It is a pure data-type routing utility that operates entirely in-memory.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| — | — | — | — | No CRUD operations — this method is a pure in-memory type resolver. |

**Notable:** The local variable `separaterPoint` (L347) is assigned but never used, indicating incomplete cleanup from a planned feature that may have supported slash-separated key paths (e.g., `"svc_kei_no/value"`).

## 5. Dependency Trace

The method `KKW22301SF01DBean.typeModelData(String, String)` is part of a **framework contract** implemented by many DBean classes across the codebase. It is not directly invoked by any specific screen in this search — rather, it is called indirectly by the view/rendering framework at runtime through polymorphic dispatch or reflection-based type resolution.

Multiple DBean classes implement the same `typeModelData(String key, String subkey)` contract:

| # | Caller (DBean Class) | Implementation Notes |
|---|----------------------|---------------------|
| 1 | `FUW00912SF01DBean` | Own implementation — delegates to child beans for `year_list`, `mon_list`, `day_list` |
| 2 | `FUW00912SFBean` | Own implementation with `gamenId` overload — dispatches to `koumoku_code_list`, `koumoku_value_list`, `getsu_ryokin_kmk_list`, `getsu_ryokin_list`, `shoki_hiyo_kmk_list`, `shoki_hiyo_list`, `getsu_ryokin_kei_list` |
| 3 | `FUW00912SF02DBean` | Own implementation |
| 4 | `FUW00926SFBean` | Own implementation with `gamenId` overload — dispatches to `use_bmp_list_list`, `tv_stb_info_list_list`, `koumoku_code_list`, `koumoku_value_list`, `getsu_ryokin_kmk_list`, `getsu_ryokin_list` |
| 5 | `FUW00926SF01DBean` | Own implementation |
| 6 | `FUW00926SF02DBean` | Own implementation |
| 7 | `FUW00926SF03DBean` | Own implementation |
| 8 | `FUW00959SFBean` | Own implementation with `gamenId` overload — dispatches to `campaign_list_list`, `campaign_text_list_list`, `sp_campaign_list_list` |
| 9 | `FUW00959SF01DBean` | Own implementation |
| 10 | `FUW00959SF02DBean` | Own implementation |
| 11 | `FUW00959SF03DBean` | Own implementation |
| 12 | `FUW00959SF04DBean` | Own implementation |
| 13 | `FUW00964SFBean` | Own implementation with `gamenId` overload — dispatches to `svc_gaiyo_info_list`, `vdsl_prc_info_list`, `vdsl_shkh_cmp_info_list` |
| 14 | `FUW00964SF01DBean` | Own implementation — dispatches to `tushinspeed_list` |
| 15 | `FUW00964SF04DBean` | Own implementation — dispatches to modem pricing lists |
| 16 | `FUW00964SF06DBean` | Own implementation |
| 17 | `FUW00964SF07DBean` | Own implementation — dispatches to `gtgk_kihon_prc_list` |
| 18 | `FUW00964SF09DBean` | Own implementation |
| 19 | `FUW00964SF10DBean` | Own implementation — dispatches to pricing lists |
| 20 | `FUW00964SF11DBean` | Own implementation |

The `KKW22301SF01DBean.typeModelData` method in particular does not appear to be directly called by any screen class in the codebase search results. It may be used via reflection, inheritance hierarchy, or at runtime through a framework mechanism not visible in static source analysis.

## 6. Per-Branch Detail Blocks

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

> If either parameter is null, return null immediately. This prevents NullPointerException on subsequent operations.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key or subkey is null [early exit] |

---

**Block 2** — SET (unused variable) (L347)

> Computes the index of "/" within the key string. This value is never used in the current implementation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // unused — likely leftover from planned slash-path support |

---

**Block 3** — IF-ELSE-IF (field dispatch: "サービス契約番号") `(key.equals("サービス契約番号"))` (L351)

> Resolves data type metadata for the Service Contract Number field (item ID: `svc_kei_no`). This is a core business entity representing a service contract line item in the telecom system.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = key.indexOf("/")` // [dead code] |
| 2 | IF | `key.equals("サービス契約番号")` [key equals "サービス契約番号"] |

**Block 3.1** — IF (subkey: "value") `(subkey.equalsIgnoreCase("value"))` (L352)

> For the `value` subkey of the Service Contract Number field, the data type is String.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // service contract number value |

**Block 3.2** — ELSE-IF (subkey: "enable") `(subkey.equalsIgnoreCase("enable"))` (L355)

> For the `enable` subkey of the Service Contract Number field, the data type is Boolean (editable flag).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Boolean.class;` // service contract number enable flag |

**Block 3.3** — ELSE-IF (subkey: "state") `(subkey.equalsIgnoreCase("state"))` (L358)

> For the `state` subkey of the Service Contract Number field, the data type is String. Comment: ステータスを返す (returns the status).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // [ステータスを返す] returns the status |

**Block 3.4** — ELSE (no matching subkey) (L360)

> No known subkey matched for this field. Falls through to the final fallback.

| # | Type | Code |
|---|------|------|
| 1 | implicit | falls through to `return null;` at L384 |

---

**Block 4** — ELSE-IF (field dispatch: "SYSID") `(key.equals("SYSID"))` (L364)

> Resolves data type metadata for the System ID field (item ID: `sysid`). SYSID is a system-level identifier used across telecom service management. Comment: データタイプがStringの項目"SYSID" (Data type is String item "SYSID").

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("SYSID")` [key equals "SYSID"] |

**Block 4.1** — IF (subkey: "value") `(subkey.equalsIgnoreCase("value"))` (L365)

> For the `value` subkey of SYSID, the data type is String.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // SYSID value |

**Block 4.2** — ELSE-IF (subkey: "enable") `(subkey.equalsIgnoreCase("enable"))` (L368)

> For the `enable` subkey of SYSID, the data type is Boolean.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Boolean.class;` // SYSID enable flag |

**Block 4.3** — ELSE-IF (subkey: "state") `(subkey.equalsIgnoreCase("state"))` (L371)

> For the `state` subkey of SYSID, the data type is String. Comment: subkeyが"state"の場合、ステータスを返す (When subkey is "state", returns the status).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // [subkeyが"state"の場合、ステータスを返す] when subkey is "state", returns the status |

**Block 4.4** — ELSE (no matching subkey) (L373)

> Falls through to the final fallback.

| # | Type | Code |
|---|------|------|
| 1 | implicit | falls through to `return null;` at L384 |

---

**Block 5** — ELSE-IF (field dispatch: "請求契約番号") `(key.equals("請求契約番号"))` (L377)

> Resolves data type metadata for the Billing Contract Number field (item ID: `seiky_kei_no`). This represents the billing contract identifier linked to a service contract. Comment: データタイプがStringの項目"請求契約番号" (Data type is String item "Billing Contract Number").

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("請求契約番号")` [key equals "請求契約番号"] |

**Block 5.1** — IF (subkey: "value") `(subkey.equalsIgnoreCase("value"))` (L378)

> For the `value` subkey of the Billing Contract Number field, the data type is String.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // billing contract number value |

**Block 5.2** — ELSE-IF (subkey: "enable") `(subkey.equalsIgnoreCase("enable"))` (L381)

> For the `enable` subkey of the Billing Contract Number field, the data type is Boolean.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Boolean.class;` // billing contract number enable flag |

**Block 5.3** — ELSE-IF (subkey: "state") `(subkey.equalsIgnoreCase("state"))` (L384)

> For the `state` subkey of the Billing Contract Number field, the data type is String. Comment: subkeyが"state"の場合、ステータスを返す (When subkey is "state", returns the status).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return String.class;` // [subkeyが"state"の場合、ステータスを返す] when subkey is "state", returns the status |

**Block 5.4** — ELSE (no matching subkey) (L386)

> Falls through to the final fallback.

| # | Type | Code |
|---|------|------|
| 1 | implicit | falls through to `return null;` at L384 |

---

**Block 6** — ELSE (no matching field) (L389)

> No known field name matched. Returns null as documented in Javadoc: 条件に一致するプロパティが存在しない場合は、nullを返す (If no property matches the condition, returns null).

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // [条件に一致するプロパティが存在しない場合は、nullを返す] no matching property found |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — internal item ID for the "サービス契約番号" (Service Contract Number) field, representing a unique service contract line item identifier |
| `sysid` | Field | System ID — internal item ID for the "SYSID" field, representing a system-level identifier used across telecom service management operations |
| `seiky_kei_no` | Field | Billing contract number — internal item ID for the "請求契約番号" (Billing Contract Number) field, representing the billing contract identifier linked to a service contract |
| DBean | Technical term | Data Bean — a view-layer Java class that holds and exposes data model information (types, labels, metadata) to the web view framework |
| key | Parameter | Business field name — the display label of a form field in Japanese, used to identify which data item's type metadata is being requested |
| subkey | Parameter | Metadata sub-property — specifies which attribute of the data item to describe (`value`, `enable`, or `state`) |
| value | Sub-property | The actual data value type of the field (always `String.class` in this method) |
| enable | Sub-property | Whether the field is editable/active (always `Boolean.class` in this method) |
| state | Sub-property | The field's state or status indicator type (always `String.class` in this method) |
| typeModelData | Method | A framework contract method that returns the Java runtime type (`Class<?>`) for a given field/subkey pair, enabling type-safe data binding |
| サービス契約番号 | Japanese field | Service Contract Number — the human-readable label for the `svc_kei_no` field in the UI |
| 請求契約番号 | Japanese field | Billing Contract Number — the human-readable label for the `seiky_kei_no` field in the UI |
| KKW22301SF | Module | The screen module containing this DBean — a telecom service contract management screen |
