# Business Logic — FUW07101SF03DBean.loadModelData() [23 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW07101SF.FUW07101SF03DBean` |
| Layer | Webview / View Data Bean (Screen-side DBean, View Layer) |
| Module | `FUW07101SF` (Package: `eo.web.webview.FUW07101SF`) |

## 1. Role

### FUW07101SF03DBean.loadModelData()

This method serves as a **key-based data accessor** for the K-Opticom web application framework, implementing the `X33VDataTypeBeanInterface` contract for model-driven UI binding. It is part of the **send destination management** module (`FUW07101SF`), which deals with managing email address lists used as send destinations for service notification messages. The method receives a `key` (item name) and an optional `subkey` (data field specifier), and dispatches to the appropriate internal field based on the item/subkey combination — functioning as a **routing/dispatch pattern** within the data bean.

The method specifically handles the **"Send Destination Email Address" (送信先メールアドレス)** item, a domain-specific UI concept in the telecom order fulfillment system where customers configure email notification recipients for their service contracts. It supports two data sub-fields: the actual email **value** (`value`) and the associated **state** (`state`) which tracks initialization/validity status of the send destination entry. When no matching key/subkey combination is found, the method gracefully returns `null`, allowing the framework's default handling to take over. This is a **shared utility** called by the screen framework during view rendering and data population, rather than a business logic entry point.

## 2. Processing Pattern (Detailed Business Logic)

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

    START --> CHECK_NULL{"key or subkey is null?"}

    CHECK_NULL -->|true| RETURN_NULL["return null"]

    CHECK_NULL -->|false| FIND_SEP{"indexOf('/') in key?"}

    FIND_SEP --> MAIN_CHECK{"key equals '送信先メールアドレス'?"}

    MAIN_CHECK -->|true| SUB_CHECK{"subkey equals 'value' (case-insensitive)?"}

    SUB_CHECK -->|true| GET_VALUE["getMlad_value()"]
    SUB_CHECK -->|false| GET_STATE["getMlad_state()"]

    MAIN_CHECK -->|false| RETURN_NULL

    RETURN_NULL --> END_NODE(["Return"])
    GET_VALUE --> END_NODE
    GET_STATE --> END_NODE
