# Business Logic — FUW00110SF01DBean.typeModelData() [121 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW00110SF.FUW00110SF01DBean` |
| Layer | UI Bean / View Controller (Web view data binding layer) |
| Module | `FUW00110SF` (Package: `eo.web.webview.FUW00110SF`) |

## 1. Role

### FUW00110SF01DBean.typeModelData()

This method serves as the **type-model resolution router** for the web view data binding framework in the service area management screen (FUW00110SF). It receives a composite `key` string that encodes both a **field category** (such as item count, selected value, item actual value, or item label) and a **list index**, and resolves the `Class<?>` type information for the corresponding data model field. This enables the view layer to determine the correct Java type (Long or String) when rendering or validating dynamic list-based form fields.

The method implements a **dispatch/routing pattern** — it inspects the first segment of the `key` parameter (everything before the first `/` delimiter) to determine which of four list-based categories the request targets, then extracts the index from the second segment and delegates type resolution to the corresponding `X33VDataType` bean stored in one of four instance lists: `list_size_list`, `sel_index_list`, `true_value_list`, or `label_value_list`.

Within the larger system, this method is a **shared utility** called by the view binding machinery when dynamically rendering list-form fields. It allows the framework to introspect the type of nested data model elements without hardcoding type information. The four categories correspond to common UI input patterns: numeric counters (`項目数`), enumerated selection indices (`選択値`), free-form text fields (`項目実値`), and display labels (`項目ラベル`).

