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

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

## 1. Role

### FUW00110SF01DBean.loadModelData()

This method serves as a **unified routing dispatcher** for retrieving typed data from a web view's item model. The view model manages four categories of item collections: item count (`項目数`), selected index (`選択値`), item actual values (`項目実値`), and item labels (`項目ラベル`). Each collection is stored as a typed list — `X33VDataTypeLongBean` for counts and selected indices, and `X33VDataTypeStringBean` for actual values and labels.

The method implements the **routing/dispatch pattern**: it parses a two-part key string (item type and index, separated by `/`), identifies which collection category the key refers to, and then delegates the actual data retrieval to the appropriate list element's own `loadModelData(subkey)` method. This allows deeply nested view data structures to be accessed through a single, uniform API — a key design principle in large telecom billing views where dozens of dynamic item lists must be accessed by screen components without knowing internal collection types.

Its **role in the larger system** is as a shared utility on the view bean, called by downstream processing code that needs to read or traverse the view model's data. It is the primary (and possibly sole) public read entry point for accessing the view's item collections. The method itself is read-only and performs no database or service component calls; it operates entirely on in-memory data structures.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> NCHK["NCHK: key == null or subkey == null"]
    NCHK --> |Yes| NULLRET["Return null"]
    NCHK --> |No| SEP["sep = key.indexOf /"]

    SEP --> KTYPE["key type check"]

    KTYPE --> |Item Count| ITEM_COUNT["Key = Item Count"]
    KTYPE --> |Selected Value| SELECTED_VAL["Key = Selected Value"]
    KTYPE --> |Item Actual Value| ITEM_ACTUAL["Key = Item Actual Value"]
    KTYPE --> |Item Label| ITEM_LABEL["Key = Item Label"]
    KTYPE --> |None| DEFAULT["Return null"]

    ITEM_COUNT --> SUB1["key = key.substring sep + 1"]
    SUB1 --> WILD1{"key == *"}
    WILD1 --> |Yes| SIZE1["Return list_size_list.size"]
    WILD1 --> |No| PARSE1{"parse key as int"}
    PARSE1 --> |Fail| PARSE_FAIL1["Return null"]
    PARSE1 --> |Success| BOUND1{"index valid"}
    BOUND1 --> |No| BOUND_FAIL1["Return null"]
    BOUND1 --> |Yes| DELEG1["list_size_list.get index
.loadModelData subkey"]

    SELECTED_VAL --> SUB2["key = key.substring sep + 1"]
    SUB2 --> WILD2{"key == *"}
    WILD2 --> |Yes| SIZE2["Return sel_index_list.size"]
    WILD2 --> |No| PARSE2{"parse key as int"}
    PARSE2 --> |Fail| PARSE_FAIL2["Return null"]
    PARSE2 --> |Success| BOUND2{"index valid"}
    BOUND2 --> |No| BOUND_FAIL2["Return null"]
    BOUND2 --> |Yes| DELEG2["sel_index_list.get index
.loadModelData subkey"]

    ITEM_ACTUAL --> SUB3["key = key.substring sep + 1"]
    SUB3 --> WILD3{"key == *"}
    WILD3 --> |Yes| SIZE3["Return true_value_list.size"]
    WILD3 --> |No| PARSE3{"parse key as int"}
    PARSE3 --> |Fail| PARSE_FAIL3["Return null"]
    PARSE3 --> |Success| BOUND3{"index valid"}
    BOUND3 --> |No| BOUND_FAIL3["Return null"]
    BOUND3 --> |Yes| DELEG3["true_value_list.get index
.loadModelData subkey"]

    ITEM_LABEL --> SUB4["key = key.substring sep + 1"]
    SUB4 --> WILD4{"key == *"}
    WILD4 --> |Yes| SIZE4["Return label_value_list.size"]
    WILD4 --> |No| PARSE4{"parse key as int"}
    PARSE4 --> |Fail| PARSE_FAIL4["Return null"]
    PARSE4 --> |Success| BOUND4{"index valid"}
    BOUND4 --> |No| BOUND_FAIL4["Return null"]
    BOUND4 --> |Yes| DELEG4["label_value_list.get index
.loadModelData subkey"]

    SIZE1 --> END(["Return"])
    SIZE2 --> END
    SIZE3 --> END
    SIZE4 --> END
    DELEG1 --> END
    DELEG2 --> END
    DELEG3 --> END
    DELEG4 --> END
    PARSE_FAIL1 --> END
    PARSE_FAIL2 --> END
    PARSE_FAIL3 --> END
    PARSE_FAIL4 --> END
    BOUND_FAIL1 --> END
    BOUND_FAIL2 --> END
    BOUND_FAIL3 --> END
    BOUND_FAIL4 --> END
    NULLRET --> END
    DEFAULT --> END
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | A two-part identifier in the format `ITEM_TYPE/INDEX` that specifies which item collection to access and which element within that collection. The item type is one of four Japanese strings: `項目数` (Item Count, type `Long`), `選択値` (Selected Value, type `Long`), `項目実値` (Item Actual Value, type `String`), or `項目ラベル` (Item Label, type `String`). The index portion is either a numeric string (zero-based position in the list) or the wildcard `*` to request the total element count. Affects processing by routing to the corresponding typed list branch. |
| 2 | `subkey` | `String` | A secondary key passed through to the inner bean's `loadModelData(subkey)` method. Its meaning depends on the concrete type of the inner bean (`X33VDataTypeLongBean` or `X33VDataTypeStringBean`). For simple items this may be `null` or a property name; for nested structures it may be a nested field identifier. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `list_size_list` | `X33VDataTypeList` | Collection of item count beans (`Long`-typed), one per dynamic row/line item in the view. Each bean holds the count of a specific category of items. |
| `sel_index_list` | `X33VDataTypeList` | Collection of selected index beans (`Long`-typed), one per dynamic row. Each bean holds the currently selected index within its row (e.g., which option is chosen in a dropdown). |
| `true_value_list` | `X33VDataTypeList` | Collection of item actual value beans (`String`-typed), one per dynamic row. Each bean holds the raw value string of a field (e.g., entered text, selected code value). |
| `label_value_list` | `X33VDataTypeList` | Collection of item label beans (`String`-typed), one per dynamic row. Each bean holds the display label for a field (e.g., the human-readable name shown on screen). |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `FUW00110SF01DBean.loadModelData` | FUW00110SF01DBean | - | Calls `loadModelData` in `FUW00110SF01DBean` (self-recursive delegation to inner beans) |

**Analysis:** This method performs **no direct database operations, SC (Service Component) calls, or CBS (Common Business Service) invocations**. It is a pure in-memory data access method that operates entirely on `X33VDataTypeList` collections. The only external calls are the `loadModelData(subkey)` invocations on inner bean objects (`X33VDataTypeLongBean`, `X33VDataTypeStringBean`) stored within the lists — these are self-recursive calls to the same bean class's own overloaded data retrieval logic, delegating to deeper levels of the view model's data tree. There are no reads, creates, updates, or deletes against persistent storage.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | FUW00110SF01DBean | `FUW00110SF01DBean.loadModelData(key, subkey)` | self-recursive to inner `loadModelData(subkey)` |

**Note:** The primary caller of this method is `FUW00110SF01DBean` itself (self-invocation). This method is a public utility on the view bean, and its callers are screen-level or processing-level components within the `FUW00110SF` module that need to traverse or read the view's item model data. The call chain terminates at inner bean `loadModelData(subkey)` calls, which further delegate to nested data structures without reaching any database layer.

## 6. Per-Branch Detail Blocks

**Block 1** — IF `(null check) (L169)`

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

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `if (key == null || subkey == null)` | Null guard — returns null if key or subkey is null (key = item name, subkey = sub-key) |
| 2 | RETURN | `return null;` | Return null when input validation fails |

**Block 2** — IF (`item count branch`) `(項目数)` (L171)

Locate the `/` separator in the key, then branch on whether the key matches the "Item Count" category (`項目数`).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` | Find the position of the `/` separator in key |
| 2 | IF | `if (key.equals("項目数"))` | Check if key refers to Item Count (item count, Long type, item ID: list_size) [-> 項目数="Item Count"] |
| 3 | SET | `key = key.substring(separaterPoint + 1);` | Extract the index portion after `/` |

**Block 2.1** — IF (wildcard branch) `(L175)`

If the extracted index is `*`, return the list size (element count).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `if (key.equals("*"))` | Check if wildcard `*` is specified for index [-> *="Wildcard"] |
| 2 | RETURN | `return Integer.valueOf(list_size_list.size());` | Return the total number of elements in the item count list |

**Block 2.2** — TRY/CATCH (index parsing) `(L182)`

Attempt to parse the key as an integer index. If it fails, return null.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `Integer tmpIndexInt = null;` | Initialize temp index variable |
| 2 | SET | `tmpIndexInt = Integer.valueOf(key);` | Parse key as integer (item index value) |
| 3 | CATCH | `catch (NumberFormatException e)` | If key is not a valid numeric string, return null (item index value is not numeric) |
| 4 | RETURN | `return null;` | Return null on parse failure |

**Block 2.3** — IF (null check on parsed index) `(L187)`

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | IF | `if (tmpIndexInt == null)` | If parsing produced null, return null |
| 2 | RETURN | `return null;` | Return null |

**Block 2.4** — IF (bounds check) `(L191)`

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `int tmpIndex = tmpIndexInt.intValue();` | Unbox Integer to int |
| 2 | IF | `if (tmpIndex < 0 || tmpIndex >= list_size_list.size())` | Check if index is within bounds of the item count list (item index value exceeds list count - 1) |
| 3 | RETURN | `return null;` | Return null if out of bounds |
| 4 | EXEC | `return ((X33VDataTypeLongBean)list_size_list.get(tmpIndex)).loadModelData(subkey);` | Cast list element to LongBean and delegate data retrieval for subkey |

**Block 3** — ELSE-IF (selected value branch) `(選択値)` (L195)

Identical structural pattern to Block 2, but operates on the selected index list (`sel_index_list`). Key matches "Selected Value" (`選択値`).

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `key = key.substring(separaterPoint + 1);` | Extract index portion after `/` |
| 2 | IF | `if (key.equals("*"))` | Wildcard — return list size [-> 選択値="Selected Value"] |
| 3 | RETURN | `return Integer.valueOf(sel_index_list.size());` | Return number of elements in selected index list |
| 4 | SET | `Integer tmpIndexInt = null; tmpIndexInt = Integer.valueOf(key);` | Parse index |
| 5 | CATCH | `catch (NumberFormatException e)` | Return null if parse fails |
| 6 | IF | `if (tmpIndexInt == null)` | Null guard on parsed value |
| 7 | RETURN | `return null;` | Return null |
| 8 | SET | `int tmpIndex = tmpIndexInt.intValue();` | Unbox to int |
| 9 | IF | `if (tmpIndex < 0 || tmpIndex >= sel_index_list.size())` | Bounds check against selected index list |
| 10 | RETURN | `return null;` | Return null if out of bounds |
| 11 | EXEC | `return ((X33VDataTypeLongBean)sel_index_list.get(tmpIndex)).loadModelData(subkey);` | Delegate to inner bean's loadModelData |

**Block 4** — ELSE-IF (item actual value branch) `(項目実値)` (L219)

Identical structural pattern. Key matches "Item Actual Value" (`項目実値`). Operates on `true_value_list` with `X33VDataTypeStringBean`.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `key = key.substring(separaterPoint + 1);` | Extract index portion |
| 2 | IF | `if (key.equals("*"))` | Wildcard — return list size [-> 項目実値="Item Actual Value"] |
| 3 | RETURN | `return Integer.valueOf(true_value_list.size());` | Return element count of actual value list |
| 4-8 | SET/CATCH/IF/SET/IF | (same parse, null-check, bounds-check pattern) | Parse key, validate index range |
| 9 | RETURN | `return null;` | Out of bounds |
| 10 | EXEC | `return ((X33VDataTypeStringBean)true_value_list.get(tmpIndex)).loadModelData(subkey);` | Delegate to inner StringBean |

**Block 5** — ELSE-IF (item label branch) `(項目ラベル)` (L243)

Identical structural pattern. Key matches "Item Label" (`項目ラベル`). Operates on `label_value_list` with `X33VDataTypeStringBean`.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `key = key.substring(separaterPoint + 1);` | Extract index portion |
| 2 | IF | `if (key.equals("*"))` | Wildcard — return list size [-> 項目ラベル="Item Label"] |
| 3 | RETURN | `return Integer.valueOf(label_value_list.size());` | Return element count of label list |
| 4-8 | SET/CATCH/IF/SET/IF | (same parse, null-check, bounds-check pattern) | Parse key, validate index range |
| 9 | RETURN | `return null;` | Out of bounds |
| 10 | EXEC | `return ((X33VDataTypeStringBean)label_value_list.get(tmpIndex)).loadModelData(subkey);` | Delegate to inner StringBean |

**Block 6** — ELSE (no match) (L267)

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | RETURN | `return null;` | No matching item type found — return null (no property matches the condition) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `項目数` | Field (Japanese) | Item Count — the category name for list elements that hold Long-typed counts of items per row in a dynamic table view |
| `選択値` | Field (Japanese) | Selected Value — the category name for list elements that hold Long-typed selected indices (e.g., which dropdown option is chosen) |
| `項目実値` | Field (Japanese) | Item Actual Value — the category name for list elements that hold String-typed raw field values (e.g., entered data, system codes) |
| `項目ラベル` | Field (Japanese) | Item Label — the category name for list elements that hold String-typed display labels (e.g., human-readable field names shown on the UI) |
| `list_size_list` | Field | Item Count List — an `X33VDataTypeList` containing `X33VDataTypeLongBean` objects, one per row, each holding the count of items in that row |
| `sel_index_list` | Field | Selected Index List — an `X33VDataTypeList` containing `X33VDataTypeLongBean` objects, one per row, each holding the selected option index |
| `true_value_list` | Field | Item Actual Value List — an `X33VDataTypeList` containing `X33VDataTypeStringBean` objects, one per row, each holding the raw value string of a field |
| `label_value_list` | Field | Item Label List — an `X33VDataTypeList` containing `X33VDataTypeStringBean` objects, one per row, each holding the display label for a field |
| `X33VDataTypeList` | Class | A typed list container for view data items, supporting `get(index)` and `size()` operations |
| `X33VDataTypeLongBean` | Class | A bean holding a Long-typed value (used for counts and selected indices in the view model) |
| `X33VDataTypeStringBean` | Class | A bean holding a String-typed value (used for actual values and labels in the view model) |
| `FUW00110SF` | Module | A web view module within the `eo.web.webview` package — part of the telecom billing/ordering system's presentation layer |
| View Bean | Pattern | A Java Bean that holds the state of a screen's view model, bridging the presentation tier and business processing tier |
| `*` (wildcard) | Constant | A special index value meaning "return the total count of elements" instead of a specific element's data |
| `key` | Parameter | A two-part identifier: `ITEM_TYPE/INDEX` where ITEM_TYPE specifies the category and INDEX specifies the element position |
| `subkey` | Parameter | A secondary identifier passed to the inner bean for deeper-level data retrieval (e.g., field name within a complex item) |