```

**Branch Summary:**

| Branch | Condition | Behavior |
|--------|-----------|----------|
| Null guard | `key == null || subkey == null` | Returns `null` immediately — prevents NPE on framework-invoked calls |
| Key mismatch | `key` does not equal `送信先メールアドレス` | Returns `null` — delegates to other data beans in the list for their own keys |
| Value subkey | `subkey.equalsIgnoreCase("value")` | Returns the email address value via `getMlad_value()` |
| State subkey | `subkey.equalsIgnoreCase("state")` | Returns the state string via `getMlad_state()` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `key` | `String` | The **item name** (項目名) used by the K-Opticom framework to identify which data field to access. For this bean, the expected value is `"送信先メールアドレス"` (Send Destination Email Address), a UI concept representing an email recipient entry in a service notification settings list. Values are compared via `equals()`, so the match is case-sensitive. |
| 2 | `subkey` | `String` | The **sub-key** (サブキー) that specifies which sub-field of the matched item to retrieve. Accepts `"value"` (case-insensitive) to return the actual email address string, or `"state"` (case-insensitive) to return the initialization/state flag. Used as a secondary discriminator within the item type. |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `mlad_value` | `String` | The email address value stored for the send destination entry. Initialized to `""` (empty string) by default. |
| `mlad_state` | `String` | The state/status string tracking the initialization or validity of the send destination entry. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `FUW07101SF03DBean.getMlad_value` | FUW07101SF03DBean | - | Returns the `mlad_value` field — getter for the send destination email address value |
| R | `FUW07101SF03DBean.getMlad_state` | FUW07101SF03DBean | - | Returns the `mlad_state` field — getter for the send destination state/status flag |

**Classification:** Both called methods are simple getter operations (R — Read) that return instance field values. No database access, no service component calls, and no CRUD operations on persistent entities occur within this method. The method is purely a **view-model data accessor** that exposes bean fields to the framework.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Webview Framework | `X33VViewBaseBean.loadModelData(key, subkey)` -> `FUW07101SF03DBean.loadModelData(key, subkey)` | `getMlad_value[R]`, `getMlad_state[R]` |
| 2 | Screen:FUW07101SF | `FUW07101SFBean.getCreateNewIndex(key)` -> creates `FUW07101SF03DBean` instance -> framework invokes `loadModelData` during data binding | `getMlad_value[R]`, `getMlad_state[R]` |

**Caller context:**
- This `loadModelData()` method is invoked by the **K-Opticom X33 framework** itself during view rendering, when the framework needs to populate UI components with data from typed-list beans.
- The parent bean `FUW07101SFBean` creates instances of `FUW07101SF03DBean` for each row in the **"Send Destination List" (送信先リスト)** data table (item ID: `mlad_list`) via the `getCreateNewIndex()` method (around line 6196).
- Other modules (`FUW00912SF`, `FUW00926SF`, etc.) invoke `loadModelData()` on their own data beans, but those are **different classes** implementing the same interface — not this specific `FUW07101SF03DBean` instance.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF] `(key == null || subkey == null)` (L99)

> Null guard: Returns null if either parameter is null. Prevents NullPointerException when the framework calls this method with null values during initial data binding or cleanup.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // key, subkey が null の場合、null を返す (If key/subkey is null, return null) |

**Block 2** — [EXPR] `key.indexOf("/")` (L102)

> Computes the position of the "/" delimiter within the key. The result (`separaterPoint`) is computed but **never used** in this method's logic — likely a remnant from a prior version that supported nested key paths with "/" separators.

| # | Type | Code |
|---|------|------|
| 1 | SET | `int separaterPoint = key.indexOf("/");` // Compute delimiter position (unused) |

**Block 3** — [IF] `(key.equals("送信先メールアドレス"))` (L104)

> Primary dispatch branch: Checks if the key matches the send destination email address item name. This is the only item type handled by this DBean instance. If the key does not match, processing falls through to the final `return null` at line 119.

| # | Type | Code |
|---|------|------|
| 1 | IF | `key.equals("送信先メールアドレス")` // 項目ごとに処理を入れる。データタイプがStringの項目"送信先メールアドレス" (Item-specific processing. Data type is the String item "Send Destination Email Address") |

**Block 3.1** — [IF-ELSE-IF] `(subkey.equalsIgnoreCase("value"))` (L105)

> Value sub-branch: When subkey is `"value"` (case-insensitive), returns the actual email address stored in `mlad_value`. This is the primary data retrieval path — the framework calls this to populate the email address input field on the screen.

| # | Type | Code |
|---|------|------|
| 1 | IF | `subkey.equalsIgnoreCase("value")` |
| 2 | CALL | `getMlad_value()` |
| 3 | RETURN | `return getMlad_value();` // Returns the email address value |

**Block 3.2** — [ELSE-IF] `(subkey.equalsIgnoreCase("state"))` (L108)

> State sub-branch: When subkey is `"state"` (case-insensitive), returns the state string stored in `mlad_state`. The state tracks whether this send destination entry has been initialized or validated. Used by the framework to determine UI behavior (e.g., whether to show the entry as active).

| # | Type | Code |
|---|------|------|
| 1 | ELSE-IF | `else if(subkey.equalsIgnoreCase("state"))` // subkey が"state"の場合、ステータスを返す (If subkey is "state", return the status) |
| 2 | CALL | `getMlad_state()` |
| 3 | RETURN | `return getMlad_state();` |

**Block 4** — [RETURN] (L119)

> Catch-all default: If no matching key is found (i.e., `key` is not `"送信先メールアドレス"`), returns `null`. This allows the framework to skip this data bean and potentially delegate to other beans in the data table for their own item types.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null;` // 条件に合致するプロパティが存在しない場合は、null を返す (If no property matches the condition, return null) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `mlad` | Field prefix | Mail List As Destination — internal field prefix for send destination email address data. `mlad_value` stores the email address; `mlad_state` stores the entry state. |
| `mlad_update` | Field | Send destination update flag — tracks whether the send destination entry has been modified since last load. |
| `mlad_value` | Field | Send destination email address value — the actual email address string stored for a notification recipient entry. |
| `mlad_state` | Field | Send destination state — initialization/validation status string for the send destination entry. |
| 送信先メールアドレス | Japanese field | Send Destination Email Address — the UI item name (key) for managing email notification recipients in the service contract system. |
| 送信先リスト | Japanese term | Send Destination List — the data table (`mlad_list`) that holds a list of `FUW07101SF03DBean` entries, each representing one email recipient for service notifications. |
| key | Parameter | Item name — the framework-level identifier for a data field within a typed-list entry. Determines which data accessor logic to execute. |
| subkey | Parameter | Sub-key — secondary identifier within an item, specifying which sub-field (e.g., `value`, `state`) to retrieve. |
| X33VDataTypeBeanInterface | Technical | K-Opticom framework interface for beans that support keyed data loading/saving. The `loadModelData`/`storeModelData` methods implement the data binding contract. |
| X33VListedBeanInterface | Technical | K-Opticom framework interface for beans that can exist within typed-list data structures (data tables). |
| DBean | Technical abbreviation | Data Bean — a view-layer component that holds UI state and data for a screen's input fields. Part of the X33 web framework's MVC pattern. |
| Web Client Tool | Technical | K-Opticom's code generation tool (Web Client tool V01/L01) that scaffolds web screen beans from design definitions. |