If the `key` or `subkey` is null, the method returns null immediately. If the `key` does not match any of the four known categories, it returns null. For wildcard index queries (where the index portion is `*`), it returns `Integer.class` to indicate the list size type.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["typeModelData key, subkey"])

    START --> N["null check
key == null or subkey == null"]
    N -->|null| RETN["return null"]
    N -->|not null| SEP["separaterPoint = key.indexOf
('/')"]

    SEP --> DICOND1{"key.equals
(項目数)"}
    DICOND1 -->|true| ITEM_COUNT["項目数 branch"]
    DICOND1 -->|false| DICOND2{"key.equals
(選択値)"}
    DICOND2 -->|true| SEL_INDEX["選択値 branch"]
    DICOND2 -->|false| DICOND3{"key.equals
(項目実値)"}
    DICOND3 -->|true| TRUE_VALUE["項目実値 branch"]
    DICOND3 -->|false| DICOND4{"key.equals
(項目ラベル)"}
    DICOND4 -->|true| LABEL_VAL["項目ラベル branch"]
    DICOND4 -->|false| RETN

    ITEM_COUNT --> ITEM_STRIP["key = key.substring
(separaterPoint + 1)"]
    ITEM_STRIP --> ITEM_STAR{"key.equals
('*')"}
    ITEM_STAR -->|true| RET_INTEGER1["return Integer.class"]
    ITEM_STAR -->|false| ITEM_PARSE["try Integer.valueOf(key)"]
    ITEM_PARSE --> ITEM_CATCH{"NumberFormatException?
parse fail"}
    ITEM_CATCH -->|true| RETN
    ITEM_CATCH -->|false| ITEM_BOUNDS{tmpIndex < 0
or >= list_size_list.size()}
    ITEM_BOUNDS -->|true| RETN
    ITEM_BOUNDS -->|false| ITEM_DELEGATE["list_size_list.get(tmpIndex)
typeModelData(subkey)"]
    ITEM_DELEGATE --> RETN

    SEL_INDEX --> SEL_STRIP["key = key.substring
(separaterPoint + 1)"]
    SEL_STRIP --> SEL_STAR{"key.equals
('*')"}
    SEL_STAR -->|true| RET_INTEGER2["return Integer.class"]
    SEL_STAR -->|false| SEL_PARSE["try Integer.valueOf(key)"]
    SEL_PARSE --> SEL_CATCH{"NumberFormatException?
parse fail"}
    SEL_CATCH -->|true| RETN
    SEL_CATCH -->|false| SEL_BOUNDS{tmpIndex < 0
or >= sel_index_list.size()}
    SEL_BOUNDS -->|true| RETN
    SEL_BOUNDS -->|false| SEL_DELEGATE["sel_index_list.get(tmpIndex)
typeModelData(subkey)"]
    SEL_DELEGATE --> RETN

    TRUE_VALUE --> TV_STRIP["key = key.substring
(separaterPoint + 1)"]
    TV_STRIP --> TV_STAR{"key.equals
('*')"}
    TV_STAR -->|true| RET_INTEGER3["return Integer.class"]
    TV_STAR -->|false| TV_PARSE["try Integer.valueOf(key)"]
    TV_PARSE --> TV_CATCH{"NumberFormatException?
parse fail"}
    TV_CATCH -->|true| RETN
    TV_CATCH -->|false| TV_BOUNDS{tmpIndex < 0
or >= true_value_list.size()}
    TV_BOUNDS -->|true| RETN
    TV_BOUNDS -->|false| TV_DELEGATE["true_value_list.get(tmpIndex)
typeModelData(subkey)"]
    TV_DELEGATE --> RETN

    LABEL_VAL --> LV_STRIP["key = key.substring
(separaterPoint + 1)"]
    LV_STRIP --> LV_STAR{"key.equals
('*')"}
    LV_STAR -->|true| RET_INTEGER4["return Integer.class"]
    LV_STAR -->|false| LV_PARSE["try Integer.valueOf(key)"]
    LV_PARSE --> LV_CATCH{"NumberFormatException?
parse fail"}
    LV_CATCH -->|true| RETN
    LV_CATCH -->|false| LV_BOUNDS{tmpIndex < 0
or >= label_value_list.size()}
    LV_BOUNDS -->|true| RETN
    LV_BOUNDS -->|false| LV_DELEGATE["label_value_list.get(tmpIndex)
typeModelData(subkey)"]
    LV_DELEGATE --> RETN

    RETN(["return null / next"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | Composite key encoding both the **field category** and a **list index**, formatted as `"CategoryName/index"` (e.g., `"項目数/0"`, `"選択値/*"`). The first segment (before `/`) determines the data category branch, and the second segment specifies which item within that category's list to query. Can be `"*"` for wildcard size queries. |
| 2 | `subkey` | `String` | The sub-key name to pass through to the nested `typeModelData()` call on the resolved list item bean. Used for further type resolution within the selected list item's data model. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `list_size_list` | `List<X33VDataTypeLongBean>` | List of Long-type data beans representing dynamic item counter fields (項目数) — stores the count of elements in a list-based UI component. |
| `sel_index_list` | `List<X33VDataTypeLongBean>` | List of Long-type data beans representing selected index fields (選択値) — stores the index of the currently selected option in a dropdown/radio group. |
| `true_value_list` | `List<X33VDataTypeStringBean>` | List of String-type data beans representing actual text value fields (項目実値) — stores free-form string input values for form fields. |
| `label_value_list` | `List<X33VDataTypeStringBean>` | List of String-type data beans representing label fields (項目ラベル) — stores display label text for form fields. |

## 4. CRUD Operations / Called Services

This method does **not** perform any database CRUD operations, SC calls, or CBS calls. It is a pure **type-resolution utility** that operates entirely within the view bean layer.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `list_size_list.get(int)` | - | In-memory `List<X33VDataTypeLongBean>` | Retrieves the Long-type data bean at the specified index from the item counter list. |
| - | `sel_index_list.get(int)` | - | In-memory `List<X33VDataTypeLongBean>` | Retrieves the Long-type data bean at the specified index from the selected value list. |
| - | `true_value_list.get(int)` | - | In-memory `List<X33VDataTypeStringBean>` | Retrieves the String-type data bean at the specified index from the actual value list. |
| - | `label_value_list.get(int)` | - | In-memory `List<X33VDataTypeStringBean>` | Retrieves the String-type data bean at the specified index from the label list. |
| - | `X33VDataTypeLongBean.typeModelData(String)` | - | `X33VDataTypeLongBean` (nested bean) | Delegates type resolution to the resolved list item's own `typeModelData()` method for further sub-key lookup. |
| - | `X33VDataTypeStringBean.typeModelData(String)` | - | `X33VDataTypeStringBean` (nested bean) | Delegates type resolution to the resolved list item's own `typeModelData()` method for further sub-key lookup. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | FUW00110SF01DBean | `FUW00110SF01DBean.typeModelData(String, String)` | `list_size_list.get()` → `X33VDataTypeLongBean.typeModelData()` |
| 2 | FUW00110SF01DBean | `FUW00110SF01DBean.typeModelData(String, String)` | `sel_index_list.get()` → `X33VDataTypeLongBean.typeModelData()` |
| 3 | FUW00110SF01DBean | `FUW00110SF01DBean.typeModelData(String, String)` | `true_value_list.get()` → `X33VDataTypeStringBean.typeModelData()` |
| 4 | FUW00110SF01DBean | `FUW00110SF01DBean.typeModelData(String, String)` | `label_value_list.get()` → `X33VDataTypeStringBean.typeModelData()` |

**Note:** The pre-extracted caller analysis shows that `FUW00110SF01DBean` calls `typeModelData` internally (self-referential delegation through nested `X33VDataType` beans). No external screens or batches directly invoke this method — it is consumed by the view binding infrastructure as a type introspection utility.

## 6. Per-Branch Detail Blocks

### Block 1 — IF (null guard) (L445)

> Guard clause: if either parameter is null, return null immediately.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (key == null || subkey == null)` // Null guard — early return for missing input |
| 2 | RETURN | `return null;` // No data type information available |

### Block 2 — SET (delimiter extraction) (L449)

> Extract the position of the `/` separator from the key string.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/")` // Find position of delimiter in key |

### Block 3 — IF/ELSE-IF/ELSE (Category dispatch) (L452)

> Branch on the first segment of the key to determine the field category. Each of the four branches follows an identical pattern: extract the index from the key, parse it as an integer, validate bounds, and delegate to the corresponding list's `typeModelData()` method.

#### Block 3.1 — IF (`key.equals("項目数")` [項目数="item count"]) (L452)

> Item Count branch (Long型): resolves the type of a list item counter field.
> Example key format: `"項目数/0"` — resolves the data type for the counter of the first list item.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extract index portion after "/" |
| 2 | IF | `if (key.equals("*"))` // Wildcard index for size query |
| 3 | RETURN | `return Integer.class;` // List size is an Integer |
| 4 | SET | `Integer tmpIndexInt = null` // Initialize parse target |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key)` // Parse index as integer |
| 6 | CATCH | `catch (NumberFormatException e)` // Index is not a numeric string |
| 7 | RETURN | `return null;` // Invalid index format |
| 8 | IF | `if (tmpIndexInt == null)` // Parse produced null |
| 9 | RETURN | `return null;` // Null parse result |
| 10 | SET | `int tmpIndex = tmpIndexInt.intValue()` // Unwrap to primitive int |
| 11 | IF | `if (tmpIndex < 0 || tmpIndex >= list_size_list.size())` // Index out of bounds |
| 12 | RETURN | `return null;` // Index exceeds list range |
| 13 | RETURN | `((X33VDataTypeLongBean) list_size_list.get(tmpIndex)).typeModelData(subkey)` // Delegate to nested Long-type bean |

#### Block 3.2 — ELSE-IF (`key.equals("選択値")` [選択値="selected value"]) (L483)

> Selected Value branch (Long型): resolves the type of a selection index field (e.g., dropdown/radio selection).
> Example key format: `"選択値/2"` — resolves the data type for the index of the third selected option.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extract index portion after "/" |
| 2 | IF | `if (key.equals("*"))` // Wildcard index for size query |
| 3 | RETURN | `return Integer.class;` // List size is an Integer |
| 4 | SET | `Integer tmpIndexInt = null` // Initialize parse target |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key)` // Parse index as integer |
| 6 | CATCH | `catch (NumberFormatException e)` // Index is not a numeric string |
| 7 | RETURN | `return null;` // Invalid index format |
| 8 | IF | `if (tmpIndexInt == null)` // Parse produced null |
| 9 | RETURN | `return null;` // Null parse result |
| 10 | SET | `int tmpIndex = tmpIndexInt.intValue()` // Unwrap to primitive int |
| 11 | IF | `if (tmpIndex < 0 || tmpIndex >= sel_index_list.size())` // Index out of bounds |
| 12 | RETURN | `return null;` // Index exceeds list range |
| 13 | RETURN | `((X33VDataTypeLongBean) sel_index_list.get(tmpIndex)).typeModelData(subkey)` // Delegate to nested Long-type bean |

#### Block 3.3 — ELSE-IF (`key.equals("項目実値")` [項目実値="item actual value"]) (L514)

> Item Actual Value branch (String型): resolves the type of a free-form text input field.
> Example key format: `"項目実値/1"` — resolves the data type for the actual string value of the second list item.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extract index portion after "/" |
| 2 | IF | `if (key.equals("*"))` // Wildcard index for size query |
| 3 | RETURN | `return Integer.class;` // List size is an Integer |
| 4 | SET | `Integer tmpIndexInt = null` // Initialize parse target |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key)` // Parse index as integer |
| 6 | CATCH | `catch (NumberFormatException e)` // Index is not a numeric string |
| 7 | RETURN | `return null;` // Invalid index format |
| 8 | IF | `if (tmpIndexInt == null)` // Parse produced null |
| 9 | RETURN | `return null;` // Null parse result |
| 10 | SET | `int tmpIndex = tmpIndexInt.intValue()` // Unwrap to primitive int |
| 11 | IF | `if (tmpIndex < 0 || tmpIndex >= true_value_list.size())` // Index out of bounds |
| 12 | RETURN | `return null;` // Index exceeds list range |
| 13 | RETURN | `((X33VDataTypeStringBean) true_value_list.get(tmpIndex)).typeModelData(subkey)` // Delegate to nested String-type bean |

#### Block 3.4 — ELSE-IF (`key.equals("項目ラベル")` [項目ラベル="item label"]) (L545)

> Item Label branch (String型): resolves the type of a display label field.
> Example key format: `"項目ラベル/3"` — resolves the data type for the label text of the fourth list item.

| # | Type | Code |
|---|------|------|
| 1 | SET | `key = key.substring(separaterPoint + 1)` // Extract index portion after "/" |
| 2 | IF | `if (key.equals("*"))` // Wildcard index for size query |
| 3 | RETURN | `return Integer.class;` // List size is an Integer |
| 4 | SET | `Integer tmpIndexInt = null` // Initialize parse target |
| 5 | TRY | `tmpIndexInt = Integer.valueOf(key)` // Parse index as integer |
| 6 | CATCH | `catch (NumberFormatException e)` // Index is not a numeric string |
| 7 | RETURN | `return null;` // Invalid index format |
| 8 | IF | `if (tmpIndexInt == null)` // Parse produced null |
| 9 | RETURN | `return null;` // Null parse result |
| 10 | SET | `int tmpIndex = tmpIndexInt.intValue()` // Unwrap to primitive int |
| 11 | IF | `if (tmpIndex < 0 || tmpIndex >= label_value_list.size())` // Index out of bounds |
| 12 | RETURN | `return null;` // Index exceeds list range |
| 13 | RETURN | `((X33VDataTypeStringBean) label_value_list.get(tmpIndex)).typeModelData(subkey)` // Delegate to nested String-type bean |

#### Block 3.5 — ELSE (unknown category) (L575)

> Fallback: if the key does not match any known category, return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // Unknown category — no data type information available |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `項目数` | Field (Japanese) | Item Count — represents the count/size of elements in a dynamic list-based UI field (Long型 / Long type) |
| `選択値` | Field (Japanese) | Selected Value — represents the index of the currently selected option in a dropdown, radio button group, or enumeration selector (Long型 / Long type) |
| `項目実値` | Field (Japanese) | Item Actual Value — represents the actual free-form string input value entered by a user in a text field (String型 / String type) |
| `項目ラベル` | Field (Japanese) | Item Label — represents the display label text associated with a form field (String型 / String type) |
| `list_size_list` | Field | List of Long-type data beans for item count fields — stores type metadata for dynamic list counters |
| `sel_index_list` | Field | List of Long-type data beans for selected index fields — stores type metadata for selection/radio/dropdown indices |
| `true_value_list` | Field | List of String-type data beans for actual value fields — stores type metadata for free-form text inputs |
| `label_value_list` | Field | List of String-type data beans for label fields — stores type metadata for field display labels |
| `X33VDataTypeLongBean` | Class | Long-type data type bean — a nested bean that holds type model information for Long (numeric) data fields in the view layer |
| `X33VDataTypeStringBean` | Class | String-type data type bean — a nested bean that holds type model information for String (text) data fields in the view layer |
| `typeModelData` | Method | Type model data resolution — introspects and returns the Java `Class<?>` type for a given key/subkey pair, enabling the view framework to determine field types at runtime |
| `X33V` | Acronym | View component naming convention — the `X33V` prefix denotes a UI view-type bean in the application's component architecture |
| `key` | Parameter | Composite key string encoding both a field category and list index, formatted as `"Category/index"` |
| `subkey` | Parameter | Sub-key string passed through to nested bean's `typeModelData()` for further type resolution within a list item |
| `Integer.class` | Return value | Indicates that the resolved type is `Integer` (used for wildcard `*` index queries to return list size type) |
| `/` | Delimiter | Slash character that separates the category name from the index in the composite `key` string |
