# Business Logic — KKW00844SF01DBean.typeModelData() [137 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW00844SF.KKW00844SF01DBean` |
| Layer | Web View / Data Bean (View layer — part of the X33 framework view data transfer bean) |
| Module | `KKW00844SF` (Package: `eo.web.webview.KKW00844SF`) |

## 1. Role

### KKW00844SF01DBean.typeModelData()

This method serves as the **type resolver** for the X33 view framework's data binding system within the KKW00844SF screen. It maps a field identifier (`key`) and a sub-property name (`subkey`) to the corresponding Java `Class<?>` type, enabling the X33 framework to know what data type to use when rendering or validating form fields on the web page. It implements a **routing/dispatch pattern**: a long if-else chain that checks the `key` against known field names, and then checks the `subkey` to determine whether to return the type for the value property, the state property, or a list metadata property. The method handles **10 distinct business fields** organized into three categories: (1) simple scalar String fields (SYSID, Service Contract Number, Movement Classification, Movement Reason Memo, Processing Classification, Application Number, Application Detail Number) that return `String.class` for "value" or "state" subkeys, (2) list-based fields (Movement Reason Code, Option Service Contract Number) that support indexed access and return `Integer.class` for the count (subkey "star"), and (3) a catch-all path returning `null` for unrecognized field names. Its role is a shared utility within the `DBean` (Data Bean), called by the X33 framework during data binding initialization and validation phases to support dynamic form rendering.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    CHECK_NULL{"key or subkey is null"}
    CHECK_NULL_YES["Return null"]

    SYSID_CHECK{"key equals SYSID"}
    SYSID_VALUE{"subkey equals value"}
    SYSID_RETURN["Return String.class"]

    SVC_CHECK{"key equals サービス契約番号"}
    SVC_VALUE{"subkey equals value"}
    SVC_RETURN["Return String.class"]

    IDO_DIV_CHECK{"key equals 異動区分"}
    IDO_DIV_VALUE{"subkey equals value"}
    IDO_DIV_RETURN["Return String.class"]

    IDO_RSN_CD_CHECK{"key equals 異動理由コード"}
    IDO_RSN_CD_SUB["key = key.substring + 1"]
    IDO_RSN_CD_STAR{"key equals *"}
    IDO_RSN_CD_INTEGER["Return Integer.class"]
    IDO_RSN_CD_PARSE["Integer tmpIndexInt = Integer.valueOf key"]
    IDO_RSN_CD_NPE{"NumberFormatException"}
    IDO_RSN_CD_INDEX_NULL{"tmpIndexInt == null"}
    IDO_RSN_CD_BOUNDS{"tmpIndex >= list size"}
    IDO_RSN_CD_DELEGATE["X33VDataTypeStringBean typeModelData subkey"]
    IDO_RSN_CD_END["Return"]

    IDO_RSN_MEMO_CHECK{"key equals 異動理由メモ"}
    IDO_RSN_MEMO_VALUE{"subkey equals value"}
    IDO_RSN_MEMO_RETURN["Return String.class"]

    OP_SVC_CHECK{"key equals オプションサービス契約番号"}
    OP_SVC_SUB["key = key.substring + 1"]
    OP_SVC_STAR{"key equals *"}
    OP_SVC_INTEGER["Return Integer.class"]
    OP_SVC_PARSE["Integer tmpIndexInt = Integer.valueOf key"]
    OP_SVC_NPE{"NumberFormatException"}
    OP_SVC_INDEX_NULL{"tmpIndexInt == null"}
    OP_SVC_BOUNDS{"tmpIndex >= list size"}
    OP_SVC_DELEGATE["X33VDataTypeStringBean typeModelData subkey"]
    OP_SVC_END["Return"]

    TRAN_DIV_CHECK{"key equals 処理区分"}
    TRAN_DIV_VALUE{"subkey equals value"}
    TRAN_DIV_RETURN["Return String.class"]

    MSKM_NO_CHECK{"key equals 申込番号"}
    MSKM_NO_VALUE{"subkey equals value"}
    MSKM_NO_RETURN["Return String.class"]

    MSKM_DTL_NO_CHECK{"key equals 申込明細番号"}
    MSKM_DTL_NO_VALUE{"subkey equals value"}
    MSKM_DTL_NO_RETURN["Return String.class"]

    NO_MATCH["Return null"]

    START --> CHECK_NULL
    CHECK_NULL -->|Yes| CHECK_NULL_YES
    CHECK_NULL -->|No| SYSID_CHECK

    SYSID_CHECK -->|Yes| SYSID_VALUE
    SYSID_VALUE -->|Yes| SYSID_RETURN
    SYSID_VALUE -->|No| SYSID_STATE
    SYSID_STATE -->|Yes| SYSID_RETURN
    SYSID_STATE -->|No| SVC_CHECK
    SYSID_RETURN --> SVC_CHECK

    SVC_CHECK -->|Yes| SVC_VALUE
    SVC_VALUE -->|Yes| SVC_RETURN
    SVC_VALUE -->|No| SVC_STATE
    SVC_STATE -->|Yes| SVC_RETURN
    SVC_STATE -->|No| IDO_DIV_CHECK
    SVC_RETURN --> IDO_DIV_CHECK

    IDO_DIV_CHECK -->|Yes| IDO_DIV_VALUE
    IDO_DIV_VALUE -->|Yes| IDO_DIV_RETURN
    IDO_DIV_VALUE -->|No| IDO_DIV_STATE
    IDO_DIV_STATE -->|Yes| IDO_DIV_RETURN
    IDO_DIV_STATE -->|No| IDO_RSN_CD_CHECK
    IDO_DIV_RETURN --> IDO_RSN_CD_CHECK

    IDO_RSN_CD_CHECK -->|Yes| IDO_RSN_CD_SUB
    IDO_RSN_CD_SUB --> IDO_RSN_CD_STAR
    IDO_RSN_CD_STAR -->|Yes| IDO_RSN_CD_INTEGER
    IDO_RSN_CD_STAR -->|No| IDO_RSN_CD_PARSE
    IDO_RSN_CD_PARSE --> IDO_RSN_CD_NPE
    IDO_RSN_CD_NPE -->|Yes| IDO_RSN_CD_END
    IDO_RSN_CD_NPE -->|No| IDO_RSN_CD_INDEX_NULL
    IDO_RSN_CD_INDEX_NULL -->|Yes| IDO_RSN_CD_END
    IDO_RSN_CD_INDEX_NULL -->|No| IDO_RSN_CD_BOUNDS
    IDO_RSN_CD_BOUNDS -->|Yes| IDO_RSN_CD_END
    IDO_RSN_CD_BOUNDS -->|No| IDO_RSN_CD_DELEGATE
    IDO_RSN_CD_DELEGATE --> IDO_RSN_CD_END
    IDO_RSN_CD_INTEGER --> IDO_RSN_CD_END
    IDO_RSN_CD_END --> IDO_RSN_MEMO_CHECK

    IDO_RSN_MEMO_CHECK -->|Yes| IDO_RSN_MEMO_VALUE
    IDO_RSN_MEMO_VALUE -->|Yes| IDO_RSN_MEMO_RETURN
    IDO_RSN_MEMO_VALUE -->|No| IDO_RSN_MEMO_STATE
    IDO_RSN_MEMO_STATE -->|Yes| IDO_RSN_MEMO_RETURN
    IDO_RSN_MEMO_STATE -->|No| OP_SVC_CHECK
    IDO_RSN_MEMO_RETURN --> OP_SVC_CHECK

    OP_SVC_CHECK -->|Yes| OP_SVC_SUB
    OP_SVC_SUB --> OP_SVC_STAR
    OP_SVC_STAR -->|Yes| OP_SVC_INTEGER
    OP_SVC_STAR -->|No| OP_SVC_PARSE
    OP_SVC_PARSE --> OP_SVC_NPE
    OP_SVC_NPE -->|Yes| OP_SVC_END
    OP_SVC_NPE -->|No| OP_SVC_INDEX_NULL
    OP_SVC_INDEX_NULL -->|Yes| OP_SVC_END
    OP_SVC_INDEX_NULL -->|No| OP_SVC_BOUNDS
    OP_SVC_BOUNDS -->|Yes| OP_SVC_END
    OP_SVC_BOUNDS -->|No| OP_SVC_DELEGATE
    OP_SVC_DELEGATE --> OP_SVC_END
    OP_SVC_INTEGER --> OP_SVC_END
    OP_SVC_END --> TRAN_DIV_CHECK

    TRAN_DIV_CHECK -->|Yes| TRAN_DIV_VALUE
    TRAN_DIV_VALUE -->|Yes| TRAN_DIV_RETURN
    TRAN_DIV_VALUE -->|No| TRAN_DIV_STATE
    TRAN_DIV_STATE -->|Yes| TRAN_DIV_RETURN
    TRAN_DIV_STATE -->|No| MSKM_NO_CHECK
    TRAN_DIV_RETURN --> MSKM_NO_CHECK

    MSKM_NO_CHECK -->|Yes| MSKM_NO_VALUE
    MSKM_NO_VALUE -->|Yes| MSKM_NO_RETURN
    MSKM_NO_VALUE -->|No| MSKM_NO_STATE
    MSKM_NO_STATE -->|Yes| MSKM_NO_RETURN
    MSKM_NO_STATE -->|No| MSKM_DTL_NO_CHECK
    MSKM_NO_RETURN --> MSKM_DTL_NO_CHECK

    MSKM_DTL_NO_CHECK -->|Yes| MSKM_DTL_NO_VALUE
    MSKM_DTL_NO_VALUE -->|Yes| MSKM_DTL_NO_RETURN
    MSKM_DTL_NO_VALUE -->|No| MSKM_DTL_NO_STATE
    MSKM_DTL_NO_STATE -->|Yes| MSKM_DTL_NO_RETURN
    MSKM_DTL_NO_STATE -->|No| NO_MATCH

    SYSID_STATE{"subkey equals state"}
    SVC_STATE{"subkey equals state"}
    IDO_DIV_STATE{"subkey equals state"}
    IDO_RSN_MEMO_STATE{"subkey equals state"}
    TRAN_DIV_STATE{"subkey equals state"}
    MSKM_NO_STATE{"subkey equals state"}
    MSKM_DTL_NO_STATE{"subkey equals state"}
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field name (item identifier) that determines which business data type is requested. It can be a plain field name such as `"SYSID"` (System ID — internal tracking identifier), `"サービス契約番号"` (Service Contract Number), `"異動区分"` (Movement Classification), `"異動理由コード"` (Movement Reason Code — list-based), `"異動理由メモ"` (Movement Reason Memo), `"オプションサービス契約番号"` (Option Service Contract Number — list-based), `"処理区分"` (Processing Classification), `"申込番号"` (Application Number), or `"申込明細番号"` (Application Detail Number). When the key is `"/"`-delimited (e.g., `"異動理由コード/0"`), it specifies a list item by extracting the index after the first slash. |
| 2 | `subkey` | `String` | The sub-property name within the field. Common values are `"value"` (returns the data type of the actual field value), `"state"` (returns the type of the field's validation/state information — also `String.class`), and `"*"` (used with list fields to request the list size/type — returns `Integer.class`). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `ido_rsn_cd_list` | `X33VDataTypeList` | List of movement reason codes (異動理由コード) — each element is an `X33VDataTypeStringBean` supporting indexed access by integer index or the wildcard "*" to return list size. |
| `op_svc_kei_no_list` | `X33VDataTypeList` | List of option service contract numbers (オプションサービス契約番号) — each element is an `X33VDataTypeStringBean` supporting indexed access similarly to `ido_rsn_cd_list`. |

## 4. CRUD Operations / Called Services

This method does **not** perform any database CRUD operations. It is a pure type-resolution utility — no SC codes, CBS, or entity/table access occurs. All calls are intra-framework delegations to X33 data type beans.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeStringBean.typeModelData` | (X33 Framework) | - | Recursive delegation to individual list element's typeModelData() method for list-based fields (movement reason code, option service contract number). |

**Called helper (pre-computed evidence — substring utility classes, called elsewhere in the bean):**

| - | `JKKAdEditCC.substring` | JKKAdEditCC | - | Utility for string substring operation. |
| - | `JKKAdEdit.substring` | JKKAdEdit | - | Utility for string substring operation. |
| - | `JKKTelnoInfoAddMapperCC.substring` | JKKTelnoInfoAddMapperCC | - | Utility for string substring operation. |
| - | `JDKejbStringEdit.substring` | JDKejbStringEdit | - | Utility for string substring operation. |
| - | `KKW00844SF01DBean.typeModelData` | KKW00844SF01DBean | - | Self-referencing — recursive call via list element delegation. |

## 5. Dependency Trace

No external callers were found in the pre-computed data (only self-references). The X33 framework itself calls this method as part of its data binding protocol when the screen initializes or when it needs to resolve the data type of a specific field.

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | X33 Framework (Data Binding) | Framework view lifecycle -> `X33VDataTypeBeanInterface.typeModelData` -> `KKW00844SF01DBean.typeModelData` | Internal type resolution only — no SC/CRUD endpoints. |

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(null guard)` (L627)

> Guard clause: if either `key` or `subkey` is null, return null immediately. This prevents NullPointerException during subsequent string comparisons.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if (key == null || subkey == null)` |
| 2 | RETURN | `return null;` // early exit when key or subkey is null |

**Block 2** — SET `(extract slash position)` (L631)

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // extract position of first slash for later list-key parsing |

**Block 3** — IF/ELSE-IF CHAIN — Field routing (L634–L756)

> The main dispatch logic. Each branch matches a specific field name (`key`) and returns the appropriate `Class<?>` based on the `subkey`.

### Block 3.1 — IF: `key.equals("SYSID")` (L634) [SYSID = "SYSID" (項目ID:sysid)]

> The field identifier is "SYSID" — the system ID. Both "value" and "state" sub-properties are String type.

| # | Type | Code |
|---|------|------|
| 1 | COND | `if (key.equals("SYSID"))` |
| 2 | IF | `if (subkey.equalsIgnoreCase("value"))` -> `return String.class;` // data value type |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` -> `return String.class;` // state/validation type |

**Block 3.2** — ELSE-IF: `key.equals("サービス契約番号")` (L644) [サービス契約番号 = "サービス契約番号" (項目ID:svc_kei_no)]

> The field identifier is "サービス契約番号" (Service Contract Number). Both "value" and "state" sub-properties are String type.

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

**Block 3.3** — ELSE-IF: `key.equals("異動区分")` (L654) [異動区分 = "異動区分" (項目ID:ido_div)]

> The field identifier is "異動区分" (Movement Classification). Both "value" and "state" sub-properties are String type.

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

**Block 3.4** — ELSE-IF: `key.equals("異動理由コード")` (L664) [異動理由コード = "異動理由コード" (項目ID:ido_rsn_cd)]

> The field identifier is "異動理由コード" (Movement Reason Code). This is a **list-based field** — the key may contain a "/"-delimited index (e.g., "異動理由コード/0"). Special subkey "*" returns list size as Integer. For valid indices, delegates to the list element's `typeModelData()` method.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if (key.equals("異動理由コード"))` |
| 2 | SET | `key = key.substring(separaterPoint + 1);` // extract part after first "/" — index portion |
| 3 | IF | `if (key.equals("*"))` -> `return Integer.class;` // list count request |
| 4 | SET | `Integer tmpIndexInt = null;` |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key);` // parse the index string |
| 6 | CATCH | `catch (NumberFormatException e)` -> `return null;` // invalid index string |
| 7 | IF | `if (tmpIndexInt == null)` -> `return null;` // should not occur after try, but defensive |
| 8 | SET | `int tmpIndex = tmpIndexInt.intValue();` |
| 9 | IF | `if (tmpIndex < 0 || tmpIndex >= ido_rsn_cd_list.size())` -> `return null;` // out-of-bounds index |
| 10 | CALL | `((X33VDataTypeStringBean)ido_rsn_cd_list.get(tmpIndex)).typeModelData(subkey);` // delegate to list element |

**Block 3.5** — ELSE-IF: `key.equals("異動理由メモ")` (L694) [異動理由メモ = "異動理由メモ" (項目ID:ido_rsn_memo)]

> The field identifier is "異動理由メモ" (Movement Reason Memo). Both "value" and "state" sub-properties are String type.

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

**Block 3.6** — ELSE-IF: `key.equals("オプションサービス契約番号")` (L704) [オプションサービス契約番号 = "オプションサービス契約番号" (項目ID:op_svc_kei_no)]

> The field identifier is "オプションサービス契約番号" (Option Service Contract Number). This is a **list-based field** — same pattern as Block 3.4 (Movement Reason Code): key may contain a "/"-delimited index, "*" returns list size, valid indices delegate to `X33VDataTypeStringBean.typeModelData()`.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if (key.equals("オプションサービス契約番号"))` |
| 2 | SET | `key = key.substring(separaterPoint + 1);` // extract part after first "/" — index portion |
| 3 | IF | `if (key.equals("*"))` -> `return Integer.class;` // list count request |
| 4 | SET | `Integer tmpIndexInt = null;` |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key);` // parse the index string |
| 6 | CATCH | `catch (NumberFormatException e)` -> `return null;` // invalid index string |
| 7 | IF | `if (tmpIndexInt == null)` -> `return null;` // defensive check |
| 8 | SET | `int tmpIndex = tmpIndexInt.intValue();` |
| 9 | IF | `if (tmpIndex < 0 || tmpIndex >= op_svc_kei_no_list.size())` -> `return null;` // out-of-bounds index |
| 10 | CALL | `((X33VDataTypeStringBean)op_svc_kei_no_list.get(tmpIndex)).typeModelData(subkey);` // delegate to list element |

**Block 3.7** — ELSE-IF: `key.equals("処理区分")` (L734) [処理区分 = "処理区分" (項目ID:tran_div)]

> The field identifier is "処理区分" (Processing Classification). Both "value" and "state" sub-properties are String type.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if (key.equals("処理区分"))` |
| 2 | IF | `if (subkey.equalsIgnoreCase("value"))` -> `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` -> `return String.class;` // state type |

