# Business Logic — FUW00943SF02DBean.typeModelData() [113 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00943SF.FUW00943SF02DBean` |
| Layer | View / Data Bean (Web Client DTO layer) |
| Module | `FUW00943SF` (Package: `eo.web.webview.FUW00943SF`) |

## 1. Role

### FUW00943SF02DBean.typeModelData()

This method is the central type-resolution dispatcher for survey (questionnaire/アンケート) data fields within the `FUW00943SF` screen's data bean. In the X33V framework, every data field bound to the view layer must declare its Java runtime type so that the framework can instantiate the correct `X33VDataTypeBean` wrapper (e.g., `X33VDataTypeStringBean`, `X33VDataTypeBooleanBean`) for rendering and data binding. The `typeModelData` method fulfills this contract by accepting a field name (`key`) and a property sub-key (`subkey`) and returning the corresponding `Class<?>` type.

The method implements a **routing/dispatch pattern**: it branches on the Japanese key name (e.g., "アンケート内容" for survey content, "ラジオボタン選択値" for radio button selection value) and returns one of `String.class`, `Boolean.class`, or `Integer.class` based on which sub-key is requested. Each simple field supports three sub-properties: `value` (the data value), `enable` (whether the field is editable), and `state` (a status flag). For the special survey answer list field ("アンケート回答リスト"), the method recursively delegates to the list item's own `typeModelData` implementation, enabling dynamic resolution of nested survey answers.

