---

# Business Logic — KKW01034SF01DBean.typeModelData() [112 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW01034SF.KKW01034SF01DBean` |
| Layer | Utility / Data Bean (Framework integration — X33V data type routing) |
| Module | `KKW01034SF` (Package: `eo.web.webview.KKW01034SF`) |

## 1. Role

### KKW01034SF01DBean.typeModelData()

This method serves as a **data type dispatcher** within the X33 web framework's data binding layer. It resolves the Java type (`Class<?>`) for a given field key and subkey combination, enabling the framework to correctly type data items during model loading, storage, and screen binding operations. It is called by the screen-level `KKW01034SFBean.typeModelData()` which delegates down from the screen bean to this data bean, forming part of the framework's type introspection mechanism used for form validation, data binding, and dynamic type resolution.

The method implements a **routing/dispatch pattern** — it branches on the `key` parameter to identify the business field being queried, then further branches on the `subkey` parameter to determine which specific aspect of the field's type metadata is being requested (e.g., the field's value type vs. its state/type status). It handles six distinct business field categories: SysID, Service Contract Number, Disconnection Division, Disconnection Reason Code, Disconnection Reason Memo, and Application Number.

Five of these fields follow a simple pattern — they return `String.class` regardless of whether the subkey is `"value"` (the field's data value) or `"state"` (the field's type/status metadata). The **Disconnection Reason Code** (`ido_rsn_cd`) is the most complex: it supports indexed list access, returning `Integer.class` when the subkey is `"*"` (to signal list count) and delegating to individual list item `X33VDataTypeStringBean` instances when the key includes an index suffix (e.g., `"Disconnection Reason Code/3"`). This enables the framework to treat the reason code field as a **repeatable list** whose elements each expose their own type model.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData.key / subkey"])
    START --> CHECK_NULL["key == null || subkey == null"]

    CHECK_NULL -->|Yes| RET_NULL1["Return null"]
    CHECK_NULL -->|No| FIND_SLASH["key.indexOf('/')"]

    FIND_SLASH --> COND_SYSID["key.equals('SysID')"]
    COND_SYSID -->|Yes| SUB_SYSID["subkey.equalsIgnoreCase('value')"]
    SUB_SYSID -->|Yes| RET_SYSID_VALUE["Return String.class"]
    SUB_SYSID -->|No| SUB_SYSID_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_SYSID_STATE -->|Yes| RET_SYSID_STATE["Return String.class"]
    SUB_SYSID_STATE -->|No| COND_SVC["key.equals('Service Contract Number')"]

    COND_SVC -->|Yes| SUB_SVC["subkey.equalsIgnoreCase('value')"]
    SUB_SVC -->|Yes| RET_SVC_VALUE["Return String.class"]
    SUB_SVC -->|No| SUB_SVC_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_SVC_STATE -->|Yes| RET_SVC_STATE["Return String.class"]
    SUB_SVC_STATE -->|No| COND_DIV["key.equals('Disconnection Division')"]

    COND_DIV -->|Yes| SUB_DIV["subkey.equalsIgnoreCase('value')"]
    SUB_DIV -->|Yes| RET_DIV_VALUE["Return String.class"]
    SUB_DIV -->|No| SUB_DIV_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_DIV_STATE -->|Yes| RET_DIV_STATE["Return String.class"]
    SUB_DIV_STATE -->|No| COND_IDO_RSN_CD["key.equals('Disconnection Reason Code')"]

    COND_IDO_RSN_CD -->|Yes| EXTRACT_INDEX["Extract index from key (after separator)"]
    EXTRACT_INDEX --> IDX_ASTERISK["key.equals('*')"]
    IDX_ASTERISK -->|Yes| RET_IDX_COUNT["Return Integer.class (list count)"]
    IDX_ASTERISK -->|No| TRY_PARSE_INT["Integer.valueOf(key)"]
    TRY_PARSE_INT -->|NumberFormatException| RET_NULL_IDX["Return null"]
    TRY_PARSE_INT -->|Success| CHECK_BOUNDS["tmpIndex < 0 || tmpIndex >= ido_rsn_cd_list.size()"]
    CHECK_BOUNDS -->|OutOfBounds| RET_NULL_BOUNDS["Return null"]
    CHECK_BOUNDS -->|Valid| CALL_SUB_TYPE["X33VDataTypeStringBean.typeModelData(subkey)"]
    CALL_SUB_TYPE --> RET_SUB_TYPE["Return subtype result"]

    COND_IDO_RSN_CD -->|No| COND_IDO_RSN_MEMO["key.equals('Disconnection Reason Memo')"]
    COND_IDO_RSN_MEMO -->|Yes| SUB_MEMO["subkey.equalsIgnoreCase('value')"]
    SUB_MEMO -->|Yes| RET_MEMO_VALUE["Return String.class"]
    SUB_MEMO -->|No| SUB_MEMO_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_MEMO_STATE -->|Yes| RET_MEMO_STATE["Return String.class"]
    SUB_MEMO_STATE -->|No| COND_APP_NO["key.equals('Application Number')"]

    COND_APP_NO -->|Yes| SUB_APP["subkey.equalsIgnoreCase('value')"]
    SUB_APP -->|Yes| RET_APP_VALUE["Return String.class"]
    SUB_APP -->|No| SUB_APP_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_APP_STATE -->|Yes| RET_APP_STATE["Return String.class"]
    SUB_APP_STATE -->|No| COND_APP_DTL_NO["key.equals('Application Detail Number')"]

    COND_APP_DTL_NO -->|Yes| SUB_APP_DTL["subkey.equalsIgnoreCase('value')"]
    SUB_APP_DTL -->|Yes| RET_APP_DTL_VALUE["Return String.class"]
    SUB_APP_DTL -->|No| SUB_APP_DTL_STATE["subkey.equalsIgnoreCase('state')"]
    SUB_APP_DTL_STATE -->|Yes| RET_APP_DTL_STATE["Return String.class"]
    SUB_APP_DTL_STATE -->|No| RET_DEFAULT["Return null (no matching property)"]

    COND_SYSID -->|No| COND_SVC
    COND_SVC -->|No| COND_DIV
    COND_DIV -->|No| COND_IDO_RSN_CD
    COND_IDO_RSN_MEMO -->|No| COND_APP_NO
    COND_APP_NO -->|No| COND_APP_DTL_NO
    RET_NULL1 --> END_NODE(["End"])
    RET_SYSID_VALUE --> END_NODE
    RET_SYSID_STATE --> END_NODE
    RET_SVC_VALUE --> END_NODE
    RET_SVC_STATE --> END_NODE
    RET_DIV_VALUE --> END_NODE
    RET_DIV_STATE --> END_NODE
    RET_IDX_COUNT --> END_NODE
    RET_NULL_IDX --> END_NODE
    RET_NULL_BOUNDS --> END_NODE
    RET_SUB_TYPE --> END_NODE
    RET_MEMO_VALUE --> END_NODE
    RET_MEMO_STATE --> END_NODE
    RET_APP_VALUE --> END_NODE
    RET_APP_STATE --> END_NODE
    RET_APP_DTL_VALUE --> END_NODE
    RET_APP_DTL_STATE --> END_NODE
    RET_DEFAULT --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The business field identifier. Can be a simple field name (e.g., `"SysID"`, `"Disconnection Reason Code"`) or a composite key with a slash-separated index (e.g., `"Disconnection Reason Code/0"`, `"Disconnection Reason Code/*"`). Determines which business entity/field the type lookup targets. |