**Block 3.8** — ELSE-IF: `key.equals("申込番号")` (L744) [申込番号 = "申込番号" (項目ID:mskm_no)]

> The field identifier is "申込番号" (Application Number). Both "value" and "state" sub-properties are String type.

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

**Block 3.9** — ELSE-IF: `key.equals("申込明細番号")` (L754) [申込明細番号 = "申込明細番号" (項目ID:mskm_dtl_no)]

> The field identifier is "申込明細番号" (Application Detail Number). Both "value" and "state" sub-properties are String type.

| # | Type | Code |
|---|------|------|
| 1 | COND | `else if (key.equals("申込明細番号"))` |
| 2 | IF | `if (subkey.equalsIgnoreCase("value"))` -> `return String.class;` |
| 3 | ELSE-IF | `else if (subkey.equalsIgnoreCase("state"))` -> `return String.class;` // state type |

**Block 4** — RETURN `(no match fallback)` (L758)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // no matching field found — fallback return null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `sysid` | Field | System ID — internal tracking identifier for the record |
| `svc_kei_no` | Field | Service Contract Number — the primary identifier for a service contract (サービス契約番号) |
| `ido_div` | Field | Movement Classification — classifies the type of service change/movement (異動区分) |
| `ido_rsn_cd` | Field | Movement Reason Code — the reason code for a service change/movement, stored as a list of items (異動理由コード) |
| `ido_rsn_memo` | Field | Movement Reason Memo — free-text memo for the movement/reason (異動理由メモ) |
| `op_svc_kei_no` | Field | Option Service Contract Number — optional/add-on service contract identifiers, stored as a list (オプションサービス契約番号) |
| `tran_div` | Field | Processing Classification — classification of the processing type (処理区分) |
| `mskm_no` | Field | Application Number — identifier for an application/order (申込番号) |
| `mskm_dtl_no` | Field | Application Detail Number — identifier for a specific line item within an application (申込明細番号) |
| X33 | Acronym | Fujitsu Futurity X33 Web Framework — the enterprise web application framework providing the view data binding infrastructure |
| DBean | Acronym | Data Bean — the view-layer data transfer object that holds screen field values, types, and validation state |
| X33VDataTypeList | Class | X33 framework list data type wrapper — holds a list of `X33VDataTypeBeanInterface` elements for structured data binding |
| X33VDataTypeStringBean | Class | X33 framework bean representing a String data type with value/state sub-properties |
| X33VDataTypeBeanInterface | Interface | X33 framework contract for data type beans — defines `typeModelData(String key, String subkey)` |
| X33VListedBeanInterface | Interface | X33 framework contract for list-type beans — defines list generation behavior |
| "value" | Subkey | Requests the data type of the field's actual value |
| "state" | Subkey | Requests the data type of the field's validation/state metadata |
| "*" | Subkey | Requests the list size/type metadata (used only with list-based fields) |
| "SYSID" | Constant | The literal string key identifier for the system ID field |