As a framework-integrated bean method, this serves as a **shared utility** called by the X33V view rendering engine and the list-instantiation logic (`addListDataInstance`). It has no external service calls or database operations -- it is a pure type lookup, ensuring the framework always knows the expected types for survey field properties.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])
    NULL_CHECK["key == null or subkey == null?"]
    SEP["separaterPoint = key.indexOf('/')"]

    NULL_RETURN1["return null"]

    CASE_ANKEI_CONTENT["key = 'アンケート内容'"]
    CASE_ANKEI_CHK["key = 'アンケートチェック種類'"]
    CASE_ANKEI_NO["key = 'アンケート番号'"]
    CASE_DSP_JUN["key = '表示順序（アンケート内容）'"]
    CASE_RADIO["key = 'ラジオボタン選択値'"]
    CASE_ANKEI_LIST["key = 'アンケート回答リスト'"]

    SUB_VALUE["subkey = 'value' (case-insensitive)"]
    SUB_ENABLE["subkey = 'enable' (case-insensitive)"]
    SUB_STATE["subkey = 'state' (case-insensitive)"]

    RETURN_STRING["return String.class"]
    RETURN_BOOL["return Boolean.class"]

    ANKEI_LIST_CHECK["keyRemain = key.substring(separaterPoint+1)"]
    STAR_CHECK["keyRemain = '*'?"]
    STAR_RETURN["return Integer.class"]
    SEP2["separaterPoint = keyRemain.indexOf('/')"]
    SEP2_CHECK["separaterPoint <= 0?"]
    SEP2_RETURN["return null"]
    PARSE_INDEX["key = keyRemain.substring(0, separaterPoint)
tmpIndexInt = Integer.valueOf(key)"]
    PARSE_CATCH["catch NumberFormatException"]
    PARSE_RETURN["return null"]
    RANGE_CHECK["0 <= tmpIndex < enquete_answer_list_list.size()?"]
    RANGE_RETURN["return null"]
    RECURSE_KEY["key = keyRemain.substring(separaterPoint+1)"]
    RECURSE_CALL["enquete_answer_list_list.get(tmpIndex).typeModelData(key, subkey)"]

    FALLBACK["return null"]

    START --> NULL_CHECK
    NULL_CHECK -->|true| NULL_RETURN1
    NULL_CHECK -->|false| SEP

    SEP --> CASE_ANKEI_CONTENT
    CASE_ANKEI_CONTENT --> SUB_VALUE
    SUB_VALUE --> RETURN_STRING
    CASE_ANKEI_CONTENT --> SUB_ENABLE
    SUB_ENABLE --> RETURN_BOOL
    CASE_ANKEI_CONTENT --> SUB_STATE
    SUB_STATE --> RETURN_STRING

    CASE_ANKEI_CONTENT --> CASE_ANKEI_CHK
    CASE_ANKEI_CHK --> SUB_VALUE
    CASE_ANKEI_CHK --> SUB_ENABLE
    CASE_ANKEI_CHK --> SUB_STATE

    CASE_ANKEI_CHK --> CASE_ANKEI_NO
    CASE_ANKEI_NO --> SUB_VALUE
    CASE_ANKEI_NO --> SUB_ENABLE
    CASE_ANKEI_NO --> SUB_STATE

    CASE_ANKEI_NO --> CASE_DSP_JUN
    CASE_DSP_JUN --> SUB_VALUE
    CASE_DSP_JUN --> SUB_ENABLE
    CASE_DSP_JUN --> SUB_STATE

    CASE_DSP_JUN --> CASE_RADIO
    CASE_RADIO --> SUB_VALUE
    CASE_RADIO --> SUB_ENABLE
    CASE_RADIO --> SUB_STATE

    CASE_RADIO --> CASE_ANKEI_LIST
    CASE_ANKEI_LIST --> ANKEI_LIST_CHECK
    ANKEI_LIST_CHECK --> STAR_CHECK
    STAR_CHECK -->|true| STAR_RETURN
    STAR_CHECK -->|false| SEP2
    SEP2 --> SEP2_CHECK
    SEP2_CHECK -->|true| SEP2_RETURN
    SEP2_CHECK -->|false| PARSE_INDEX
    PARSE_INDEX --> PARSE_CATCH
    PARSE_CATCH --> PARSE_RETURN
    PARSE_INDEX --> RANGE_CHECK
    RANGE_CHECK -->|false| RANGE_RETURN
    RANGE_CHECK -->|true| RECURSE_KEY
    RECURSE_KEY --> RECURSE_CALL

    CASE_ANKEI_LIST --> FALLBACK
```

**Branch Summary:**

| Key (フィールド名) | Business Meaning | Supported subkeys | Return Type |
|---|---|---|---|
| "アンケート内容" | Survey Content | `value`, `enable`, `state` | String / Boolean / String |
| "アンケートチェック種類" | Survey Check Type | `value`, `enable`, `state` | String / Boolean / String |
| "アンケート番号" | Survey Number | `value`, `enable`, `state` | String / Boolean / String |
| "表示順序（アンケート内容）" | Display Order (Survey Content) | `value`, `enable`, `state` | String / Boolean / String |
| "ラジオボタン選択値" | Radio Button Selection Value | `value`, `enable`, `state` | String / Boolean / String |
| "アンケート回答リスト" | Survey Answer List | Delegates to each list item | Integer / Delegated Type / null |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The field name of a survey (questionnaire) data item. Determines which survey field's type metadata to resolve. Values include Japanese field identifiers: "アンケート内容" (survey content), "アンケートチェック種類" (survey check type), "アンケート番号" (survey number), "表示順序（アンケート内容）" (display order), "ラジオボタン選択値" (radio button selection value), or "アンケート回答リスト" (survey answer list). For the answer list, an additional slash-delimited path (e.g., "アンケート回答リスト/0/プロンリスト/0/プラン名") may be passed to resolve nested list item fields. |
| 2 | `subkey` | `String` | The property within the field whose type is being queried. Values: `value` (the field's actual data value), `enable` (whether the field is currently editable), or `state` (the field's state/status indicator). Case-insensitive comparison is used. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `enquete_answer_list_list` | `X33VDataTypeList` | The dynamic list of survey answer entries. Used when `key` is "アンケート回答リスト" to iterate over list items and delegate type resolution to each item's own `typeModelData` implementation. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `X33VDataTypeBeanInterface.typeModelData` | N/A (Framework Interface) | N/A | Recursive delegation to survey answer list item's type resolution |

**Analysis:**

This method performs **no database operations, no SC/CBS calls, and no entity access**. It is a pure in-memory type lookup and dispatch method. The only external call it makes is a recursive invocation of `typeModelData` on elements of the `enquete_answer_list_list`, which delegates to the `X33VDataTypeBeanInterface` implementation of each list item bean (`FUW00943SF06DBean`), not to any service component or database layer.

The method relies entirely on the X33V framework's bean infrastructure (`X33VDataTypeList`, `X33VDataTypeBeanInterface`) for its recursive behavior.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | N/A (Self-recursive) | `FUW00943SF02DBean.typeModelData` (recursive via list item) | `enquete_answer_list_list.get(i).typeModelData [R] X33VDataTypeBeanInterface` |

**Notes:** This method is not directly called by any external caller (screen, batch, or CBS). It is invoked exclusively through the X33V framework's view binding mechanism (which calls `typeModelData` on data beans during rendering) and by its own recursive list-item resolution when handling "アンケート回答リスト" keys. The pre-computed caller data confirms no external callers beyond self-recursion.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null or subkey == null)` (L546)

> Guard clause: if either parameter is null, return null immediately. This prevents NPE in the subsequent string operations.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key or subkey is null, no type to resolve |

---

**Block 2** — [EXEC] `(separaterPoint = key.indexOf('/'))` (L552)

> Extract the position of the first slash in the key. This is used later for slash-delimited paths in the "アンケート回答リスト" (Answer List) recursive case.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Find first '/' separator |

---

**Block 3** — [IF / ELSE-IF / ELSE-IF / ELSE-IF / ELSE-IF / ELSE-IF] `(key equals branch)` (L555–647)

> Six mutually exclusive branches based on the exact `key` value. Each simple-field branch checks the `subkey` to return the appropriate type. The answer list branch (Block 3.6) has additional nested logic for recursive type resolution.

### Block 3.1 — [IF] `(key.equals("アンケート内容"))` [アンケート内容 = "Survey Content"] (L555)

> Type information for the survey content field. Item ID: `enquete_content`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return String.class;` // Survey content value is a string |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return Boolean.class;` // Whether survey content is editable |
| 5 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す |
| 6 | RETURN | `return String.class;` // Survey content state flag is a string |

---

### Block 3.2 — [ELSE-IF] `(key.equals("アンケートチェック種類"))` [アンケートチェック種類 = "Survey Check Type"] (L567)

> Type information for the survey check type field. Item ID: `enquete_chk_sbt`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return String.class;` // Check type value is a string |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return Boolean.class;` // Whether check type is editable |
| 5 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す |
| 6 | RETURN | `return String.class;` // Check type state flag is a string |

---

### Block 3.3 — [ELSE-IF] `(key.equals("アンケート番号"))` [アンケート番号 = "Survey Number"] (L579)

> Type information for the survey number field. Item ID: `enquete_content_no`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return String.class;` // Survey number value is a string |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return Boolean.class;` // Whether survey number is editable |
| 5 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す |
| 6 | RETURN | `return String.class;` // Survey number state flag is a string |

---

### Block 3.4 — [ELSE-IF] `(key.equals("表示順序（アンケート内容）"))` [表示順序 = "Display Order (Survey Content)"] (L591)

> Type information for the display order field controlling the sequence in which survey content items appear. Item ID: `dsp_jun_content`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return String.class;` // Display order value is a string |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return Boolean.class;` // Whether display order is editable |
| 5 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す |
| 6 | RETURN | `return String.class;` // Display order state flag is a string |

---

### Block 3.5 — [ELSE-IF] `(key.equals("ラジオボタン選択値"))` [ラジオボタン選択値 = "Radio Button Selection Value"] (L603)

> Type information for the radio button selection field. Item ID: `radio_value`.

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `subkey.equalsIgnoreCase("value")` |
| 2 | RETURN | `return String.class;` // Radio button selection value is a string |
| 3 | ELSE-IF | `subkey.equalsIgnoreCase("enable")` |
| 4 | RETURN | `return Boolean.class;` // Whether radio button is editable |
| 5 | ELSE-IF | `subkey.equalsIgnoreCase("state")` // subkeyが"state"の場合、ステータスを返す |
| 6 | RETURN | `return String.class;` // Radio button state flag is a string |

---

### Block 3.6 — [ELSE-IF] `(key.equals("アンケート回答リスト"))` [アンケート回答リスト = "Survey Answer List"] (L615)

> Type information for the survey answer list field. This is a **dynamic/nested** field: the key uses slash-delimited path syntax (e.g., "アンケート回答リスト/0/プロンリスト/0/プラン名") to reference a specific list item's sub-field. The method resolves the path components to determine which list item to delegate to and which property of that item to query.

**Block 3.6.1** — [SET] `(keyRemain = key.substring(separaterPoint + 1))` (L618)

> Extract the portion of the key after the first "/". For example, from "アンケート回答リスト/0/プロンリスト/0/プラン名" this yields "0/プロンリスト/0/プラン名".

| # | Type | Code |
|---|------|------|
| 1 | SET | `String keyRemain = key.substring(separaterPoint + 1);` // Get portion after first '/' |

---

**Block 3.6.2** — [IF] `(keyRemain.equals("*"))` (L621)

> If the wildcard "*" is specified as the index placeholder, return the count of list elements as an Integer. This allows the view layer to determine how many answer entries exist.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return Integer.class;` // List element count type |

---

**Block 3.6.3** — [SET] `(separaterPoint = keyRemain.indexOf("/"))` (L624)

> Find the next "/" separator within `keyRemain` to extract the list index.

| # | Type | Code |
|---|------|------|
| 1 | SET | `separaterPoint = keyRemain.indexOf("/");` // Find next separator in remaining path |

---

**Block 3.6.4** — [IF] `(separaterPoint <= 0)` (L626)

> If no "/" was found (separator not found, or invalid location), the path is malformed -- return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Separator not found, or invalid path -- here returns null |

---

**Block 3.6.5** — [SET] `(index extraction)` (L628–629)

> Extract the index substring and attempt to parse it as an integer. This is the list position within `enquete_answer_list_list`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = keyRemain.substring(0, separaterPoint);` // Extract index portion |
| 2 | SET | `Integer tmpIndexInt = null;` // Initialize index holder |
| 3 | TRY-CATCH | `tmpIndexInt = Integer.valueOf(key);` // Parse index from string |

---

**Block 3.6.6** — [CATCH] `(NumberFormatException e)` (L634)

> If the index portion is not a valid integer, return null. The path does not reference a valid list element.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Index value is not a valid number string -- here returns null |

---

**Block 3.6.7** — [IF] `(tmpIndexInt == null)` (L636)

> Defensive check: if the parsed index is null (should not happen after successful parse), return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Parsed index is null |

---

**Block 3.6.8** — [IF] `(tmpIndex < 0 || tmpIndex >= enquete_answer_list_list.size())` (L640)

> Validate that the index is within bounds. If the index exceeds the list size minus 1, return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Index exceeds list count - 1 -- here returns null |

---

**Block 3.6.9** — [SET + CALL] `(recursive delegation)` (L643–645)

> Reconstruct the key to point to the sub-field within the list item, then delegate to that item's `typeModelData`. The item is cast to `X33VDataTypeBeanInterface` (implemented by `FUW00943SF06DBean`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = keyRemain.substring(separaterPoint + 1);` // Extract sub-field name portion |
| 2 | CALL | `((X33VDataTypeBeanInterface)enquete_answer_list_list.get(tmpIndex)).typeModelData(key, subkey);` // Delegate to list item bean for type resolution |

> This is a recursive call into the nested data bean (`FUW00943SF06DBean`), passing only the sub-field name and subkey. The nested bean's own `typeModelData` resolves the type for that specific sub-field.

---

**Block 4** — [RETURN] `(fallback)` (L649)

> If no condition matched, return null. There is no matching property type for the given key.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // No matching property found for the given key -- here returns null |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `enquete_content_value` | Field | Survey content value — the actual text content of a survey answer |
| `enquete_content_enabled` | Field | Survey content enabled flag — whether the survey content field is editable |
| `enquete_content_state` | Field | Survey content state flag — status indicator for the survey content field |
| `enquete_chk_sbt_value` | Field | Survey check type value — the type/category of a survey check item |
| `enquete_chk_sbt` | Field ID | Survey check type — Item ID: `enquete_chk_sbt` |
| `enquete_content_no_value` | Field | Survey number value — the sequence/ID number assigned to a survey entry |
| `enquete_content_no` | Field ID | Survey number — Item ID: `enquete_content_no` |
| `dsp_jun_content_value` | Field | Display order value — the sort order for displaying survey content items |
| `dsp_jun_content` | Field ID | Display order (Survey Content) — Item ID: `dsp_jun_content` |
| `radio_value_value` | Field | Radio button selection value — the selected option from a radio button group; default: "1" |
| `radio_value` | Field ID | Radio button selection value — Item ID: `radio_value` |
| `enquete_answer_list_list` | Field | Survey answer list — dynamic list of survey answer entries, each wrapped in a `X33VDataTypeBeanInterface` implementation |
| `enquete_answer_list` | Field ID | Survey answer list — Item ID: `enquete_answer_list`; supports slash-delimited path resolution (e.g., `/0/field`) for nested item access |
| アンケート内容 | Japanese | Survey Content — a survey question's text content field |
| アンケートチェック種類 | Japanese | Survey Check Type — the type/category classification of a survey check item |
| アンケート番号 | Japanese | Survey Number — the sequential number assigned to a survey entry |
| 表示順序（アンケート内容） | Japanese | Display Order (Survey Content) — the ordering key for displaying survey content items |
| ラジオボタン選択値 | Japanese | Radio Button Selection Value — the user's selection from a radio button group |
| アンケート回答リスト | Japanese | Survey Answer List — a dynamic list of user survey answers, each with nested sub-fields |
| `X33VDataTypeBeanInterface` | Interface | X33V Framework Data Type Bean Interface — defines `typeModelData` and `loadModelData` contracts for view-layer data beans |
| `X33VDataTypeList` | Class | X33V Framework Data Type List — a typed list container for survey answer entries |
| `X33VDataTypeStringBean` | Class | X33V String Data Type Bean — wraps String values for view binding |
| `X33VDataTypeBooleanBean` | Class | X33V Boolean Data Type Bean — wraps Boolean values for view binding |
| `X31CBaseBean` | Class | X31 Framework Base Bean — the base class for all view beans in the X31 framework |
| `X33SException` | Class | X33 Framework Exception — checked exception for service-layer errors in the X33 framework |
| `value` | Subkey | Data value — the actual data value of a field |
| `enable` | Subkey | Editable flag — indicates whether a field is currently editable by the user |
| `state` | Subkey | Status flag — a status indicator for the field (returns String) |