| 2 | `subkey` | `String` | The sub-property selector within the identified field. Typically `"value"` (the data value's type) or `"state"` (the type/status metadata). For the Disconnection Reason Code list field, it is passed through to the individual list item's `typeModelData` method for further resolution. |

**Instance fields accessed:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | The repeatable list of Disconnection Reason Code items. Each element is an `X33VDataTypeStringBean` representing one reason code entry in a dynamic list (e.g., for adding/removing disconnection reasons on a screen). |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Utility call — substring operation (used elsewhere in the class) |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Utility call — substring operation (used elsewhere in the class) |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Utility call — substring operation (used elsewhere in the class) |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Utility call — substring operation (used elsewhere in the class) |
| - | `KKW01034SF01DBean.typeModelData` | KKW01034SF01DBean | - | Recursive typeModelData delegation for list item (see Block 1.1.1 below) |
| - | `X33VDataTypeStringBean.typeModelData` | X33VDataTypeStringBean | - | Delegates to individual list item's typeModelData for subtype resolution |

This method performs **no direct database operations** (C/R/U/D). It is a pure **type introspection utility** — it reads instance state (`ido_rsn_cd_list`) and performs conditional type resolution. It does not invoke any SC (Service Component) or CBS (Common Business Service) components that interact with the database.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKW01034SF (via KKW01034SFBean) | `KKW01034SFBean.typeModelData(gamenId, key, subkey)` -> `KKW01034SFBean.typeModelData(key, subkey)` -> `KKW01034SF01DBean.typeModelData(key, subkey)` | None (no DB interaction) |

**Notes:**
- The sole call path goes through the screen-level bean `KKW01034SFBean`, which provides a typeModelData overload accepting a `gamenId` (screen area ID) parameter and delegates to the overloaded `typeModelData(key, subkey)` method.
- That screen-level bean then delegates to the data bean `KKW01034SF01DBean.typeModelData`.
- This is part of the X33 web framework's data binding lifecycle — the framework calls `typeModelData` during model initialization/validation to determine the expected type of each form field.
- No other external callers exist outside the `KKW01034SF` module.

## 6. Per-Branch Detail Blocks

**Block 1** — IF (null guard) (L564)

> If either `key` or `subkey` is null, return null immediately. This prevents null pointer exceptions downstream and is the framework's standard guard clause.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key == null || subkey == null` |
| 2 | RETURN | `return null` |

**Block 2** — PROCESS (slash separator detection) (L571)

> Determine whether the key contains a slash separator for indexed list access.

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

**Block 3** — IF-ELSE-CHAIN (key field dispatch)

### Block 3.1** — IF-IF (key == "SysID") (L575)

> The SysID field is a simple String-based identifier.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("SysID")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 3.2** — ELSE-IF (key == "Service Contract Number") (L587)

> The Service Contract Number (`svc_kei_no`) field is a simple String-based identifier.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("サービス契約番号")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 3.3** — ELSE-IF (key == "Disconnection Division") (L597)

> The Disconnection Division (`ido_div`) field is a simple String-based identifier, categorizing the type of disconnection.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("異動区分")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 3.4** — ELSE-IF (key == "Disconnection Reason Code") (L617)

> The Disconnection Reason Code (`ido_rsn_cd`) is a **repeatable list field**. It supports two modes:
> - List count mode: subkey is `"*"` — returns `Integer.class` to signal the framework should expect an integer (the list size).
> - Indexed access mode: key includes a numeric suffix (e.g., `"Disconnection Reason Code/2"`) — parses the index, bounds-checks against the list, and delegates to the individual list item's `typeModelData` method.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("異動理由コード")` |
| 2 | SET | `key = key.substring(separaterPoint + 1)` // Extract element after first '/' [-> "Disconnection Reason Code/0" yields "0"] |
| 3 | IF | `key.equals("*")` -> `return Integer.class` |

**Block 3.4.1** — TRY-CATCH (integer parsing) (L631)

> Attempt to parse the extracted key suffix as an integer for list index lookup.

| # | Type | Code |
|---|------|------|
| 1 | SET | `Integer tmpIndexInt = null` |
| 2 | TRY | `tmpIndexInt = Integer.valueOf(key)` |
| 3 | CATCH | `NumberFormatException e` -> `return null` |

**Block 3.4.2** — ELSE (successful parse) (L637)

> After successful parsing, check bounds and delegate to the list item.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `tmpIndexInt == null` -> `return null` |
| 2 | SET | `int tmpIndex = tmpIndexInt.intValue()` |
| 3 | IF | `tmpIndex < 0 || tmpIndex >= ido_rsn_cd_list.size()` -> `return null` |
| 4 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).typeModelData(subkey)` |

**Block 3.5** — ELSE-IF (key == "Disconnection Reason Memo") (L643)

> The Disconnection Reason Memo (`ido_rsn_memo`) field is a simple String-based free-form text field.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("異動理由メモ")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 3.6** — ELSE-IF (key == "Application Number") (L653)

> The Application Number (`mskm_no`) field is a simple String-based identifier.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("申込番号")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 3.7** — ELSE-IF (key == "Application Detail Number") (L663)

> The Application Detail Number (`mskm_dtl_no`) field is a simple String-based identifier.

| # | Type | Code |
|---|------|------|
| 1 | CHECK | `key.equals("申込詳細番号")` |
| 2 | IF | `subkey.equalsIgnoreCase("value")` -> `return String.class` |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("state")` -> `return String.class` |

**Block 4** — ELSE-DEFAULT (no matching field) (L669)

> No condition matched any known field — return null to signal unknown type.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — internal unique identifier for a data record/entity |
| `svc_kei_no` | Field | Service Contract Number — unique identifier for a service contract line item |
| `ido_div` | Field | Disconnection Division — categorizes the type of service change/termination (e.g., suspension, cancellation) |
| `ido_rsn_cd` | Field | Disconnection Reason Code — codes explaining why a service was disconnected; stored as a repeatable list |
| `ido_rsn_memo` | Field | Disconnection Reason Memo — free-text memo field associated with a disconnection reason code |
| `mskm_no` | Field | Application Number — the unique identifier for a customer application/order |
| `mskm_dtl_no` | Field | Application Detail Number — sub-identifier for specific items within an application |
| `key` | Parameter | Business field identifier used for type routing; can be simple (e.g., "SysID") or composite with index (e.g., "Reason Code/2") |
| `subkey` | Parameter | Sub-property selector; typically "value" for the data type or "state" for the type/status metadata |
| `ido_rsn_cd_list` | Instance Field | Repeatable list of Disconnection Reason Code entries; each element is an X33VDataTypeStringBean |
| X33VDataTypeList | Type | Framework collection type for repeatable/iterating data fields on screens |
| X33VDataTypeStringBean | Type | Framework bean type for a single item in a repeatable String field list |
| X33VDataTypeBeanInterface | Type | Framework interface that all data type beans implement for model load/store/type operations |
| X33 Framework | Technical | Fujitsu's web application framework for enterprise screens, providing data binding, validation, and type introspection |
| Value | Subkey | The subkey requesting the field's data value type |
| State | Subkey | The subkey requesting the field's type/status metadata type |
| Screen Bean | Pattern | The top-level data bean for a screen (e.g., KKW01034SFBean) that coordinates all data beans |
| Data Bean | Pattern | A subordinate bean (e.g., KKW01034SF01DBean) handling type/model operations for a specific screen section |
| Disconnection | Business term | Service termination or suspension event; requires a reason code and optional memo |
| Service Contract | Business term | A customer's contracted service line item, which can be created, modified, or disconnected |

---
